funcsort 0.2.0__tar.gz → 2.0.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-2.0.0/.github/workflows/bump-version-by-labels.yml +42 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/.github/workflows/ci.yml +18 -34
- {funcsort-0.2.0 → funcsort-2.0.0}/.github/workflows/coverage.yml +9 -3
- funcsort-2.0.0/.github/workflows/docs.yml +69 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/.github/workflows/gitleaks.yml +3 -2
- {funcsort-0.2.0 → funcsort-2.0.0}/.github/workflows/lint-public.yml +9 -5
- {funcsort-0.2.0 → funcsort-2.0.0}/.github/workflows/pypi.yml +5 -3
- {funcsort-0.2.0 → funcsort-2.0.0}/.github/workflows/release.yml +12 -6
- funcsort-2.0.0/.github/workflows/skylos.yml +65 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/.github/workflows/test.yml +5 -3
- {funcsort-0.2.0 → funcsort-2.0.0}/.gitignore +4 -1
- {funcsort-0.2.0 → funcsort-2.0.0}/.pre-commit-config.yaml +7 -0
- funcsort-2.0.0/PKG-INFO +207 -0
- funcsort-2.0.0/README.md +181 -0
- funcsort-2.0.0/docs/configuration.md +109 -0
- funcsort-2.0.0/docs/dependency-safety.md +40 -0
- funcsort-2.0.0/docs/example.md +66 -0
- funcsort-2.0.0/docs/index.md +32 -0
- funcsort-2.0.0/docs/nosort.md +54 -0
- funcsort-2.0.0/docs/reference/config.md +5 -0
- funcsort-2.0.0/docs/reference/groups.md +3 -0
- funcsort-2.0.0/docs/reference/ordering.md +3 -0
- funcsort-2.0.0/docs/reference/references.md +3 -0
- funcsort-2.0.0/docs/reference/sorter.md +3 -0
- funcsort-2.0.0/docs/sorting-behaviour.md +54 -0
- funcsort-2.0.0/funcsort.toml +6 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/pyproject.toml +35 -1
- funcsort-2.0.0/ruff.toml +36 -0
- funcsort-2.0.0/scripts/__init__.py +1 -0
- funcsort-2.0.0/scripts/check_reflow.py +132 -0
- funcsort-2.0.0/src/funcsort/cli_types.py +55 -0
- funcsort-2.0.0/src/funcsort/config.py +132 -0
- funcsort-2.0.0/src/funcsort/config_types.py +161 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/src/funcsort/groups.py +23 -9
- {funcsort-0.2.0 → funcsort-2.0.0}/src/funcsort/main.py +42 -26
- funcsort-2.0.0/src/funcsort/ordering.py +267 -0
- funcsort-2.0.0/src/funcsort/references.py +401 -0
- funcsort-2.0.0/src/funcsort/sorter.py +603 -0
- funcsort-2.0.0/tests/importability.py +155 -0
- funcsort-2.0.0/tests/test_check_reflow.py +61 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/tests/test_config.py +64 -3
- funcsort-2.0.0/tests/test_dependencies.py +374 -0
- funcsort-2.0.0/tests/test_function_placement.py +219 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/tests/test_golden.py +62 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/tests/test_main.py +105 -1
- funcsort-2.0.0/tests/test_ordering.py +143 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/tests/test_properties.py +89 -46
- funcsort-2.0.0/tests/test_references.py +179 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/uv.lock +579 -6
- funcsort-2.0.0/zensical.toml +67 -0
- funcsort-0.2.0/.github/workflows/bump-version-by-labels.yml +0 -74
- funcsort-0.2.0/PKG-INFO +0 -384
- funcsort-0.2.0/README.md +0 -358
- funcsort-0.2.0/funcsort.toml +0 -2
- funcsort-0.2.0/ruff.toml +0 -9
- funcsort-0.2.0/src/funcsort/config.py +0 -158
- funcsort-0.2.0/src/funcsort/config_types.py +0 -77
- funcsort-0.2.0/src/funcsort/sorter.py +0 -338
- {funcsort-0.2.0 → funcsort-2.0.0}/.github/FUNDING.yml +0 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/.pre-commit-hooks.yaml +0 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/.python-version +0 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/.vscode/settings.json +0 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/LICENSE +0 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/Makefile +0 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/coverage.toml +0 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/pytest.toml +0 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/src/funcsort/__init__.py +0 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/src/funcsort/logger.py +0 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/tests/__init__.py +0 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/tests/test_generic.py +0 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/tests/test_nosort.py +0 -0
- {funcsort-0.2.0 → funcsort-2.0.0}/tests/test_sorter.py +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Bump Version By Labels
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [closed]
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
permissions: {}
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
bump-version:
|
|
12
|
+
# 41898282 is the github-actions[bot] user ID; unlike the actor login it cannot be spoofed.
|
|
13
|
+
if: github.event.pull_request.merged == true && github.event.sender.id != 41898282
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
timeout-minutes: 10
|
|
16
|
+
permissions:
|
|
17
|
+
contents: write
|
|
18
|
+
issues: write # bump-by-label creates the Major/Minor/Patch labels when missing
|
|
19
|
+
pull-requests: write
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
# skylos: ignore[SKY-D293] bump-by-label runs `git push origin`, which uses the persisted credentials
|
|
23
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
24
|
+
with:
|
|
25
|
+
fetch-depth: 0
|
|
26
|
+
|
|
27
|
+
- name: Set up Python
|
|
28
|
+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
29
|
+
with:
|
|
30
|
+
python-version: "3.*"
|
|
31
|
+
|
|
32
|
+
- name: Install uv
|
|
33
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
34
|
+
with:
|
|
35
|
+
version: "latest"
|
|
36
|
+
|
|
37
|
+
- name: Bump by labels
|
|
38
|
+
uses: HEROgold/bump-by-label@d657045d32bd21631a0830b73abd5207b8acd85a # v2
|
|
39
|
+
with:
|
|
40
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
41
|
+
command: "uv version --bump"
|
|
42
|
+
validate: "uv version"
|
|
@@ -3,25 +3,30 @@ name: CI
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
branches: [main]
|
|
6
|
-
tags:
|
|
7
|
-
- "v*"
|
|
8
6
|
pull_request:
|
|
9
7
|
branches: [main]
|
|
10
8
|
|
|
9
|
+
permissions: {}
|
|
10
|
+
|
|
11
11
|
jobs:
|
|
12
12
|
lint:
|
|
13
13
|
name: Lint
|
|
14
14
|
runs-on: ubuntu-latest
|
|
15
|
+
timeout-minutes: 15
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
15
18
|
steps:
|
|
16
|
-
- uses: actions/checkout@v4
|
|
19
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
20
|
+
with:
|
|
21
|
+
persist-credentials: false
|
|
17
22
|
|
|
18
23
|
- name: Install uv
|
|
19
|
-
uses: astral-sh/setup-uv@
|
|
24
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
20
25
|
with:
|
|
21
26
|
enable-cache: true
|
|
22
27
|
|
|
23
28
|
- name: Set up Python
|
|
24
|
-
uses: actions/setup-python@v5
|
|
29
|
+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
25
30
|
with:
|
|
26
31
|
python-version: "3.13"
|
|
27
32
|
|
|
@@ -37,19 +42,24 @@ jobs:
|
|
|
37
42
|
test:
|
|
38
43
|
name: Test
|
|
39
44
|
runs-on: ubuntu-latest
|
|
45
|
+
timeout-minutes: 15
|
|
46
|
+
permissions:
|
|
47
|
+
contents: read
|
|
40
48
|
strategy:
|
|
41
49
|
matrix:
|
|
42
50
|
python-version: ["3.12", "3.13"]
|
|
43
51
|
steps:
|
|
44
|
-
- uses: actions/checkout@v4
|
|
52
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
53
|
+
with:
|
|
54
|
+
persist-credentials: false
|
|
45
55
|
|
|
46
56
|
- name: Install uv
|
|
47
|
-
uses: astral-sh/setup-uv@
|
|
57
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
48
58
|
with:
|
|
49
59
|
enable-cache: true
|
|
50
60
|
|
|
51
61
|
- name: Set up Python ${{ matrix.python-version }}
|
|
52
|
-
uses: actions/setup-python@v5
|
|
62
|
+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
53
63
|
with:
|
|
54
64
|
python-version: ${{ matrix.python-version }}
|
|
55
65
|
|
|
@@ -58,29 +68,3 @@ jobs:
|
|
|
58
68
|
|
|
59
69
|
- name: Run tests
|
|
60
70
|
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 }}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
name: Coverage
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
+
# skylos: ignore[SKY-D290] the job only runs for push runs of this repository's main branch
|
|
4
5
|
workflow_run:
|
|
5
6
|
workflows: ["Test"]
|
|
6
7
|
branches: [main]
|
|
@@ -13,12 +14,15 @@ permissions:
|
|
|
13
14
|
jobs:
|
|
14
15
|
coveralls-upload:
|
|
15
16
|
runs-on: ubuntu-latest
|
|
16
|
-
|
|
17
|
+
timeout-minutes: 15
|
|
18
|
+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_repository.full_name == github.repository }}
|
|
17
19
|
steps:
|
|
18
|
-
- uses: actions/checkout@v4
|
|
20
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
21
|
+
with:
|
|
22
|
+
persist-credentials: false
|
|
19
23
|
|
|
20
24
|
- name: Install uv
|
|
21
|
-
uses: astral-sh/setup-uv@v7
|
|
25
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
22
26
|
with:
|
|
23
27
|
enable-cache: true
|
|
24
28
|
|
|
@@ -34,6 +38,7 @@ jobs:
|
|
|
34
38
|
- name: Upload coverage data to coveralls.io
|
|
35
39
|
env:
|
|
36
40
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
41
|
+
# skylos: ignore[SKY-D299] upload-only Coveralls token; the job never runs untrusted code
|
|
37
42
|
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
|
38
43
|
COVERALLS_SERVICE_NAME: github-actions
|
|
39
44
|
COVERALLS_PARALLEL: true
|
|
@@ -42,5 +47,6 @@ jobs:
|
|
|
42
47
|
- name: Coveralls Finished
|
|
43
48
|
env:
|
|
44
49
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
50
|
+
# skylos: ignore[SKY-D299] upload-only Coveralls token; the job never runs untrusted code
|
|
45
51
|
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
|
46
52
|
run: uvx coveralls --finish
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
types: [ opened, reopened, synchronize, closed ]
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
# All deployments push to the shared gh-pages branch, so serialise them to avoid push races.
|
|
15
|
+
# Do NOT cancel in-progress runs as we want to allow deployments to complete.
|
|
16
|
+
concurrency:
|
|
17
|
+
group: pages
|
|
18
|
+
cancel-in-progress: false
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
build-docs:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
timeout-minutes: 15
|
|
24
|
+
permissions:
|
|
25
|
+
contents: write # the site and PR previews are pushed to the gh-pages branch
|
|
26
|
+
pull-requests: write # pr-preview-action comments the preview link on the PR
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
29
|
+
with:
|
|
30
|
+
persist-credentials: false
|
|
31
|
+
|
|
32
|
+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
33
|
+
if: github.event.action != 'closed'
|
|
34
|
+
with:
|
|
35
|
+
python-version: '3.12'
|
|
36
|
+
|
|
37
|
+
- name: Install uv
|
|
38
|
+
if: github.event.action != 'closed'
|
|
39
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
40
|
+
with:
|
|
41
|
+
enable-cache: true
|
|
42
|
+
|
|
43
|
+
- name: Build docs (zensical)
|
|
44
|
+
if: github.event.action != 'closed'
|
|
45
|
+
run: |
|
|
46
|
+
uv sync --group docs
|
|
47
|
+
uv run zensical build
|
|
48
|
+
|
|
49
|
+
# Publish the site to the root of gh-pages on pushes to main, keeping PR previews intact.
|
|
50
|
+
# Gate on the event too: `closed` pull_request events report the base branch as github.ref.
|
|
51
|
+
- name: Deploy to GitHub Pages
|
|
52
|
+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
|
|
53
|
+
uses: JamesIves/github-pages-deploy-action@fa24774553152dd7873cd16ebd8d959b010c5445 # v4.9.0
|
|
54
|
+
with:
|
|
55
|
+
folder: site
|
|
56
|
+
branch: gh-pages
|
|
57
|
+
clean-exclude: pr-previews/
|
|
58
|
+
force: false
|
|
59
|
+
|
|
60
|
+
# Deploy the PR preview on open/sync/reopen; remove it when the PR is closed.
|
|
61
|
+
# pr-preview-action defaults to `action: auto`, which detects the `closed`
|
|
62
|
+
# event and deletes the preview directory from gh-pages.
|
|
63
|
+
- name: Deploy PR Preview
|
|
64
|
+
if: github.event_name == 'pull_request'
|
|
65
|
+
uses: rossjrw/pr-preview-action@ffa7509e91a3ec8dfc2e5536c4d5c1acdf7a6de9 # v1
|
|
66
|
+
with:
|
|
67
|
+
source-dir: site
|
|
68
|
+
preview-branch: gh-pages
|
|
69
|
+
umbrella-dir: pr-previews
|
|
@@ -18,11 +18,12 @@ jobs:
|
|
|
18
18
|
runs-on: ubuntu-latest
|
|
19
19
|
steps:
|
|
20
20
|
- name: Checkout code
|
|
21
|
-
uses: actions/checkout@v4
|
|
21
|
+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
22
22
|
with:
|
|
23
|
+
persist-credentials: false
|
|
23
24
|
fetch-depth: 0
|
|
24
25
|
|
|
25
26
|
- name: Run Gitleaks
|
|
26
|
-
uses: gitleaks/gitleaks-action@v2
|
|
27
|
+
uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2.3.9
|
|
27
28
|
env:
|
|
28
29
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -20,10 +20,12 @@ jobs:
|
|
|
20
20
|
runs-on: ubuntu-latest
|
|
21
21
|
steps:
|
|
22
22
|
- name: Checkout code
|
|
23
|
-
uses: actions/checkout@v4
|
|
23
|
+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
24
|
+
with:
|
|
25
|
+
persist-credentials: false
|
|
24
26
|
|
|
25
27
|
- name: Install uv
|
|
26
|
-
uses: astral-sh/setup-uv@
|
|
28
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
27
29
|
with:
|
|
28
30
|
enable-cache: true
|
|
29
31
|
|
|
@@ -51,15 +53,17 @@ jobs:
|
|
|
51
53
|
args: "."
|
|
52
54
|
steps:
|
|
53
55
|
- name: Checkout code
|
|
54
|
-
uses: actions/checkout@v4
|
|
56
|
+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
57
|
+
with:
|
|
58
|
+
persist-credentials: false
|
|
55
59
|
|
|
56
60
|
- name: Install uv (Should be cached from setup job)
|
|
57
|
-
uses: astral-sh/setup-uv@
|
|
61
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
58
62
|
with:
|
|
59
63
|
enable-cache: true
|
|
60
64
|
|
|
61
65
|
- name: Cache lint results
|
|
62
|
-
uses: actions/cache@v4
|
|
66
|
+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
|
63
67
|
with:
|
|
64
68
|
path: .lint_cache
|
|
65
69
|
key: ${{ runner.os }}-lint-${{matrix.tool}}-${{ hashFiles('**/tests/**/*.py', 'src/**') }}
|
|
@@ -12,6 +12,7 @@ jobs:
|
|
|
12
12
|
publish-to-pypi:
|
|
13
13
|
name: Publish Python 🐍 distribution 📦 to PyPI
|
|
14
14
|
runs-on: ubuntu-latest
|
|
15
|
+
timeout-minutes: 10
|
|
15
16
|
environment:
|
|
16
17
|
name: pypi
|
|
17
18
|
url: https://pypi.org/p/funcsort
|
|
@@ -21,14 +22,15 @@ jobs:
|
|
|
21
22
|
|
|
22
23
|
steps:
|
|
23
24
|
- name: Checkout
|
|
24
|
-
uses: actions/checkout@v4
|
|
25
|
+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
25
26
|
with:
|
|
26
27
|
persist-credentials: false
|
|
27
28
|
|
|
29
|
+
# No dependency cache: the published artifacts must not depend on restored CI state.
|
|
28
30
|
- name: Install uv
|
|
29
|
-
uses: astral-sh/setup-uv@v7
|
|
31
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
30
32
|
with:
|
|
31
|
-
enable-cache:
|
|
33
|
+
enable-cache: false
|
|
32
34
|
|
|
33
35
|
- name: Set up Python
|
|
34
36
|
run: uv python install 3.14
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
name: Auto-release
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
+
# skylos: ignore[SKY-D290] jobs only act on push runs of this repository's main branch
|
|
4
5
|
workflow_run:
|
|
5
6
|
workflows: ["Test"]
|
|
6
7
|
branches: [main]
|
|
@@ -8,27 +9,32 @@ on:
|
|
|
8
9
|
- completed
|
|
9
10
|
workflow_dispatch:
|
|
10
11
|
|
|
12
|
+
permissions: {}
|
|
13
|
+
|
|
11
14
|
jobs:
|
|
12
15
|
new-release:
|
|
13
16
|
runs-on: ubuntu-latest
|
|
17
|
+
timeout-minutes: 10
|
|
14
18
|
permissions:
|
|
15
19
|
contents: write
|
|
16
|
-
|
|
20
|
+
# Only release from Test runs triggered by a push to this repository, never from a fork PR head named `main`.
|
|
21
|
+
if: ${{ (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_repository.full_name == github.repository) || github.event_name == 'workflow_dispatch' }}
|
|
17
22
|
outputs:
|
|
18
23
|
version_changed: ${{ steps.version-check.outputs.version_changed }}
|
|
19
24
|
|
|
20
25
|
steps:
|
|
21
|
-
- uses: actions/checkout@v4
|
|
26
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
22
27
|
with:
|
|
23
28
|
fetch-depth: 0 # Needed to get all tags for version comparison
|
|
29
|
+
persist-credentials: false
|
|
24
30
|
|
|
25
31
|
- name: Set up Python
|
|
26
|
-
uses: actions/setup-python@v5
|
|
32
|
+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
27
33
|
with:
|
|
28
34
|
python-version: "3.*"
|
|
29
35
|
|
|
30
36
|
- name: Install uv
|
|
31
|
-
uses: astral-sh/setup-uv@
|
|
37
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
32
38
|
with:
|
|
33
39
|
version: "latest"
|
|
34
40
|
|
|
@@ -50,7 +56,7 @@ jobs:
|
|
|
50
56
|
|
|
51
57
|
- name: Create GitHub Release
|
|
52
58
|
if: steps.version-check.outputs.version_changed == 'true'
|
|
53
|
-
uses: softprops/action-gh-release@v2
|
|
59
|
+
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.6.2
|
|
54
60
|
with:
|
|
55
61
|
tag_name: v${{ steps.version-check.outputs.current_version }}
|
|
56
62
|
name: Release v${{ steps.version-check.outputs.current_version }}
|
|
@@ -63,7 +69,7 @@ jobs:
|
|
|
63
69
|
# because another workflow (this one) created the release. (avoiding inf recursion)
|
|
64
70
|
- name: Trigger PyPI workflow
|
|
65
71
|
if: steps.version-check.outputs.version_changed == 'true'
|
|
66
|
-
uses: peter-evans/repository-dispatch@v2
|
|
72
|
+
uses: peter-evans/repository-dispatch@bf47d102fdb849e755b0b0023ea3e81a44b6f570 # v2.1.2
|
|
67
73
|
with:
|
|
68
74
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
69
75
|
event-type: new-release-created
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: Skylos Analysis
|
|
2
|
+
|
|
3
|
+
"on":
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [main]
|
|
6
|
+
push:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
skylos:
|
|
14
|
+
name: Skylos Quality Gate
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
timeout-minutes: 15
|
|
17
|
+
|
|
18
|
+
permissions:
|
|
19
|
+
contents: read
|
|
20
|
+
pull-requests: write
|
|
21
|
+
id-token: write
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout
|
|
24
|
+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
25
|
+
with:
|
|
26
|
+
fetch-depth: 0
|
|
27
|
+
persist-credentials: false
|
|
28
|
+
|
|
29
|
+
- name: Setup Python
|
|
30
|
+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
31
|
+
with:
|
|
32
|
+
python-version: '3.12'
|
|
33
|
+
|
|
34
|
+
- name: Install Skylos
|
|
35
|
+
run: python -m pip install skylos==4.30.0
|
|
36
|
+
|
|
37
|
+
- name: Pull Skylos Cloud Policy
|
|
38
|
+
run: |
|
|
39
|
+
skylos sync pull || echo "No Skylos Cloud policy available through GitHub OIDC; continuing with local config."
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
- name: Run Skylos Analysis
|
|
43
|
+
run: |
|
|
44
|
+
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
|
45
|
+
pr_base_ref="origin/${GITHUB_BASE_REF:-main}"
|
|
46
|
+
skylos . --danger --quality --ai-defects --secrets --sca --baseline --diff-base "$pr_base_ref" --diff "$pr_base_ref" --json -o skylos-results.json
|
|
47
|
+
else
|
|
48
|
+
skylos . --danger --quality --ai-defects --secrets --sca --baseline --json -o skylos-results.json
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
- name: Quality Gate
|
|
52
|
+
if: always()
|
|
53
|
+
run: skylos cicd gate --input skylos-results.json --summary
|
|
54
|
+
|
|
55
|
+
- name: GitHub Annotations
|
|
56
|
+
if: always()
|
|
57
|
+
run: skylos cicd annotate --input skylos-results.json
|
|
58
|
+
|
|
59
|
+
- name: PR Review Comments
|
|
60
|
+
if: github.event_name == 'pull_request' && always()
|
|
61
|
+
run: |
|
|
62
|
+
pr_base_ref="origin/${GITHUB_BASE_REF:-main}"
|
|
63
|
+
skylos cicd review --input skylos-results.json --diff-base "$pr_base_ref" --evidence-cards
|
|
64
|
+
env:
|
|
65
|
+
GH_TOKEN: ${{ github.token }}
|
|
@@ -22,18 +22,20 @@ jobs:
|
|
|
22
22
|
fail-fast: false
|
|
23
23
|
|
|
24
24
|
steps:
|
|
25
|
-
- uses: actions/checkout@v4
|
|
25
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
26
|
+
with:
|
|
27
|
+
persist-credentials: false
|
|
26
28
|
|
|
27
29
|
- name: Cache pytest results
|
|
28
30
|
id: cache-pytest
|
|
29
|
-
uses: actions/cache@v4
|
|
31
|
+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
|
30
32
|
with:
|
|
31
33
|
path: .pytest_cache
|
|
32
34
|
key: ${{ runner.os }}-pytest-${{ matrix.python-version }}-${{ hashFiles('**/tests/**/*.py', 'src/**') }}
|
|
33
35
|
|
|
34
36
|
- name: Install uv
|
|
35
37
|
if: steps.cache-pytest.outputs.cache-hit != 'true'
|
|
36
|
-
uses: astral-sh/setup-uv@v7
|
|
38
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
37
39
|
with:
|
|
38
40
|
enable-cache: true
|
|
39
41
|
|
|
@@ -135,7 +135,7 @@ venv.bak/
|
|
|
135
135
|
# Rope project settings
|
|
136
136
|
.ropeproject
|
|
137
137
|
|
|
138
|
-
#
|
|
138
|
+
# zensical documentation
|
|
139
139
|
/site
|
|
140
140
|
|
|
141
141
|
# mypy
|
|
@@ -172,3 +172,6 @@ cython_debug/
|
|
|
172
172
|
|
|
173
173
|
# Ruff cache
|
|
174
174
|
.ruff_cache/
|
|
175
|
+
|
|
176
|
+
# Skylos analysis cache
|
|
177
|
+
.skylos/
|
|
@@ -34,6 +34,13 @@ repos:
|
|
|
34
34
|
language: system
|
|
35
35
|
stages: [pre-commit]
|
|
36
36
|
types: [python]
|
|
37
|
+
- id: no-reflow
|
|
38
|
+
name: reject reflow-only hunks
|
|
39
|
+
entry: uv run python scripts/check_reflow.py
|
|
40
|
+
language: system
|
|
41
|
+
stages: [pre-commit]
|
|
42
|
+
always_run: true
|
|
43
|
+
pass_filenames: false
|
|
37
44
|
- id: uv-sync
|
|
38
45
|
name: uv sync
|
|
39
46
|
entry: uv sync
|