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
12 changes: 9 additions & 3 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Documentation

# no permissions by default
permissions: {}

on:
pull_request:
push:
Expand All @@ -12,15 +15,18 @@ on:
jobs:
build-docs:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: checkout
uses: actions/checkout@v5
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
persist-credentials: false

- name: Setup Micromamba Python
uses: mamba-org/setup-micromamba@v2
uses: mamba-org/setup-micromamba@7f29b8b80078b1b601dfa018b0f7425c587c63bb # v2.0.6
with:
environment-name: TEST
init-shell: bash
Expand All @@ -44,7 +50,7 @@ jobs:

- name: Deploy
if: success() && github.event_name == 'release'
uses: peaceiris/actions-gh-pages@v4
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
29 changes: 20 additions & 9 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,24 @@ defaults:
shell: bash

jobs:
packages:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/python-ctd/
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
# Should be enough for setuptools-scm
fetch-depth: 100
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.x"

Expand All @@ -29,23 +40,23 @@ jobs:

- name: Install build tools
run: |
python -m pip install --upgrade pip build twine
python -m pip install --upgrade build

- name: Build binary wheel
- name: Build sdist and binary wheel
run: python -m build --sdist --wheel . --outdir dist

- name: CheckFiles
run: |
ls dist
python -m pip install --upgrade check-manifest
check-manifest --verbose

- name: Test wheels
run: |
cd dist && python -m pip install *.whl
python -m pip install --upgrade twine
python -m twine check *

- name: Publish a Python distribution to PyPI
if: success() && github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
15 changes: 10 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
name: Tests

# no permissions by default
permissions: {}

on:
pull_request:
push:
branches: [main]
branches: [ main ]

jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ "3.11", "3.12" ]
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: [ "3.11", "3.12", "3.13" ]
os: [ windows-latest, ubuntu-latest, macos-latest ]
fail-fast: false

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Setup Micromamba Python ${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@v2
uses: mamba-org/setup-micromamba@7f29b8b80078b1b601dfa018b0f7425c587c63bb # v2.0.6
with:
environment-name: TEST
init-shell: bash
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ repos:
hooks:
- id: pyproject-fmt

- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.12.1
hooks:
- id: zizmor

ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
Expand Down
15 changes: 14 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
include *.txt
include README.md
recursive-include ctd *.py
include pyproject.toml

graft ctd

prune .github
prune *.egg-info
prune docs
prune notebooks
prune tests

exclude ruff.toml
exclude .gitignore
exclude .pre-commit-config.yaml
exclude *.yml
exclude ctd/_version.py
Loading