Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "develop"
schedule:
interval: "monthly"
groups:
github-actions:
patterns:
- "*"
150 changes: 150 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: Build, test, and deploy

on:
push:
branches: [develop, main]
pull_request:
branches: [develop, main]
release:
types: [published]
workflow_dispatch:

permissions:
contents: read

jobs:
lint:
name: Lint and check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

- name: Check code with ruff
uses: astral-sh/ruff-action@v3
with:
version: "0.16.9"
args: check

- name: Check formatting with ruff
uses: astral-sh/ruff-action@v3
with:
version: "0.16.9"
args: format --check

build:
name: Build distributions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

- uses: actions/setup-python@v7
with:
python-version: "3.14"

- name: Check release tag matches package version
if: github.event_name == 'release'
shell: bash
run: |
version=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
tag="${GITHUB_REF_NAME#v}"
if [ "$tag" != "$version" ]; then
echo "::error::Release tag ($GITHUB_REF_NAME) does not match version in pyproject.toml ($version)"
exit 1
fi

- name: Build sdist and wheel
run: pipx run build

- name: Check distribution metadata
run: pipx run twine check --strict dist/*

- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/

test:
name: Test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# macos-15-intel is an Intel runner, macos-15 is Apple silicon
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-15-intel, macos-15]
python-version: ["3.10", "3.15"]
exclude:
# NumPy and SciPy do not provide Windows ARM64 packages for Python 3.10
- os: windows-11-arm
python-version: "3.10"
include:
# Test the intermediate Python versions on Linux only
- os: ubuntu-latest
python-version: "3.11"
- os: ubuntu-latest
python-version: "3.12"
- os: ubuntu-latest
python-version: "3.13"
- os: ubuntu-latest
python-version: "3.14"

steps:
# Checkout is only needed for the tests and sample data; the package is
# installed from the built wheel so the tests check what gets published
- uses: actions/checkout@v7
with:
persist-credentials: false

- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

- uses: actions/download-artifact@v8
with:
name: dist
path: dist

- name: Install tcplotter wheel and test dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install dist/*.whl pytest

- name: Run tests
run: python -m pytest -v

upload_testpypi:
name: Publish to TestPyPI
needs: [lint, build, test]
runs-on: ubuntu-latest
environment: testpypi
permissions:
id-token: write
if: github.event_name == 'workflow_dispatch'
steps:
- uses: actions/download-artifact@v8
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

upload_pypi:
name: Publish to PyPI
needs: [lint, build, test]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v8
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ __pycache__
.pixi/*
!.pixi/config.toml
.DS_Store

# Build and test output
build/
dist/
*.egg-info/
.pytest_cache/
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.12"

Expand Down
38 changes: 38 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
cff-version: 1.2.0
message: "If you use tcplotter in your work, please cite it as below."
type: software
title: "tcplotter: a Python package for creating and customizing thermochronometer age and closure temperature plots"
authors:
- family-names: Whipp
given-names: David M.
affiliation: University of Helsinki, Finland
- family-names: Ketcham
given-names: Richard A.
affiliation: University of Texas at Austin, USA
version: 0.5.0
doi: 10.5281/zenodo.5958939
license: GPL-3.0-or-later
repository-code: "https://github.com/HUGG/tcplotter"
url: "https://tcplotter.readthedocs.io/"
keywords:
- thermochronology
- geology
- geophysics
references:
- type: article
title: "Short communication: Modeling competing effects of cooling rate, grain size, and radiation damage in low-temperature thermochronometers"
authors:
- family-names: Whipp
given-names: David M.
- family-names: Kellett
given-names: Dawn A.
- family-names: Coutand
given-names: Isabelle
- family-names: Ketcham
given-names: Richard A.
journal: Geochronology
volume: 4
start: 143
end: 152
year: 2022
doi: 10.5194/gchron-4-143-2022
Loading
Loading