Repository navigation
Python 3.11-3.15 foundation: refreshed dependencies, modern toolchain, CI and trusted publishing (0.7.0) #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1c04d48
Require Python 3.11+, declare 3.11-3.15 support and refresh dependencies
jaykv 21d7aac
Fix breakage and deprecations with current click, rich-click and pyda…
jaykv 64c2243
Modernize for a Python 3.11 floor and widen ruff lint rules
jaykv e65ddcb
CI: test Python 3.11-3.15, run on pull requests, publish via trusted …
jaykv 2c9c593
Repo hygiene: uv-only Makefile, .python-version, gitignore gaps, fres…
jaykv 69619cc
Tighten dependency floors to what was verified, ignore pydantic-ai ev…
jaykv e76b4a6
Type ManifestOrCLI.convert without click's private _is_file_like helper
jaykv 2a39168
Merge branch 'soul'
jaykv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,36 @@ | ||
| name: Deploy docs to GitHub Pages | ||
| name: Deploy docs to GitHub Pages | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'docs/**' | ||
| - 'mkdocs.yaml' | ||
| - '.github/workflows/docs.yaml' | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: docs | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v7 | ||
| - name: Configure Git Credentials | ||
| run: | | ||
| git config user.name github-actions[bot] | ||
| git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: 3.x | ||
| - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | ||
| - uses: actions/cache@v4 | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v10.3.0 | ||
| with: | ||
| key: mkdocs-material-${{ env.cache_id }} | ||
| path: .cache | ||
| restore-keys: | | ||
| mkdocs-material- | ||
| - run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install uv | ||
| uv sync --group=docs | ||
| - run: uv run mkdocs gh-deploy --force | ||
| enable-cache: true | ||
| - name: Build and deploy | ||
| run: uv run --locked --only-group docs mkdocs gh-deploy --force | ||
| env: | ||
| MKDOCS_GIT_COMMITTERS_APIKEY: ${{ github.token }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| name: Publish to PyPI | ||
|
|
||
| # Publishes with PyPI trusted publishing (OIDC) - no API token is stored in the repository. | ||
| # One-time setup on https://pypi.org/manage/project/cliffy/settings/publishing/ : | ||
| # owner: jaykv, repository: cliffy, workflow: publish.yaml, environment: pypi | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build distributions | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v10.3.0 | ||
| - name: Build sdist and wheel | ||
| run: uv build | ||
| - name: Check the release tag matches the package version | ||
| run: | | ||
| version="$(uv version --short)" | ||
| tag="${GITHUB_REF_NAME#v}" | ||
| if [ "$version" != "$tag" ]; then | ||
| echo "::error::release tag '$GITHUB_REF_NAME' does not match pyproject version '$version'" | ||
| exit 1 | ||
| fi | ||
| - name: Smoke test the wheel | ||
| run: uv run --isolated --no-project --with dist/*.whl cli --version | ||
| - uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
| if-no-files-found: error | ||
|
|
||
| publish: | ||
| name: Upload to PyPI | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: pypi | ||
| url: https://pypi.org/project/cliffy/ | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/download-artifact@v8 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v10.3.0 | ||
| - name: Publish | ||
| run: uv publish --trusted-publishing always dist/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,74 +1,69 @@ | ||
| name: Python library with uv | ||
| name: CI | ||
|
|
||
| env: | ||
| COLUMNS: 120 | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'cliffy/**' | ||
| - 'tests/**' | ||
| - 'examples/**' | ||
| - '!examples/generated/**' | ||
| - 'pyproject.toml' | ||
| - 'uv.lock' | ||
| - 'Makefile' | ||
| - '.github/workflows/python-app.yaml' | ||
| pull_request: | ||
| paths: | ||
| - 'cliffy/**' | ||
| - 'tests/**' | ||
| - 'examples/**' | ||
| - '!examples/generated/**' | ||
| - 'pyproject.toml' | ||
| - 'uv.lock' | ||
| - 'Makefile' | ||
| - '.github/workflows/python-app.yaml' | ||
| workflow_dispatch: | ||
|
|
||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| COLUMNS: 120 | ||
| # the environment is synced once, explicitly; `uv run` inside the Makefile must not re-resolve it | ||
| UV_NO_SYNC: 1 | ||
|
|
||
| jobs: | ||
| build: | ||
| test: | ||
| name: Python ${{ matrix.python-version }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| extras: [true, false] | ||
| python-version: [ "3.13", "3.12", "3.11", "3.10", "3.9" ] | ||
| os: [ubuntu-latest] # windows-latest , macos-latest | ||
| isMain: | ||
| - ${{ contains(github.ref, 'main') }} | ||
| isTag: | ||
| - ${{ startsWith(github.ref, 'refs/heads/v') }} | ||
| exclude: | ||
| # - isMain: false | ||
| # os: windows-latest | ||
| - isMain: false | ||
| extras: false | ||
| # - isTag: true | ||
| # os: windows-latest | ||
| - isTag: true | ||
| extras: false | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| runs-on: ${{ matrix.os }} | ||
| python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| enable-cache: true | ||
| cache-suffix: ${{ matrix.extras }} | ||
| - name: Install library | ||
| run: uv sync | ||
| if: ${{ matrix.extras == false }} | ||
| - name: Install library | ||
| run: uv sync --all-extras | ||
| if: ${{ matrix.extras }} | ||
| - name: Code quality | ||
| run: | | ||
| uv run make lint | ||
| - name: Test with pytest | ||
| if: github.ref != 'refs/heads/main' || matrix.python-version != '3.13' | ||
| run: | | ||
| uv run make test | ||
| - name: Test with pytest + coverage | ||
| if: github.ref == 'refs/heads/main' && matrix.python-version == '3.13' | ||
| run: | | ||
| uv run make test-cov | ||
| - name: Coverage report | ||
| if: github.ref == 'refs/heads/main' && matrix.python-version == '3.13' | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| - name: Minimize uv cache | ||
| run: uv cache prune --ci | ||
| - uses: actions/checkout@v7 | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v10.3.0 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| enable-cache: true | ||
| - name: Install library | ||
| run: uv sync --locked --all-extras | ||
| - name: Code quality | ||
| run: make lint | ||
| - name: Test with pytest | ||
| if: github.ref != 'refs/heads/main' || matrix.python-version != '3.15' | ||
| run: make test | ||
| - name: Test with pytest + coverage | ||
| if: github.ref == 'refs/heads/main' && matrix.python-version == '3.15' | ||
| run: make test-cov | ||
| - name: Coverage report | ||
| if: github.ref == 'refs/heads/main' && matrix.python-version == '3.15' | ||
| uses: codecov/codecov-action@v7 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.13 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.