Skip to content

Commit e73a7c6

Browse files
authored
Merge pull request #25 from pallets-eco/uv
use uv
2 parents 6cdc3c6 + 5dd1fda commit e73a7c6

21 files changed

+2559
-483
lines changed

.github/workflows/lock.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
permissions:
1111
issues: write
1212
pull-requests: write
13+
discussions: write
1314
concurrency:
1415
group: lock
1516
jobs:

.github/workflows/pre-commit.yaml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@ name: pre-commit
22
on:
33
pull_request:
44
push:
5-
branches: [main, '*.x']
5+
branches: [main, stable]
66
jobs:
77
main:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
11-
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
12-
with:
13-
python-version: 3.x
14-
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
15-
- uses: pre-commit-ci/lite-action@9d882e7a565f7008d4faf128f27d1cb6503d4ebf # v1.0.2
16-
if: ${{ !cancelled() }}
10+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
11+
- uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
12+
with:
13+
enable-cache: true
14+
prune-cache: false
15+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
16+
id: setup-python
17+
with:
18+
python-version-file: pyproject.toml
19+
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
20+
with:
21+
path: ~/.cache/pre-commit
22+
key: pre-commit|${{ hashFiles('pyproject.toml', '.pre-commit-config.yaml') }}
23+
- run: uv run --locked --group pre-commit pre-commit run --show-diff-on-failure --color=always --all-files
24+
- uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 # v1.1.0
25+
if: ${{ !cancelled() }}

.github/workflows/publish.yaml

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
11
name: Publish
22
on:
33
push:
4-
tags:
5-
- '*'
4+
tags: ['*']
65
jobs:
76
build:
87
runs-on: ubuntu-latest
98
outputs:
109
hash: ${{ steps.hash.outputs.hash }}
1110
steps:
12-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
13-
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
11+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
12+
- uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
1413
with:
15-
python-version: '3.x'
16-
cache: pip
17-
cache-dependency-path: requirements*/*.txt
18-
- run: pip install -r requirements/build.txt
19-
# Use the commit date instead of the current date during the build.
14+
enable-cache: true
15+
prune-cache: false
16+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
17+
with:
18+
python-version-file: pyproject.toml
2019
- run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
21-
- run: python -m build
22-
# Generate hashes used for provenance.
20+
- run: uv build
2321
- name: generate hash
2422
id: hash
2523
run: cd dist && echo "hash=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT
26-
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
24+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
2725
with:
28-
name: dist
2926
path: ./dist
3027
provenance:
3128
needs: [build]
@@ -34,35 +31,33 @@ jobs:
3431
id-token: write
3532
contents: write
3633
# Can't pin with hash due to how this workflow works.
37-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
34+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0
3835
with:
3936
base64-subjects: ${{ needs.build.outputs.hash }}
4037
create-release:
41-
# Upload the sdist, wheels, and provenance to a GitHub release. They remain
42-
# available as build artifacts for a while as well.
4338
needs: [provenance]
4439
runs-on: ubuntu-latest
4540
permissions:
4641
contents: write
4742
steps:
48-
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
43+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
4944
- name: create release
5045
run: >
5146
gh release create --draft --repo ${{ github.repository }}
5247
${{ github.ref_name }}
53-
*.intoto.jsonl/* dist/*
48+
*.intoto.jsonl/* artifact/*
5449
env:
5550
GH_TOKEN: ${{ github.token }}
5651
publish-pypi:
5752
needs: [provenance]
58-
# Wait for approval before attempting to upload to PyPI. This allows reviewing the
59-
# files in the draft release.
6053
environment:
6154
name: publish
62-
url: https://pypi.org/project/flask-orjson/
55+
url: https://pypi.org/project/flask-orjson/${{ github.ref_name }}
6356
runs-on: ubuntu-latest
6457
permissions:
6558
id-token: write
6659
steps:
67-
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
68-
- uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
60+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
61+
- uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
62+
with:
63+
packages-dir: artifact/

.github/workflows/tests.yaml

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,48 @@
11
name: Tests
22
on:
3-
push:
4-
branches:
5-
- main
6-
- '*.x'
73
pull_request:
4+
paths-ignore: ['docs/**', 'README.md']
5+
push:
6+
branches: [main, stable]
7+
paths-ignore: ['docs/**', 'README.md']
88
jobs:
99
tests:
10-
name: ${{ matrix.python }}
11-
runs-on: ubuntu-latest
10+
name: ${{ matrix.name || matrix.python }}
11+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python: ['3.12', '3.11', '3.10', '3.9', '3.8']
15+
include:
16+
- {python: '3.13'}
17+
- {python: '3.12'}
18+
- {python: '3.11'}
19+
- {python: '3.10'}
20+
- {python: '3.9'}
21+
- {python: '3.8'}
1622
steps:
17-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
18-
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
- uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
25+
with:
26+
enable-cache: true
27+
prune-cache: false
28+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1929
with:
2030
python-version: ${{ matrix.python }}
21-
allow-prereleases: true
22-
cache: pip
23-
cache-dependency-path: requirements/*.txt
24-
- run: pip install tox
25-
- run: tox run -e py${{ matrix.python }}
31+
- run: uv run --locked tox run -e ${{ matrix.tox || format('py{0}', matrix.python) }}
2632
typing:
2733
runs-on: ubuntu-latest
2834
steps:
29-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
30-
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
35+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+
- uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
37+
with:
38+
enable-cache: true
39+
prune-cache: false
40+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
3141
with:
32-
python-version: '3.x'
33-
cache: pip
34-
cache-dependency-path: requirements/*.txt
42+
python-version-file: pyproject.toml
3543
- name: cache mypy
36-
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
44+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
3745
with:
3846
path: ./.mypy_cache
3947
key: mypy|${{ hashFiles('pyproject.toml') }}
40-
- run: pip install tox
41-
- run: tox run -e typing
48+
- run: uv run --locked tox run -e typing

.gitignore

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
/.idea/
2-
/.vscode/
3-
/.venv*/
4-
/venv*/
1+
.idea/
2+
.vscode/
53
__pycache__/
6-
/dist/
7-
/.coverage*
8-
/htmlcov/
9-
/.tox/
10-
/docs/_build/
4+
dist/
5+
.coverage*
6+
htmlcov/
7+
.tox/
8+
docs/_build/

.pre-commit-config.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.6.2
3+
rev: 76e47323a83cd9795e4ff9a1de1c0d2eef610f17 # frozen: v0.11.11
44
hooks:
55
- id: ruff
66
- id: ruff-format
7+
- repo: https://github.com/astral-sh/uv-pre-commit
8+
rev: 648bdbfd6bb1a82f132ecc2c666e0d1b2e4b0d94 # frozen: 0.7.8
9+
hooks:
10+
- id: uv-lock
711
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v4.6.0
12+
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
913
hooks:
1014
- id: check-merge-conflict
1115
- id: debug-statements

.readthedocs.yaml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
version: 2
22
build:
3-
os: ubuntu-22.04
3+
os: ubuntu-24.04
44
tools:
5-
python: '3.12'
6-
python:
7-
install:
8-
- requirements: requirements/docs.txt
9-
- method: pip
10-
path: .
11-
sphinx:
12-
builder: dirhtml
13-
fail_on_warning: true
5+
python: '3.13'
6+
commands:
7+
- asdf plugin add uv
8+
- asdf install uv latest
9+
- asdf global uv latest
10+
- uv run --group docs sphinx-build -W -b dirhtml docs $READTHEDOCS_OUTPUT/html

0 commit comments

Comments
 (0)