django-snapshots 0.0.0a0__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.
- django_snapshots-0.0.0a0/.codecov.yml +3 -0
- django_snapshots-0.0.0a0/.gitattributes +74 -0
- django_snapshots-0.0.0a0/.github/CODEOWNERS +1 -0
- django_snapshots-0.0.0a0/.github/dependabot.yml +26 -0
- django_snapshots-0.0.0a0/.github/workflows/bandit.yml +58 -0
- django_snapshots-0.0.0a0/.github/workflows/lint.yml +85 -0
- django_snapshots-0.0.0a0/.github/workflows/release.yml +172 -0
- django_snapshots-0.0.0a0/.github/workflows/scorecard.yml +55 -0
- django_snapshots-0.0.0a0/.github/workflows/test.yml +740 -0
- django_snapshots-0.0.0a0/.github/workflows/update_coc.yml +52 -0
- django_snapshots-0.0.0a0/.github/workflows/zizmor.yml +62 -0
- django_snapshots-0.0.0a0/.gitignore +210 -0
- django_snapshots-0.0.0a0/.pre-commit-config.yaml +26 -0
- django_snapshots-0.0.0a0/.readthedocs.yaml +16 -0
- django_snapshots-0.0.0a0/AGENTS.md +90 -0
- django_snapshots-0.0.0a0/CLAUDE.md +5 -0
- django_snapshots-0.0.0a0/CODE_OF_CONDUCT.md +124 -0
- django_snapshots-0.0.0a0/CONTRIBUTING.md +163 -0
- django_snapshots-0.0.0a0/LICENSE +22 -0
- django_snapshots-0.0.0a0/PKG-INFO +71 -0
- django_snapshots-0.0.0a0/README.md +31 -0
- django_snapshots-0.0.0a0/SECURITY.md +14 -0
- django_snapshots-0.0.0a0/doc/source/_static/style.css +39 -0
- django_snapshots-0.0.0a0/doc/source/changelog.rst +9 -0
- django_snapshots-0.0.0a0/doc/source/conf.py +48 -0
- django_snapshots-0.0.0a0/doc/source/explanation/architecture.rst +63 -0
- django_snapshots-0.0.0a0/doc/source/explanation/index.rst +15 -0
- django_snapshots-0.0.0a0/doc/source/explanation/storage-protocols.rst +77 -0
- django_snapshots-0.0.0a0/doc/source/how-to/configure-storage.rst +103 -0
- django_snapshots-0.0.0a0/doc/source/how-to/custom-connector.rst +144 -0
- django_snapshots-0.0.0a0/doc/source/how-to/index.rst +16 -0
- django_snapshots-0.0.0a0/doc/source/index.rst +85 -0
- django_snapshots-0.0.0a0/doc/source/reference/commands/export.rst +13 -0
- django_snapshots-0.0.0a0/doc/source/reference/commands/import.rst +13 -0
- django_snapshots-0.0.0a0/doc/source/reference/commands/index.rst +22 -0
- django_snapshots-0.0.0a0/doc/source/reference/connectors.rst +113 -0
- django_snapshots-0.0.0a0/doc/source/reference/dataclasses.rst +66 -0
- django_snapshots-0.0.0a0/doc/source/reference/exceptions.rst +46 -0
- django_snapshots-0.0.0a0/doc/source/reference/index.rst +21 -0
- django_snapshots-0.0.0a0/doc/source/reference/protocols.rst +39 -0
- django_snapshots-0.0.0a0/doc/source/reference/settings.rst +55 -0
- django_snapshots-0.0.0a0/doc/source/reference/storage.rst +88 -0
- django_snapshots-0.0.0a0/doc/source/refs.rst +4 -0
- django_snapshots-0.0.0a0/doc/source/tutorials/getting-started.rst +84 -0
- django_snapshots-0.0.0a0/doc/source/tutorials/index.rst +15 -0
- django_snapshots-0.0.0a0/doc/superpowers/plans/2026-03-15-plan-3-import-system.md +1399 -0
- django_snapshots-0.0.0a0/doc/superpowers/plans/2026-03-15-plan-5-cli-docs.md +319 -0
- django_snapshots-0.0.0a0/doc/superpowers/specs/2026-03-13-django-snapshots-design.md +558 -0
- django_snapshots-0.0.0a0/doc/superpowers/specs/2026-03-14-plan-3-import-system-design.md +268 -0
- django_snapshots-0.0.0a0/doc/superpowers/specs/2026-03-15-cli-docs-design.md +163 -0
- django_snapshots-0.0.0a0/justfile +263 -0
- django_snapshots-0.0.0a0/pyproject.toml +211 -0
- django_snapshots-0.0.0a0/src/django_snapshots/__init__.py +117 -0
- django_snapshots-0.0.0a0/src/django_snapshots/_pip.py +33 -0
- django_snapshots-0.0.0a0/src/django_snapshots/admin.py +1 -0
- django_snapshots-0.0.0a0/src/django_snapshots/apps.py +21 -0
- django_snapshots-0.0.0a0/src/django_snapshots/artifacts/__init__.py +21 -0
- django_snapshots-0.0.0a0/src/django_snapshots/artifacts/protocols.py +70 -0
- django_snapshots-0.0.0a0/src/django_snapshots/connectors/__init__.py +19 -0
- django_snapshots-0.0.0a0/src/django_snapshots/connectors/auto.py +56 -0
- django_snapshots-0.0.0a0/src/django_snapshots/connectors/dumpdata.py +56 -0
- django_snapshots-0.0.0a0/src/django_snapshots/connectors/mysql.py +70 -0
- django_snapshots-0.0.0a0/src/django_snapshots/connectors/postgres.py +75 -0
- django_snapshots-0.0.0a0/src/django_snapshots/connectors/protocols.py +18 -0
- django_snapshots-0.0.0a0/src/django_snapshots/connectors/sqlite.py +75 -0
- django_snapshots-0.0.0a0/src/django_snapshots/exceptions.py +44 -0
- django_snapshots-0.0.0a0/src/django_snapshots/export/admin.py +1 -0
- django_snapshots-0.0.0a0/src/django_snapshots/export/apps.py +13 -0
- django_snapshots-0.0.0a0/src/django_snapshots/export/artifacts/__init__.py +9 -0
- django_snapshots-0.0.0a0/src/django_snapshots/export/artifacts/database.py +57 -0
- django_snapshots-0.0.0a0/src/django_snapshots/export/artifacts/environment.py +46 -0
- django_snapshots-0.0.0a0/src/django_snapshots/export/artifacts/media.py +48 -0
- django_snapshots-0.0.0a0/src/django_snapshots/export/management/__init__.py +0 -0
- django_snapshots-0.0.0a0/src/django_snapshots/export/management/plugins/__init__.py +0 -0
- django_snapshots-0.0.0a0/src/django_snapshots/export/management/plugins/snapshots.py +364 -0
- django_snapshots-0.0.0a0/src/django_snapshots/import/admin.py +1 -0
- django_snapshots-0.0.0a0/src/django_snapshots/import/apps.py +13 -0
- django_snapshots-0.0.0a0/src/django_snapshots/import/artifacts/__init__.py +11 -0
- django_snapshots-0.0.0a0/src/django_snapshots/import/artifacts/database.py +46 -0
- django_snapshots-0.0.0a0/src/django_snapshots/import/artifacts/environment.py +50 -0
- django_snapshots-0.0.0a0/src/django_snapshots/import/artifacts/media.py +81 -0
- django_snapshots-0.0.0a0/src/django_snapshots/import/management/__init__.py +0 -0
- django_snapshots-0.0.0a0/src/django_snapshots/import/management/plugins/__init__.py +0 -0
- django_snapshots-0.0.0a0/src/django_snapshots/import/management/plugins/snapshots.py +373 -0
- django_snapshots-0.0.0a0/src/django_snapshots/management/__init__.py +0 -0
- django_snapshots-0.0.0a0/src/django_snapshots/management/commands/__init__.py +0 -0
- django_snapshots-0.0.0a0/src/django_snapshots/management/commands/snapshots.py +302 -0
- django_snapshots-0.0.0a0/src/django_snapshots/management/utils.py +116 -0
- django_snapshots-0.0.0a0/src/django_snapshots/manifest.py +145 -0
- django_snapshots-0.0.0a0/src/django_snapshots/py.typed +0 -0
- django_snapshots-0.0.0a0/src/django_snapshots/settings.py +115 -0
- django_snapshots-0.0.0a0/src/django_snapshots/storage/__init__.py +15 -0
- django_snapshots-0.0.0a0/src/django_snapshots/storage/django_storage.py +77 -0
- django_snapshots-0.0.0a0/src/django_snapshots/storage/local.py +106 -0
- django_snapshots-0.0.0a0/src/django_snapshots/storage/protocols.py +63 -0
- django_snapshots-0.0.0a0/tests/__init__.py +0 -0
- django_snapshots-0.0.0a0/tests/conftest.py +169 -0
- django_snapshots-0.0.0a0/tests/connectors/__init__.py +0 -0
- django_snapshots-0.0.0a0/tests/connectors/test_auto.py +71 -0
- django_snapshots-0.0.0a0/tests/connectors/test_dumpdata.py +46 -0
- django_snapshots-0.0.0a0/tests/connectors/test_mysql.py +38 -0
- django_snapshots-0.0.0a0/tests/connectors/test_postgres.py +40 -0
- django_snapshots-0.0.0a0/tests/connectors/test_sqlite.py +39 -0
- django_snapshots-0.0.0a0/tests/export/__init__.py +0 -0
- django_snapshots-0.0.0a0/tests/export/test_export_command.py +232 -0
- django_snapshots-0.0.0a0/tests/export/test_exporters.py +186 -0
- django_snapshots-0.0.0a0/tests/settings.py +130 -0
- django_snapshots-0.0.0a0/tests/storage/__init__.py +0 -0
- django_snapshots-0.0.0a0/tests/storage/test_django_storage.py +63 -0
- django_snapshots-0.0.0a0/tests/storage/test_local.py +100 -0
- django_snapshots-0.0.0a0/tests/storage/test_protocols.py +64 -0
- django_snapshots-0.0.0a0/tests/test.py +65 -0
- django_snapshots-0.0.0a0/tests/test_behaviors.py +521 -0
- django_snapshots-0.0.0a0/tests/test_core_commands.py +677 -0
- django_snapshots-0.0.0a0/tests/test_exceptions.py +49 -0
- django_snapshots-0.0.0a0/tests/test_import/__init__.py +0 -0
- django_snapshots-0.0.0a0/tests/test_import/test_import_command.py +273 -0
- django_snapshots-0.0.0a0/tests/test_import/test_importers.py +267 -0
- django_snapshots-0.0.0a0/tests/test_manifest.py +125 -0
- django_snapshots-0.0.0a0/tests/test_settings.py +108 -0
- django_snapshots-0.0.0a0/tests/urls.py +7 -0
- django_snapshots-0.0.0a0/uv.lock +3229 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Set the default behavior, in case people don't have core.autocrlf set.
|
|
2
|
+
* text=auto
|
|
3
|
+
|
|
4
|
+
# Source files
|
|
5
|
+
*.pxd text diff=python
|
|
6
|
+
*.py text diff=python
|
|
7
|
+
*.py3 text diff=python
|
|
8
|
+
*.pyw text diff=python
|
|
9
|
+
*.pyx text diff=python
|
|
10
|
+
*.pyz text diff=python
|
|
11
|
+
*.pyi text diff=python
|
|
12
|
+
*.rst text
|
|
13
|
+
*.md text diff=markdown
|
|
14
|
+
justfile text
|
|
15
|
+
*.toml text
|
|
16
|
+
LICENSE text
|
|
17
|
+
*.yaml text
|
|
18
|
+
*.yml text
|
|
19
|
+
*.po text
|
|
20
|
+
*.tmpl text
|
|
21
|
+
*.json text
|
|
22
|
+
*.xml text
|
|
23
|
+
|
|
24
|
+
# powershell
|
|
25
|
+
*.ps1 text eol=crlf
|
|
26
|
+
*.ps1x text eol=crlf
|
|
27
|
+
*.psm1 text eol=crlf
|
|
28
|
+
*.psd1 text eol=crlf
|
|
29
|
+
*.ps1xml text eol=crlf
|
|
30
|
+
*.pssc text eol=crlf
|
|
31
|
+
*.psrc text eol=crlf
|
|
32
|
+
*.cdxml text eol=crlf
|
|
33
|
+
|
|
34
|
+
# Scripts
|
|
35
|
+
*.bash text eol=lf
|
|
36
|
+
*.fish text eol=lf
|
|
37
|
+
*.ksh text eol=lf
|
|
38
|
+
*.sh text eol=lf
|
|
39
|
+
*.zsh text eol=lf
|
|
40
|
+
*.bat text eol=crlf
|
|
41
|
+
*.cmd text eol=crlf
|
|
42
|
+
|
|
43
|
+
# Archives
|
|
44
|
+
*.7z binary
|
|
45
|
+
*.bz2 binary
|
|
46
|
+
*.gz binary
|
|
47
|
+
*.rar binary
|
|
48
|
+
*.tar binary
|
|
49
|
+
*.tgz binary
|
|
50
|
+
*.zip binary
|
|
51
|
+
*.zst binary
|
|
52
|
+
|
|
53
|
+
# Binary files
|
|
54
|
+
*.db binary
|
|
55
|
+
*.pyc binary export-ignore
|
|
56
|
+
*.pyo binary export-ignore
|
|
57
|
+
*.pyd binary
|
|
58
|
+
*.png binary
|
|
59
|
+
*.jpg binary
|
|
60
|
+
*.pdf binary
|
|
61
|
+
*.svg binary
|
|
62
|
+
*.gif binary
|
|
63
|
+
*.mo binary
|
|
64
|
+
|
|
65
|
+
# Documents
|
|
66
|
+
*.bibtex text diff=bibtex
|
|
67
|
+
*.tex text diff=tex
|
|
68
|
+
*.csv text eol=crlf
|
|
69
|
+
*.txt text
|
|
70
|
+
*.sql text
|
|
71
|
+
*.patch -text
|
|
72
|
+
|
|
73
|
+
.gitattributes export-ignore
|
|
74
|
+
.gitignore export-ignore
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* @bckohan
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
# GitHub Actions
|
|
4
|
+
- package-ecosystem: "github-actions"
|
|
5
|
+
directory: "/"
|
|
6
|
+
schedule:
|
|
7
|
+
interval: "monthly"
|
|
8
|
+
groups:
|
|
9
|
+
gha-updates:
|
|
10
|
+
patterns:
|
|
11
|
+
- "*"
|
|
12
|
+
|
|
13
|
+
# Python dependencies managed via uv (pyproject.toml)
|
|
14
|
+
- package-ecosystem: "uv"
|
|
15
|
+
directory: "/"
|
|
16
|
+
schedule:
|
|
17
|
+
interval: "monthly"
|
|
18
|
+
groups:
|
|
19
|
+
uv-runtime:
|
|
20
|
+
dependency-type: "production"
|
|
21
|
+
patterns:
|
|
22
|
+
- "*"
|
|
23
|
+
uv-dev:
|
|
24
|
+
dependency-type: "development"
|
|
25
|
+
patterns:
|
|
26
|
+
- "*"
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
name: Bandit
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
paths:
|
|
8
|
+
- "src/**"
|
|
9
|
+
- "pyproject.toml"
|
|
10
|
+
- "justfile"
|
|
11
|
+
- ".github/workflows/bandit.yml"
|
|
12
|
+
workflow_dispatch:
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
bandit-analysis:
|
|
19
|
+
name: Run Bandit
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
permissions:
|
|
22
|
+
contents: read
|
|
23
|
+
security-events: write
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
27
|
+
with:
|
|
28
|
+
persist-credentials: false
|
|
29
|
+
- name: Set up Python
|
|
30
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
|
|
31
|
+
id: sp
|
|
32
|
+
with:
|
|
33
|
+
python-version: '3.x'
|
|
34
|
+
allow-prereleases: true
|
|
35
|
+
- name: Install uv
|
|
36
|
+
uses: astral-sh/setup-uv@6ee6290f1cbc4156c0bdd66691b2c144ef8df19a
|
|
37
|
+
with:
|
|
38
|
+
enable-cache: false
|
|
39
|
+
- name: Install Just
|
|
40
|
+
uses: extractions/setup-just@f8a3cce218d9f83db3a2ecd90e41ac3de6cdfd9b
|
|
41
|
+
|
|
42
|
+
- name: Run Bandit
|
|
43
|
+
run: |
|
|
44
|
+
just bandit
|
|
45
|
+
|
|
46
|
+
- name: Upload analysis results
|
|
47
|
+
if: ${{ always() }}
|
|
48
|
+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
|
|
49
|
+
with:
|
|
50
|
+
name: bandit-results
|
|
51
|
+
path: bandit.sarif
|
|
52
|
+
retention-days: 7
|
|
53
|
+
|
|
54
|
+
- name: Upload to code-scanning
|
|
55
|
+
if: ${{ always() }}
|
|
56
|
+
uses: github/codeql-action/upload-sarif@0d579ffd059c29b07949a3cce3983f0780820c98
|
|
57
|
+
with:
|
|
58
|
+
sarif_file: bandit.sarif
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
name: Lint
|
|
2
|
+
|
|
3
|
+
permissions:
|
|
4
|
+
contents: read
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
tags-ignore:
|
|
9
|
+
- '*'
|
|
10
|
+
branches: ['main']
|
|
11
|
+
pull_request:
|
|
12
|
+
branches: ['main']
|
|
13
|
+
workflow_call:
|
|
14
|
+
workflow_dispatch:
|
|
15
|
+
inputs:
|
|
16
|
+
debug:
|
|
17
|
+
description: 'Open ssh debug session.'
|
|
18
|
+
required: true
|
|
19
|
+
default: false
|
|
20
|
+
type: boolean
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
|
|
24
|
+
lint:
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
permissions:
|
|
27
|
+
contents: read
|
|
28
|
+
strategy:
|
|
29
|
+
fail-fast: false
|
|
30
|
+
matrix:
|
|
31
|
+
# run static analysis on bleeding and trailing edges
|
|
32
|
+
python-version: ['3.10', '3.12', '3.14']
|
|
33
|
+
django-version:
|
|
34
|
+
- 'dj42' # LTS April 2026
|
|
35
|
+
- 'dj52' # LTS April 2028
|
|
36
|
+
- 'dj60' # April 2027
|
|
37
|
+
exclude:
|
|
38
|
+
- python-version: '3.12'
|
|
39
|
+
django-version: 'dj42'
|
|
40
|
+
- python-version: '3.14'
|
|
41
|
+
django-version: 'dj42'
|
|
42
|
+
|
|
43
|
+
- python-version: '3.10'
|
|
44
|
+
django-version: 'dj52'
|
|
45
|
+
- python-version: '3.14'
|
|
46
|
+
django-version: 'dj52'
|
|
47
|
+
|
|
48
|
+
- python-version: '3.10'
|
|
49
|
+
django-version: 'dj60'
|
|
50
|
+
- python-version: '3.12'
|
|
51
|
+
django-version: 'dj60'
|
|
52
|
+
|
|
53
|
+
env:
|
|
54
|
+
TEST_PYTHON_VERSION: ${{ matrix.python-version }}
|
|
55
|
+
TEST_DJANGO_VERSION: ${{ matrix.django-version }}
|
|
56
|
+
|
|
57
|
+
steps:
|
|
58
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
59
|
+
with:
|
|
60
|
+
persist-credentials: false
|
|
61
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
62
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
|
|
63
|
+
id: sp
|
|
64
|
+
with:
|
|
65
|
+
python-version: ${{ matrix.python-version }}
|
|
66
|
+
allow-prereleases: true
|
|
67
|
+
- name: Install uv
|
|
68
|
+
uses: astral-sh/setup-uv@6ee6290f1cbc4156c0bdd66691b2c144ef8df19a
|
|
69
|
+
with:
|
|
70
|
+
enable-cache: false
|
|
71
|
+
- name: Install Just
|
|
72
|
+
uses: extractions/setup-just@f8a3cce218d9f83db3a2ecd90e41ac3de6cdfd9b
|
|
73
|
+
- name: Install Emacs
|
|
74
|
+
if: ${{ github.event.inputs.debug == 'true' }}
|
|
75
|
+
run: sudo apt install emacs
|
|
76
|
+
- name: Setup tmate session
|
|
77
|
+
if: ${{ github.event.inputs.debug == 'true' }}
|
|
78
|
+
uses: mxschmitt/action-tmate@c0afd6f790e3a5564914980036ebf83216678101
|
|
79
|
+
timeout-minutes: 60
|
|
80
|
+
- name: Run Static Analysis
|
|
81
|
+
env:
|
|
82
|
+
PYTHON_PATH: ${{ steps.sp.outputs.python-path }}
|
|
83
|
+
run: |
|
|
84
|
+
just check -p "$PYTHON_PATH" --group "$TEST_DJANGO_VERSION"
|
|
85
|
+
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
name: Publish Release
|
|
2
|
+
|
|
3
|
+
permissions: read-all
|
|
4
|
+
|
|
5
|
+
concurrency:
|
|
6
|
+
# stop previous release runs if tag is recreated
|
|
7
|
+
group: release-${{ github.ref }}
|
|
8
|
+
cancel-in-progress: true
|
|
9
|
+
|
|
10
|
+
on:
|
|
11
|
+
push:
|
|
12
|
+
tags:
|
|
13
|
+
- 'v[0-9]*.[0-9]*.[0-9]*' # only publish on version tags (e.g. v1.0.0)
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
|
|
17
|
+
lint:
|
|
18
|
+
permissions:
|
|
19
|
+
contents: read
|
|
20
|
+
actions: write
|
|
21
|
+
uses: ./.github/workflows/lint.yml
|
|
22
|
+
|
|
23
|
+
test:
|
|
24
|
+
permissions:
|
|
25
|
+
contents: read
|
|
26
|
+
actions: write
|
|
27
|
+
uses: ./.github/workflows/test.yml
|
|
28
|
+
secrets:
|
|
29
|
+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
30
|
+
|
|
31
|
+
build:
|
|
32
|
+
name: Build Package
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
permissions:
|
|
35
|
+
contents: read
|
|
36
|
+
actions: write
|
|
37
|
+
outputs:
|
|
38
|
+
PACKAGE_NAME: ${{ steps.set-package.outputs.package_name }}
|
|
39
|
+
RELEASE_VERSION: ${{ steps.set-package.outputs.release_version }}
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
42
|
+
with:
|
|
43
|
+
persist-credentials: true
|
|
44
|
+
- name: Set up Python
|
|
45
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
|
|
46
|
+
id: sp
|
|
47
|
+
with:
|
|
48
|
+
python-version: "3.14"
|
|
49
|
+
- name: Install uv
|
|
50
|
+
uses: astral-sh/setup-uv@6ee6290f1cbc4156c0bdd66691b2c144ef8df19a
|
|
51
|
+
with:
|
|
52
|
+
enable-cache: false
|
|
53
|
+
restore-cache: false
|
|
54
|
+
save-cache: false
|
|
55
|
+
- name: Setup Just
|
|
56
|
+
uses: extractions/setup-just@f8a3cce218d9f83db3a2ecd90e41ac3de6cdfd9b
|
|
57
|
+
- name: Install Dependencies
|
|
58
|
+
env:
|
|
59
|
+
PYTHON_PATH: ${{ steps.sp.outputs.python-path }}
|
|
60
|
+
run: |
|
|
61
|
+
just setup "$PYTHON_PATH"
|
|
62
|
+
- name: Verify Tag
|
|
63
|
+
run: |
|
|
64
|
+
TAG_NAME=${GITHUB_REF#refs/tags/}
|
|
65
|
+
echo "Verifying tag $TAG_NAME..."
|
|
66
|
+
git fetch --force origin refs/tags/$TAG_NAME:refs/tags/$TAG_NAME
|
|
67
|
+
# verify signature
|
|
68
|
+
curl -sL "https://github.com/${GITHUB_ACTOR}.gpg" | gpg --import
|
|
69
|
+
git tag -v "$TAG_NAME"
|
|
70
|
+
# verify version
|
|
71
|
+
RELEASE_VERSION=$(just validate_version $TAG_NAME)
|
|
72
|
+
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
|
|
73
|
+
- name: Build the binary wheel and a source tarball
|
|
74
|
+
run: just build
|
|
75
|
+
- name: Store the distribution packages
|
|
76
|
+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
|
|
77
|
+
with:
|
|
78
|
+
name: python-package-distributions
|
|
79
|
+
path: dist/
|
|
80
|
+
- name: Set Package Name
|
|
81
|
+
id: set-package
|
|
82
|
+
run: |
|
|
83
|
+
PACKAGE_NAME=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['name'])")
|
|
84
|
+
echo "package_name=${PACKAGE_NAME}" >> $GITHUB_OUTPUT
|
|
85
|
+
|
|
86
|
+
publish-to-testpypi:
|
|
87
|
+
name: Publish to TestPyPI
|
|
88
|
+
needs:
|
|
89
|
+
- build
|
|
90
|
+
runs-on: ubuntu-latest
|
|
91
|
+
environment:
|
|
92
|
+
name: testpypi
|
|
93
|
+
url: https://test.pypi.org/project/${{ needs.build.outputs.PACKAGE_NAME }}
|
|
94
|
+
permissions:
|
|
95
|
+
id-token: write # mandatory for trusted publishing
|
|
96
|
+
steps:
|
|
97
|
+
- name: Download all the dists
|
|
98
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
99
|
+
with:
|
|
100
|
+
name: python-package-distributions
|
|
101
|
+
path: dist/
|
|
102
|
+
- name: Publish distribution to TestPyPI
|
|
103
|
+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
|
|
104
|
+
with:
|
|
105
|
+
repository-url: https://test.pypi.org/legacy/
|
|
106
|
+
skip-existing: true
|
|
107
|
+
|
|
108
|
+
publish-to-pypi:
|
|
109
|
+
name: Publish to PyPI
|
|
110
|
+
needs:
|
|
111
|
+
- lint
|
|
112
|
+
- test
|
|
113
|
+
- build
|
|
114
|
+
- publish-to-testpypi
|
|
115
|
+
runs-on: ubuntu-latest
|
|
116
|
+
environment:
|
|
117
|
+
name: pypi
|
|
118
|
+
url: https://pypi.org/p/${{ needs.build.outputs.PACKAGE_NAME }}
|
|
119
|
+
permissions:
|
|
120
|
+
id-token: write # mandatory for trusted publishing
|
|
121
|
+
steps:
|
|
122
|
+
- name: Download all the dists
|
|
123
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
124
|
+
with:
|
|
125
|
+
name: python-package-distributions
|
|
126
|
+
path: dist/
|
|
127
|
+
- name: Publish distribution to PyPI
|
|
128
|
+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
|
|
129
|
+
|
|
130
|
+
github-release:
|
|
131
|
+
name: Publish GitHub Release
|
|
132
|
+
runs-on: ubuntu-latest
|
|
133
|
+
needs:
|
|
134
|
+
- lint
|
|
135
|
+
- test
|
|
136
|
+
- build
|
|
137
|
+
permissions:
|
|
138
|
+
contents: write # mandatory for making GitHub Releases
|
|
139
|
+
id-token: write # mandatory for sigstore
|
|
140
|
+
|
|
141
|
+
steps:
|
|
142
|
+
- name: Download all the dists
|
|
143
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
144
|
+
with:
|
|
145
|
+
name: python-package-distributions
|
|
146
|
+
path: dist/
|
|
147
|
+
- name: Sign the dists with Sigstore
|
|
148
|
+
uses: sigstore/gh-action-sigstore-python@a5caf349bc536fbef3668a10ed7f5cd309a4b53d
|
|
149
|
+
with:
|
|
150
|
+
inputs: >-
|
|
151
|
+
./dist/*.tar.gz
|
|
152
|
+
./dist/*.whl
|
|
153
|
+
- name: Create GitHub Release
|
|
154
|
+
env:
|
|
155
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
156
|
+
GITHUB_REF_NAME: ${{ github.ref_name }}
|
|
157
|
+
GITHUB_REPOSITORY: ${{ github.repository }}
|
|
158
|
+
run: >-
|
|
159
|
+
gh release create
|
|
160
|
+
"$GITHUB_REF_NAME"
|
|
161
|
+
--repo "$GITHUB_REPOSITORY"
|
|
162
|
+
--generate-notes
|
|
163
|
+
--prerelease
|
|
164
|
+
- name: Upload artifact signatures to GitHub Release
|
|
165
|
+
env:
|
|
166
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
167
|
+
GITHUB_REF_NAME: ${{ github.ref_name }}
|
|
168
|
+
GITHUB_REPOSITORY: ${{ github.repository }}
|
|
169
|
+
run: >-
|
|
170
|
+
gh release upload
|
|
171
|
+
"$GITHUB_REF_NAME" dist/**
|
|
172
|
+
--repo "$GITHUB_REPOSITORY"
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: OpenSSF Scorecard
|
|
2
|
+
on:
|
|
3
|
+
branch_protection_rule:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions: read-all
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
analysis:
|
|
12
|
+
name: Scorecard analysis
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
environment: scorecard
|
|
15
|
+
permissions:
|
|
16
|
+
security-events: write
|
|
17
|
+
id-token: write
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: "Checkout code"
|
|
21
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
22
|
+
with:
|
|
23
|
+
persist-credentials: false
|
|
24
|
+
|
|
25
|
+
- name: "Run analysis"
|
|
26
|
+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a
|
|
27
|
+
with:
|
|
28
|
+
results_file: results.sarif
|
|
29
|
+
results_format: sarif
|
|
30
|
+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
|
|
31
|
+
# - you want to enable the Branch-Protection check on a *public* repository, or
|
|
32
|
+
# - you are installing Scorecard on a *private* repository
|
|
33
|
+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
|
|
34
|
+
repo_token: ${{ secrets.SCORECARD_TOKEN }}
|
|
35
|
+
|
|
36
|
+
# Public repositories:
|
|
37
|
+
# - Publish results to OpenSSF REST API for easy access by consumers
|
|
38
|
+
# - Allows the repository to include the Scorecard badge.
|
|
39
|
+
# - See https://github.com/ossf/scorecard-action#publishing-results.
|
|
40
|
+
# For private repositories:
|
|
41
|
+
# - `publish_results` will always be set to `false`, regardless
|
|
42
|
+
# of the value entered here.
|
|
43
|
+
publish_results: true
|
|
44
|
+
|
|
45
|
+
- name: "Upload artifact"
|
|
46
|
+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
|
|
47
|
+
with:
|
|
48
|
+
name: SARIF file
|
|
49
|
+
path: results.sarif
|
|
50
|
+
retention-days: 5
|
|
51
|
+
|
|
52
|
+
- name: "Upload to code-scanning"
|
|
53
|
+
uses: github/codeql-action/upload-sarif@0d579ffd059c29b07949a3cce3983f0780820c98
|
|
54
|
+
with:
|
|
55
|
+
sarif_file: results.sarif
|