funcsort 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- funcsort-0.2.0/.github/FUNDING.yml +16 -0
- funcsort-0.2.0/.github/workflows/bump-version-by-labels.yml +74 -0
- funcsort-0.2.0/.github/workflows/ci.yml +86 -0
- funcsort-0.2.0/.github/workflows/coverage.yml +46 -0
- funcsort-0.2.0/.github/workflows/gitleaks.yml +28 -0
- funcsort-0.2.0/.github/workflows/lint-public.yml +70 -0
- funcsort-0.2.0/.github/workflows/pypi.yml +40 -0
- funcsort-0.2.0/.github/workflows/release.yml +70 -0
- funcsort-0.2.0/.github/workflows/test.yml +51 -0
- funcsort-0.2.0/.gitignore +174 -0
- funcsort-0.2.0/.pre-commit-config.yaml +57 -0
- funcsort-0.2.0/.pre-commit-hooks.yaml +7 -0
- funcsort-0.2.0/.python-version +1 -0
- funcsort-0.2.0/.vscode/settings.json +8 -0
- funcsort-0.2.0/LICENSE +21 -0
- funcsort-0.2.0/Makefile +29 -0
- funcsort-0.2.0/PKG-INFO +384 -0
- funcsort-0.2.0/README.md +358 -0
- funcsort-0.2.0/coverage.toml +13 -0
- funcsort-0.2.0/funcsort.toml +2 -0
- funcsort-0.2.0/pyproject.toml +54 -0
- funcsort-0.2.0/pytest.toml +6 -0
- funcsort-0.2.0/ruff.toml +9 -0
- funcsort-0.2.0/src/funcsort/__init__.py +3 -0
- funcsort-0.2.0/src/funcsort/config.py +158 -0
- funcsort-0.2.0/src/funcsort/config_types.py +77 -0
- funcsort-0.2.0/src/funcsort/groups.py +184 -0
- funcsort-0.2.0/src/funcsort/logger.py +32 -0
- funcsort-0.2.0/src/funcsort/main.py +171 -0
- funcsort-0.2.0/src/funcsort/sorter.py +338 -0
- funcsort-0.2.0/tests/__init__.py +1 -0
- funcsort-0.2.0/tests/test_config.py +159 -0
- funcsort-0.2.0/tests/test_generic.py +238 -0
- funcsort-0.2.0/tests/test_golden.py +90 -0
- funcsort-0.2.0/tests/test_main.py +181 -0
- funcsort-0.2.0/tests/test_nosort.py +120 -0
- funcsort-0.2.0/tests/test_properties.py +150 -0
- funcsort-0.2.0/tests/test_sorter.py +371 -0
- funcsort-0.2.0/uv.lock +884 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# These are supported funding model platforms
|
|
2
|
+
|
|
3
|
+
github: HEROgold # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
|
4
|
+
# patreon: # Replace with a single Patreon username
|
|
5
|
+
# open_collective: # Replace with a single Open Collective username
|
|
6
|
+
# ko_fi: # Replace with a single Ko-fi username
|
|
7
|
+
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
|
8
|
+
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
9
|
+
# liberapay: # Replace with a single Liberapay username
|
|
10
|
+
# issuehunt: # Replace with a single IssueHunt username
|
|
11
|
+
# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
|
12
|
+
# polar: # Replace with a single Polar username
|
|
13
|
+
# buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
|
14
|
+
# thanks_dev: # Replace with a single thanks.dev username
|
|
15
|
+
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
|
16
|
+
#
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
name: Bump Version By Labels
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [closed]
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
bump-version:
|
|
10
|
+
if: github.event.pull_request.merged == true
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write
|
|
14
|
+
pull-requests: write
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
with:
|
|
19
|
+
fetch-depth: 0
|
|
20
|
+
|
|
21
|
+
- name: Set up Python
|
|
22
|
+
uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: "3.*"
|
|
25
|
+
|
|
26
|
+
- name: Install uv
|
|
27
|
+
uses: astral-sh/setup-uv@v4
|
|
28
|
+
with:
|
|
29
|
+
version: "latest"
|
|
30
|
+
|
|
31
|
+
- name: Determine version bump
|
|
32
|
+
id: detect-bump
|
|
33
|
+
env:
|
|
34
|
+
LABELS: ${{ github.event.pull_request.labels.*.name }}
|
|
35
|
+
run: |
|
|
36
|
+
# Check PR labels to determine bump type
|
|
37
|
+
if echo "$LABELS" | grep -q "Major"; then
|
|
38
|
+
echo "bump_type=major" >> $env:GITHUB_OUTPUT
|
|
39
|
+
elif echo "$LABELS" | grep -q "Minor"; then
|
|
40
|
+
echo "bump_type=minor" >> $env:GITHUB_OUTPUT
|
|
41
|
+
elif echo "$LABELS" | grep -q "Patch"; then
|
|
42
|
+
echo "bump_type=patch" >> $env:GITHUB_OUTPUT
|
|
43
|
+
else
|
|
44
|
+
echo "bump_type=" >> $env:GITHUB_OUTPUT
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
- name: Bump Version
|
|
48
|
+
if: steps.detect-bump.outputs.bump_type != ''
|
|
49
|
+
id: bump-version
|
|
50
|
+
run: |
|
|
51
|
+
uv run bump-my-version bump ${{ steps.detect-bump.outputs.bump_type }}
|
|
52
|
+
$NEW_VERSION = uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])"
|
|
53
|
+
echo "version-bumped=true" >> $env:GITHUB_OUTPUT
|
|
54
|
+
echo "new-version=$NEW_VERSION" >> $env:GITHUB_OUTPUT
|
|
55
|
+
|
|
56
|
+
- name: Create version bump PR
|
|
57
|
+
if: steps.bump-version.outputs.version-bumped == 'true'
|
|
58
|
+
run: |
|
|
59
|
+
git config --local user.email "action@github.com"
|
|
60
|
+
git config --local user.name "GitHub Action"
|
|
61
|
+
|
|
62
|
+
$BRANCH_NAME = "bump-version-${{ steps.bump-version.outputs.new-version }}"
|
|
63
|
+
git checkout -b "$BRANCH_NAME"
|
|
64
|
+
git add pyproject.toml
|
|
65
|
+
git commit -m "chore: bump version to ${{ steps.bump-version.outputs.new-version }}"
|
|
66
|
+
git push origin "$BRANCH_NAME"
|
|
67
|
+
|
|
68
|
+
gh pr create \
|
|
69
|
+
--title "chore: bump version to ${{ steps.bump-version.outputs.new-version }}" \
|
|
70
|
+
--body "Automated version bump to ${{ steps.bump-version.outputs.new-version }}" \
|
|
71
|
+
--base main \
|
|
72
|
+
--admin
|
|
73
|
+
env:
|
|
74
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags:
|
|
7
|
+
- "v*"
|
|
8
|
+
pull_request:
|
|
9
|
+
branches: [main]
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
lint:
|
|
13
|
+
name: Lint
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Install uv
|
|
19
|
+
uses: astral-sh/setup-uv@v4
|
|
20
|
+
with:
|
|
21
|
+
enable-cache: true
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.13"
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: uv sync
|
|
30
|
+
|
|
31
|
+
- name: Run ruff format check
|
|
32
|
+
run: uv run ruff format --check
|
|
33
|
+
|
|
34
|
+
- name: Run ruff linter
|
|
35
|
+
run: uv run ruff check
|
|
36
|
+
|
|
37
|
+
test:
|
|
38
|
+
name: Test
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
strategy:
|
|
41
|
+
matrix:
|
|
42
|
+
python-version: ["3.12", "3.13"]
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/checkout@v4
|
|
45
|
+
|
|
46
|
+
- name: Install uv
|
|
47
|
+
uses: astral-sh/setup-uv@v4
|
|
48
|
+
with:
|
|
49
|
+
enable-cache: true
|
|
50
|
+
|
|
51
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
52
|
+
uses: actions/setup-python@v5
|
|
53
|
+
with:
|
|
54
|
+
python-version: ${{ matrix.python-version }}
|
|
55
|
+
|
|
56
|
+
- name: Install dependencies
|
|
57
|
+
run: uv sync
|
|
58
|
+
|
|
59
|
+
- name: Run tests
|
|
60
|
+
run: uv run pytest -v --cov=funcsort --cov-report=term-missing
|
|
61
|
+
|
|
62
|
+
publish:
|
|
63
|
+
name: Publish to PyPI
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
needs: [lint, test]
|
|
66
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
67
|
+
permissions:
|
|
68
|
+
id-token: write
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
|
|
72
|
+
- name: Install uv
|
|
73
|
+
uses: astral-sh/setup-uv@v4
|
|
74
|
+
|
|
75
|
+
- name: Set up Python
|
|
76
|
+
uses: actions/setup-python@v5
|
|
77
|
+
with:
|
|
78
|
+
python-version: "3.13"
|
|
79
|
+
|
|
80
|
+
- name: Build package
|
|
81
|
+
run: uv build
|
|
82
|
+
|
|
83
|
+
- name: Publish to PyPI
|
|
84
|
+
run: uv publish
|
|
85
|
+
env:
|
|
86
|
+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Coverage
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows: ["Test"]
|
|
6
|
+
branches: [main]
|
|
7
|
+
types:
|
|
8
|
+
- completed
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
coveralls-upload:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Install uv
|
|
21
|
+
uses: astral-sh/setup-uv@v7
|
|
22
|
+
with:
|
|
23
|
+
enable-cache: true
|
|
24
|
+
|
|
25
|
+
- name: Set up Python 3.13
|
|
26
|
+
run: uv python install 3.13
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: uv sync --group dev
|
|
30
|
+
|
|
31
|
+
- name: Run tests with coverage
|
|
32
|
+
run: uv run coverage run --source=. -m pytest tests/
|
|
33
|
+
|
|
34
|
+
- name: Upload coverage data to coveralls.io
|
|
35
|
+
env:
|
|
36
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
37
|
+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
|
38
|
+
COVERALLS_SERVICE_NAME: github-actions
|
|
39
|
+
COVERALLS_PARALLEL: true
|
|
40
|
+
run: uvx coveralls --service=github
|
|
41
|
+
|
|
42
|
+
- name: Coveralls Finished
|
|
43
|
+
env:
|
|
44
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
45
|
+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
|
46
|
+
run: uvx coveralls --finish
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: Gitleaks
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
workflow_call:
|
|
10
|
+
|
|
11
|
+
concurrency: gitleaks-${{ github.ref }}
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
gitleaks:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout code
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0
|
|
24
|
+
|
|
25
|
+
- name: Run Gitleaks
|
|
26
|
+
uses: gitleaks/gitleaks-action@v2
|
|
27
|
+
env:
|
|
28
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
name: Type Check Public API
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
workflow_call:
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: lint-public-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
setup:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout code
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Install uv
|
|
26
|
+
uses: astral-sh/setup-uv@v5
|
|
27
|
+
with:
|
|
28
|
+
enable-cache: true
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: uv sync --dev
|
|
32
|
+
|
|
33
|
+
lint:
|
|
34
|
+
needs: setup
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
strategy:
|
|
37
|
+
fail-fast: false
|
|
38
|
+
matrix:
|
|
39
|
+
include:
|
|
40
|
+
- tool: ruff
|
|
41
|
+
args: "check ."
|
|
42
|
+
- tool: ty
|
|
43
|
+
args: "check . --ignore no-matching-overload"
|
|
44
|
+
- tool: pyrefly
|
|
45
|
+
args: "check ."
|
|
46
|
+
- tool: zuban
|
|
47
|
+
args: "check ."
|
|
48
|
+
- tool: mypy
|
|
49
|
+
args: "."
|
|
50
|
+
- tool: pyright
|
|
51
|
+
args: "."
|
|
52
|
+
steps:
|
|
53
|
+
- name: Checkout code
|
|
54
|
+
uses: actions/checkout@v4
|
|
55
|
+
|
|
56
|
+
- name: Install uv (Should be cached from setup job)
|
|
57
|
+
uses: astral-sh/setup-uv@v5
|
|
58
|
+
with:
|
|
59
|
+
enable-cache: true
|
|
60
|
+
|
|
61
|
+
- name: Cache lint results
|
|
62
|
+
uses: actions/cache@v4
|
|
63
|
+
with:
|
|
64
|
+
path: .lint_cache
|
|
65
|
+
key: ${{ runner.os }}-lint-${{matrix.tool}}-${{ hashFiles('**/tests/**/*.py', 'src/**') }}
|
|
66
|
+
restore-keys: |
|
|
67
|
+
${{ runner.os }}-lint-${{matrix.tool}}
|
|
68
|
+
|
|
69
|
+
- name: Run type checking - ${{matrix.tool}}
|
|
70
|
+
run: uv add ${{matrix.tool}} && uv run ${{matrix.tool}} ${{matrix.args}}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
repository_dispatch:
|
|
5
|
+
types: [new-release-created]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
publish-to-pypi:
|
|
13
|
+
name: Publish Python 🐍 distribution 📦 to PyPI
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
environment:
|
|
16
|
+
name: pypi
|
|
17
|
+
url: https://pypi.org/p/funcsort
|
|
18
|
+
permissions:
|
|
19
|
+
id-token: write # IMPORTANT: mandatory for trusted publishing
|
|
20
|
+
contents: read
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
with:
|
|
26
|
+
persist-credentials: false
|
|
27
|
+
|
|
28
|
+
- name: Install uv
|
|
29
|
+
uses: astral-sh/setup-uv@v7
|
|
30
|
+
with:
|
|
31
|
+
enable-cache: true
|
|
32
|
+
|
|
33
|
+
- name: Set up Python
|
|
34
|
+
run: uv python install 3.14
|
|
35
|
+
|
|
36
|
+
- name: Build distribution 📦
|
|
37
|
+
run: uv build
|
|
38
|
+
|
|
39
|
+
- name: Publish distribution 📦 to PyPI
|
|
40
|
+
run: uv publish
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
name: Auto-release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows: ["Test"]
|
|
6
|
+
branches: [main]
|
|
7
|
+
types:
|
|
8
|
+
- completed
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
new-release:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
|
|
17
|
+
outputs:
|
|
18
|
+
version_changed: ${{ steps.version-check.outputs.version_changed }}
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0 # Needed to get all tags for version comparison
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.*"
|
|
29
|
+
|
|
30
|
+
- name: Install uv
|
|
31
|
+
uses: astral-sh/setup-uv@v4
|
|
32
|
+
with:
|
|
33
|
+
version: "latest"
|
|
34
|
+
|
|
35
|
+
- name: Check if version changed
|
|
36
|
+
id: version-check
|
|
37
|
+
run: |
|
|
38
|
+
# Get current version from pyproject.toml
|
|
39
|
+
CURRENT_VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
|
|
40
|
+
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
|
41
|
+
|
|
42
|
+
# Check if this version already has a tag
|
|
43
|
+
if git tag --list | grep -q "^v$CURRENT_VERSION$"; then
|
|
44
|
+
echo "version_changed=false" >> $GITHUB_OUTPUT
|
|
45
|
+
echo "Version v$CURRENT_VERSION already exists as a tag"
|
|
46
|
+
else
|
|
47
|
+
echo "version_changed=true" >> $GITHUB_OUTPUT
|
|
48
|
+
echo "New version v$CURRENT_VERSION detected - will create release"
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
- name: Create GitHub Release
|
|
52
|
+
if: steps.version-check.outputs.version_changed == 'true'
|
|
53
|
+
uses: softprops/action-gh-release@v2
|
|
54
|
+
with:
|
|
55
|
+
tag_name: v${{ steps.version-check.outputs.current_version }}
|
|
56
|
+
name: Release v${{ steps.version-check.outputs.current_version }}
|
|
57
|
+
draft: false
|
|
58
|
+
prerelease: false
|
|
59
|
+
generate_release_notes: true
|
|
60
|
+
|
|
61
|
+
# Trigger PyPI workflow when after we create a release.
|
|
62
|
+
# Pypi workflow won't with the usual on-release trigger
|
|
63
|
+
# because another workflow (this one) created the release. (avoiding inf recursion)
|
|
64
|
+
- name: Trigger PyPI workflow
|
|
65
|
+
if: steps.version-check.outputs.version_changed == 'true'
|
|
66
|
+
uses: peter-evans/repository-dispatch@v2
|
|
67
|
+
with:
|
|
68
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
69
|
+
event-type: new-release-created
|
|
70
|
+
client-payload: '{"version": "${{ steps.version-check.outputs.current_version }}"}'
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
workflow_call:
|
|
10
|
+
|
|
11
|
+
concurrency: test-${{ github.sha }}
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
test:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
strategy:
|
|
20
|
+
matrix:
|
|
21
|
+
python-version: ["3.12", "3.13", "3.14", "3.15"]
|
|
22
|
+
fail-fast: false
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- name: Cache pytest results
|
|
28
|
+
id: cache-pytest
|
|
29
|
+
uses: actions/cache@v4
|
|
30
|
+
with:
|
|
31
|
+
path: .pytest_cache
|
|
32
|
+
key: ${{ runner.os }}-pytest-${{ matrix.python-version }}-${{ hashFiles('**/tests/**/*.py', 'src/**') }}
|
|
33
|
+
|
|
34
|
+
- name: Install uv
|
|
35
|
+
if: steps.cache-pytest.outputs.cache-hit != 'true'
|
|
36
|
+
uses: astral-sh/setup-uv@v7
|
|
37
|
+
with:
|
|
38
|
+
enable-cache: true
|
|
39
|
+
|
|
40
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
41
|
+
if: steps.cache-pytest.outputs.cache-hit != 'true'
|
|
42
|
+
run: uv python install ${{ matrix.python-version }}
|
|
43
|
+
|
|
44
|
+
- name: Install dependencies
|
|
45
|
+
if: steps.cache-pytest.outputs.cache-hit != 'true'
|
|
46
|
+
run: uv sync --group dev
|
|
47
|
+
|
|
48
|
+
- name: Run tests
|
|
49
|
+
if: steps.cache-pytest.outputs.cache-hit != 'true'
|
|
50
|
+
# Avoid executing examples in CI; they could run untrusted code from PRs
|
|
51
|
+
run: uv run pytest . --ignore=tests/test_examples_run.py
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# uv
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# https://docs.astral.sh/uv/concepts/projects/#lockfiles
|
|
102
|
+
#uv.lock
|
|
103
|
+
|
|
104
|
+
# pdm
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
106
|
+
#pdm.lock
|
|
107
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
108
|
+
# in version control.
|
|
109
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
110
|
+
.pdm.toml
|
|
111
|
+
|
|
112
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
113
|
+
__pypackages__/
|
|
114
|
+
|
|
115
|
+
# Celery stuff
|
|
116
|
+
celerybeat-schedule
|
|
117
|
+
celerybeat.pid
|
|
118
|
+
|
|
119
|
+
# SageMath parsed files
|
|
120
|
+
*.sage.py
|
|
121
|
+
|
|
122
|
+
# Environments
|
|
123
|
+
.env
|
|
124
|
+
.venv
|
|
125
|
+
env/
|
|
126
|
+
venv/
|
|
127
|
+
ENV/
|
|
128
|
+
env.bak/
|
|
129
|
+
venv.bak/
|
|
130
|
+
|
|
131
|
+
# Spyder project settings
|
|
132
|
+
.spyderproject
|
|
133
|
+
.spyproject
|
|
134
|
+
|
|
135
|
+
# Rope project settings
|
|
136
|
+
.ropeproject
|
|
137
|
+
|
|
138
|
+
# mkdocs documentation
|
|
139
|
+
/site
|
|
140
|
+
|
|
141
|
+
# mypy
|
|
142
|
+
.mypy_cache/
|
|
143
|
+
.dmypy.json
|
|
144
|
+
dmypy.json
|
|
145
|
+
|
|
146
|
+
# Pyre type checker
|
|
147
|
+
.pyre/
|
|
148
|
+
|
|
149
|
+
# pytype static type analyzer
|
|
150
|
+
.pytype/
|
|
151
|
+
|
|
152
|
+
# Cython debug symbols
|
|
153
|
+
cython_debug/
|
|
154
|
+
|
|
155
|
+
# PyCharm
|
|
156
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
157
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
158
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
159
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
160
|
+
#.idea/
|
|
161
|
+
|
|
162
|
+
# Nuitka builds
|
|
163
|
+
*.onefile-build/
|
|
164
|
+
*.build/
|
|
165
|
+
*.dist/
|
|
166
|
+
|
|
167
|
+
# macOS
|
|
168
|
+
.DS_Store
|
|
169
|
+
|
|
170
|
+
# IDE history
|
|
171
|
+
.history
|
|
172
|
+
|
|
173
|
+
# Ruff cache
|
|
174
|
+
.ruff_cache/
|