Skip to content
Open
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
25 changes: 25 additions & 0 deletions .codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
comment: false
github_checks:
annotations: false

codecov:
notify:
require_ci_to_pass: false

coverage:
status:
patch:
default:
informational: true
target: 95%
if_no_uploads: error
if_not_found: success
if_ci_failed: error
project:
default: false
library:
informational: true
target: 90%
if_no_uploads: error
if_not_found: success
if_ci_failed: error
File renamed without changes.
27 changes: 0 additions & 27 deletions .flake8

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python-version: [3.7, 3.8, 3.9, "3.10"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
name: ${{ matrix.os }} - ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
defaults:
Expand Down
47 changes: 0 additions & 47 deletions .github/workflows/code-style.yml

This file was deleted.

87 changes: 87 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: doc
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
pull_request:
push:
branches: [main]
release:
types: [published]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- run: |
sudo apt update
sudo apt install -y \
optipng \
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: 3.11
- uses: astral-sh/setup-uv@v7
- run: uv pip install --quiet --system .[doc]
- run: make -C doc html
- name: Prune sphinx environment
run: rm -R ./doc/_build/html/.doctrees
- uses: actions/upload-artifact@v7
with:
name: doc
path: ./doc/_build/html

deploy-push:
if: github.event_name == 'push'
needs: build
timeout-minutes: 10
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: doc
path: ./doc
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./doc
target-folder: dev
git-config-name: 'github-actions[bot]'
git-config-email: 'github-actions[bot]@users.noreply.github.com'
single-commit: false
force: true

deploy-release:
if: github.event_name == 'release'
needs: build
timeout-minutes: 10
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: doc
path: ./doc
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./doc
target-folder: ${{ github.event.release.tag_name }}
git-config-name: 'github-actions[bot]'
git-config-email: 'github-actions[bot]@users.noreply.github.com'
single-commit: false
force: true
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./doc
target-folder: latest
git-config-name: 'github-actions[bot]'
git-config-email: 'github-actions[bot]@users.noreply.github.com'
single-commit: false
force: true
39 changes: 19 additions & 20 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
name: publish

on:
on: # yamllint disable-line rule:truthy
release:
types: [published]
workflow_dispatch:

env:
UV_LOCKED: true

jobs:
pypi:
timeout-minutes: 10
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python 3.9
uses: actions/setup-python@v5
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v7
with:
activate-environment: true
- run: uv sync -q --no-default-groups
- run: uv build
- uses: softprops/action-gh-release@v3
with:
python-version: '3.9'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --progress-bar off --upgrade pip setuptools wheel
python -m pip install --progress-bar off .[build]
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m build
twine upload dist/*
files: dist/*
tag_name: ${{ github.event.release.tag_name }}
- run: uv publish --trusted-publishing always
71 changes: 71 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: pytest
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
pull_request:
push:
branches: [main]
workflow_dispatch:
schedule:
- cron: '0 8 * * 1'

jobs:
pytest:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python-version: ["3.10", "3.11", "3.12", "3.13"]
name: ${{ matrix.os }} - py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v7
- run: uv pip install --quiet --system .[test]
- run: pytest pycartool --cov=pycartool --cov-report=xml --cov-config=pyproject.toml
- uses: codecov/codecov-action@v6
with:
files: ./coverage.xml
flags: unittests # optional
name: codecov-umbrella # optional
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true # optional (default = false)

pytest-pip-pre:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
name: pip pre-release - py${{ matrix.python-version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v7
- name: Install package
run: |
uv pip install --quiet --system .[test]
uv pip install --quiet --system --upgrade --prerelease allow --only-binary :all: -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
- run: pytest pycartool --cov=pycartool --cov-report=xml --cov-config=pyproject.toml
- uses: codecov/codecov-action@v6
with:
files: ./coverage.xml
flags: unittests # optional
name: codecov-umbrella # optional
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true # optional (default = false)
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,6 @@ dmypy.json
target/
test-output.xml
test.ris
/doc/_build
/doc/api/generated
/doc/generated
35 changes: 35 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.9
hooks:
- id: ruff
name: ruff linter
args: [--fix, --show-fixes]
- id: ruff-format
name: ruff formatter

- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies: [tomli]

- repo: https://github.com/mscheltienne/bibclean
rev: 0.8.0
hooks:
- id: bibclean-fix
files: doc/references.bib
args: [--exit-non-zero-on-fix]

- repo: https://github.com/pappasam/toml-sort
rev: v0.24.2
hooks:
- id: toml-sort-fix
files: pyproject.toml

- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args: [--strict, -c, .yamllint.yaml]
files: (.github/|.codecov.yaml|.pre-commit-config.yaml|.yamllint.yaml)
Loading
Loading