AdsorPy 1.2.1__tar.gz → 1.2.2a4__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.
- adsorpy-1.2.2a4/.github/CODEOWNERS +1 -0
- adsorpy-1.2.2a4/.github/pr-prefix-labeller.yml +17 -0
- adsorpy-1.2.2a4/.github/workflows/codeql.yml +77 -0
- adsorpy-1.2.2a4/.github/workflows/dependency-review.yml +27 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/.github/workflows/docs-ci.yml +20 -11
- adsorpy-1.2.2a4/.github/workflows/publish_to_PyPI.yml +387 -0
- adsorpy-1.2.2a4/.github/workflows/scorecard.yml +83 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/.github/workflows/tests-ci.yml +20 -8
- adsorpy-1.2.2a4/.pre-commit-config.yaml +10 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/CHANGELOG.md +9 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/PKG-INFO +23 -11
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/README.md +9 -3
- adsorpy-1.2.2a4/audit_trail.txt +2259 -0
- adsorpy-1.2.2a4/dist1/adsorpy-1.2.2a4-py3-none-any.whl +0 -0
- adsorpy-1.2.2a4/dist1/adsorpy-1.2.2a4.tar.gz +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/docs/source/adsorpy.rst +9 -1
- adsorpy-1.2.1/docs/source/adsorpy.typing.rst → adsorpy-1.2.2a4/docs/source/adsorpy.types.rst +2 -2
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/docs/source/conf.py +1 -1
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/docs/source/index.rst +8 -1
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/pyproject.toml +36 -9
- adsorpy-1.2.2a4/sbom.cdx.json +14476 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/src/adsorpy/molecule_lib.py +52 -2
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/src/adsorpy/randomsequentialadsorption.py +1 -1
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/src/adsorpy/rsa_calculator.py +1 -1
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/src/adsorpy/run_simulation.py +1 -1
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/tests/rsa_test.py +1 -1
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/tests/run_simulation_test.py +1 -1
- adsorpy-1.2.2a4/tests/xyz_fuzzer_test.py +134 -0
- adsorpy-1.2.2a4/uv.lock +3245 -0
- adsorpy-1.2.1/.github/workflows/publish_to_PyPI.yml +0 -49
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/.github/dependabot.yml +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/CODE_OF_CONDUCT.md +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/CONTRIBUTING.md +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/LICENSE.md +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/SECURITY.md +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/docs/Makefile +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/docs/make.bat +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/docs/source/adsorpy.molecule_lib.rst +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/docs/source/adsorpy.randomsequentialadsorption.rst +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/docs/source/adsorpy.rsa_calculator.rst +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/docs/source/adsorpy.rsa_config.rst +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/docs/source/adsorpy.run_simulation.rst +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/docs/source/modules.rst +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/images/AdsorPy_Covered_Surface.png +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/py.typed +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/src/__init__.py +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/src/__main__.py +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/src/adsorpy/VdW_Radii.csv +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/src/adsorpy/__init__.py +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/src/adsorpy/config.json +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/src/adsorpy/molecule_colour.json +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/src/adsorpy/rsa_config.py +0 -0
- /adsorpy-1.2.1/src/adsorpy/typing.py → /adsorpy-1.2.2a4/src/adsorpy/types.py +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/tach.toml +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/tests/__init__.py +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/tests/test_data/config_test_hard.json +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/tests/test_data/config_test_periodic.json +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/tests/test_data/config_test_soft.json +0 -0
- {adsorpy-1.2.1 → adsorpy-1.2.2a4}/tox.toml +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* @JoostFWMaas
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"API": "30 - API"
|
|
2
|
+
"BENCH": "28 - Benchmark"
|
|
3
|
+
"BLD": "36 - Build"
|
|
4
|
+
"BUG": "00 - Bug"
|
|
5
|
+
"DEP": "07 - Deprecation"
|
|
6
|
+
"DEV": "16 - Development"
|
|
7
|
+
"DOC": "04 - Documentation"
|
|
8
|
+
"ENH": "01 - Enhancement"
|
|
9
|
+
"MAINT": "03 - Maintenance"
|
|
10
|
+
"MNT": "03 - Maintenance"
|
|
11
|
+
"REL": "14 - Release"
|
|
12
|
+
"REV": "34 - Reversion"
|
|
13
|
+
"STY": "03 - Maintenance"
|
|
14
|
+
"TST": "05 - Testing"
|
|
15
|
+
"TYP": "41 - Static typing"
|
|
16
|
+
"WIP": "25 - WIP"
|
|
17
|
+
# Copied from Numpy
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
|
2
|
+
# to commit it to your repository.
|
|
3
|
+
#
|
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
|
5
|
+
# or to provide custom queries or build logic.
|
|
6
|
+
#
|
|
7
|
+
# ******** NOTE ********
|
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
|
+
# supported CodeQL languages.
|
|
11
|
+
#
|
|
12
|
+
name: "CodeQL"
|
|
13
|
+
|
|
14
|
+
on:
|
|
15
|
+
push:
|
|
16
|
+
branches: ["main"]
|
|
17
|
+
pull_request:
|
|
18
|
+
# The branches below must be a subset of the branches above
|
|
19
|
+
branches: ["main"]
|
|
20
|
+
schedule:
|
|
21
|
+
- cron: "0 0 * * 1"
|
|
22
|
+
|
|
23
|
+
permissions: {}
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
analyze:
|
|
27
|
+
name: Analyze
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
permissions:
|
|
30
|
+
contents: read
|
|
31
|
+
security-events: write
|
|
32
|
+
|
|
33
|
+
strategy:
|
|
34
|
+
fail-fast: false
|
|
35
|
+
matrix:
|
|
36
|
+
language: ["python"]
|
|
37
|
+
# CodeQL supports [ $supported-codeql-languages ]
|
|
38
|
+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
|
39
|
+
|
|
40
|
+
steps:
|
|
41
|
+
- name: Harden the runner (Audit all outbound calls)
|
|
42
|
+
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2.19.3
|
|
43
|
+
with:
|
|
44
|
+
egress-policy: audit
|
|
45
|
+
|
|
46
|
+
- name: Checkout repository
|
|
47
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
48
|
+
with:
|
|
49
|
+
persist-credentials: false
|
|
50
|
+
|
|
51
|
+
# Initializes the CodeQL tools for scanning.
|
|
52
|
+
- name: Initialize CodeQL
|
|
53
|
+
uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
|
|
54
|
+
with:
|
|
55
|
+
languages: ${{ matrix.language }}
|
|
56
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
57
|
+
# By default, queries listed here will override any specified in a config file.
|
|
58
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
59
|
+
|
|
60
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
61
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
|
62
|
+
- name: Autobuild
|
|
63
|
+
uses: github/codeql-action/autobuild@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
|
|
64
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
|
65
|
+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
|
66
|
+
|
|
67
|
+
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
|
68
|
+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
|
69
|
+
|
|
70
|
+
# - run: |
|
|
71
|
+
# echo "Run, Build Application using script"
|
|
72
|
+
# ./location_of_script_within_repo/buildscript.sh
|
|
73
|
+
|
|
74
|
+
- name: Perform CodeQL Analysis
|
|
75
|
+
uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
|
|
76
|
+
with:
|
|
77
|
+
category: "/language:${{matrix.language}}"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Dependency Review Action
|
|
2
|
+
#
|
|
3
|
+
# This Action will scan dependency manifest files that change as part of a Pull Request,
|
|
4
|
+
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
|
|
5
|
+
# Once installed, if the workflow run is marked as required,
|
|
6
|
+
# PRs introducing known-vulnerable packages will be blocked from merging.
|
|
7
|
+
#
|
|
8
|
+
# Source repository: https://github.com/actions/dependency-review-action
|
|
9
|
+
name: 'Dependency Review'
|
|
10
|
+
on: [pull_request]
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
dependency-review:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- name: Harden the runner (Audit all outbound calls)
|
|
20
|
+
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2.19.3
|
|
21
|
+
with:
|
|
22
|
+
egress-policy: audit
|
|
23
|
+
|
|
24
|
+
- name: 'Checkout Repository'
|
|
25
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
26
|
+
- name: 'Dependency Review'
|
|
27
|
+
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
name: Docs
|
|
3
2
|
|
|
4
3
|
on:
|
|
@@ -23,31 +22,36 @@ jobs:
|
|
|
23
22
|
# needs: test
|
|
24
23
|
|
|
25
24
|
steps:
|
|
25
|
+
- name: Harden the runner (Audit all outbound calls)
|
|
26
|
+
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2.19.3
|
|
27
|
+
with:
|
|
28
|
+
egress-policy: audit
|
|
29
|
+
|
|
26
30
|
- name: Checkout
|
|
27
|
-
uses: actions/checkout@v6
|
|
31
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
28
32
|
|
|
29
33
|
- name: Set up Python
|
|
30
|
-
uses: actions/setup-python@v6
|
|
34
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
31
35
|
with:
|
|
32
36
|
python-version: "3.14"
|
|
33
37
|
|
|
38
|
+
- name: Set up uv
|
|
39
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
|
40
|
+
|
|
34
41
|
- name: Install Sphinx and theme
|
|
35
|
-
run:
|
|
36
|
-
python -m pip install --upgrade pip
|
|
37
|
-
python -m pip install -e .[docs] # Installs adsorpy with [docs] optional requirements.
|
|
42
|
+
run: uv sync --frozen --extra docs # Installs adsorpy with [docs] optional requirements.
|
|
38
43
|
|
|
39
44
|
# Optional: configure Pages (sets up base_url, etc.)
|
|
40
45
|
- name: Configure Pages
|
|
41
|
-
uses: actions/configure-pages@v6
|
|
46
|
+
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
|
|
42
47
|
|
|
43
48
|
- name: Build Sphinx docs
|
|
44
49
|
run: |
|
|
45
50
|
mkdir -p public
|
|
46
|
-
|
|
47
|
-
python -m sphinx -W docs/source public
|
|
51
|
+
uv run python -m sphinx -W docs/source public
|
|
48
52
|
|
|
49
53
|
- name: Upload artifact for Pages
|
|
50
|
-
uses: actions/upload-pages-artifact@v5
|
|
54
|
+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
|
|
51
55
|
with:
|
|
52
56
|
path: ./public
|
|
53
57
|
|
|
@@ -62,6 +66,11 @@ jobs:
|
|
|
62
66
|
pages: write
|
|
63
67
|
id-token: write
|
|
64
68
|
steps:
|
|
69
|
+
- name: Harden the runner (Audit all outbound calls)
|
|
70
|
+
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2.19.3
|
|
71
|
+
with:
|
|
72
|
+
egress-policy: audit
|
|
73
|
+
|
|
65
74
|
- name: Deploy to GitHub Pages
|
|
66
75
|
id: deploy-pages
|
|
67
|
-
uses: actions/deploy-pages@v5
|
|
76
|
+
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
# workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: release-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
permissions: {}
|
|
13
|
+
|
|
14
|
+
env:
|
|
15
|
+
PACKAGE_NAME: adsorpy
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build:
|
|
19
|
+
name: build + reproducible artifacts
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
outputs:
|
|
22
|
+
hashes: ${{ steps.hash.outputs.hashes }}
|
|
23
|
+
|
|
24
|
+
permissions:
|
|
25
|
+
contents: read
|
|
26
|
+
id-token: write
|
|
27
|
+
|
|
28
|
+
env:
|
|
29
|
+
SOURCE_DATE_EPOCH: "0"
|
|
30
|
+
PYTHONHASHSEED: "0"
|
|
31
|
+
UV_FROZEN: "1"
|
|
32
|
+
|
|
33
|
+
steps:
|
|
34
|
+
- name: Harden runner
|
|
35
|
+
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5
|
|
36
|
+
with:
|
|
37
|
+
egress-policy: audit
|
|
38
|
+
|
|
39
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
40
|
+
|
|
41
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
|
|
42
|
+
with:
|
|
43
|
+
python-version: "3.14"
|
|
44
|
+
|
|
45
|
+
- name: Setup uv
|
|
46
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
|
47
|
+
|
|
48
|
+
- name: Cache uv
|
|
49
|
+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
|
|
50
|
+
with:
|
|
51
|
+
path: ~/.cache/uv
|
|
52
|
+
key: uv-${{ hashFiles('uv.lock') }}
|
|
53
|
+
|
|
54
|
+
# -------------------------------
|
|
55
|
+
# SBOM GENERATION + SIGNING INPUT
|
|
56
|
+
# -------------------------------
|
|
57
|
+
- name: Generate SBOM
|
|
58
|
+
uses: sbomify/sbomify-action@ac8b0d423c90447f3011ef8ab5f9ff2e854c6931
|
|
59
|
+
env:
|
|
60
|
+
LOCK_FILE: uv.lock
|
|
61
|
+
OUTPUT_FILE: sbom.cdx.json
|
|
62
|
+
UPLOAD: false
|
|
63
|
+
COMPONENT_NAME: ${{ env.PACKAGE_NAME }}
|
|
64
|
+
COMPONENT_VERSION: ${{ github.ref_name }}
|
|
65
|
+
ENRICH: true
|
|
66
|
+
|
|
67
|
+
# -------------------------------
|
|
68
|
+
# INSTALL BUILD TOOLS
|
|
69
|
+
# -------------------------------
|
|
70
|
+
- name: Install build and validation tools
|
|
71
|
+
run: |
|
|
72
|
+
set -euo pipefail
|
|
73
|
+
uv sync --frozen --extra dev-misc --no-default-groups
|
|
74
|
+
|
|
75
|
+
# -------------------------------
|
|
76
|
+
# DETERMINISTIC DOUBLE BUILD
|
|
77
|
+
# -------------------------------
|
|
78
|
+
- name: Build #1
|
|
79
|
+
run: |
|
|
80
|
+
set -euo pipefail
|
|
81
|
+
rm -rf dist1 dist2 dist
|
|
82
|
+
mkdir dist1 dist2
|
|
83
|
+
uv run python -m build --outdir dist1
|
|
84
|
+
|
|
85
|
+
- name: Build #2 (candidate reproducible)
|
|
86
|
+
run: |
|
|
87
|
+
set -euo pipefail
|
|
88
|
+
uv run python -m build --outdir dist2
|
|
89
|
+
|
|
90
|
+
- name: Compare builds
|
|
91
|
+
run: |
|
|
92
|
+
set -euo pipefail
|
|
93
|
+
rm -rf reproducibility
|
|
94
|
+
mkdir reproducibility
|
|
95
|
+
sha256sum dist1/*.whl | awk '{print $1}' > reproducibility/hashes1.txt
|
|
96
|
+
sha256sum dist2/*.whl | awk '{print $1}' > reproducibility/hashes2.txt
|
|
97
|
+
diff reproducibility/hashes1.txt reproducibility/hashes2.txt
|
|
98
|
+
echo "Reproducible build OK"
|
|
99
|
+
|
|
100
|
+
- name: Promote reproducible build to dist/
|
|
101
|
+
run: |
|
|
102
|
+
set -euo pipefail
|
|
103
|
+
rm -rf dist
|
|
104
|
+
mv dist2 dist
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
- name: Generate hashes.txt
|
|
108
|
+
run: |
|
|
109
|
+
set -euo pipefail
|
|
110
|
+
sha256sum dist/*.whl dist/*.tar.gz > hashes.txt
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
# -------------------------------
|
|
114
|
+
# VALIDATION ON REPRODUCIBLE BUILD
|
|
115
|
+
# -------------------------------
|
|
116
|
+
- name: Twine check
|
|
117
|
+
run: |
|
|
118
|
+
set -euo pipefail
|
|
119
|
+
uv run python -m twine check dist/*
|
|
120
|
+
|
|
121
|
+
- name: Check wheel contents
|
|
122
|
+
run: |
|
|
123
|
+
set -euo pipefail
|
|
124
|
+
uv tool run check-wheel-contents dist/*.whl
|
|
125
|
+
|
|
126
|
+
- name: Smoke test (wheel)
|
|
127
|
+
run: |
|
|
128
|
+
set -euo pipefail
|
|
129
|
+
uv run --no-project pip install dist/*.whl
|
|
130
|
+
uv run --no-project python -c "import ${PACKAGE_NAME}; print(${PACKAGE_NAME}.__version__)"
|
|
131
|
+
|
|
132
|
+
- name: Smoke test (sdist)
|
|
133
|
+
run: |
|
|
134
|
+
set -euo pipefail
|
|
135
|
+
uv run --no-project pip install dist/*.tar.gz
|
|
136
|
+
uv run --no-project python -c "import ${PACKAGE_NAME}; print(${PACKAGE_NAME}.__version__)"
|
|
137
|
+
|
|
138
|
+
- name: Verify version matches tag
|
|
139
|
+
run: |
|
|
140
|
+
set -euo pipefail
|
|
141
|
+
python - <<EOF
|
|
142
|
+
import re
|
|
143
|
+
import sys
|
|
144
|
+
from packaging.version import Version
|
|
145
|
+
|
|
146
|
+
import ${PACKAGE_NAME}
|
|
147
|
+
|
|
148
|
+
expected_raw = "${GITHUB_REF_NAME}"
|
|
149
|
+
actual = Version(${PACKAGE_NAME}.__version__)
|
|
150
|
+
|
|
151
|
+
# Normalize Git tag → PEP 440
|
|
152
|
+
expected = expected_raw
|
|
153
|
+
|
|
154
|
+
# strip leading "v"
|
|
155
|
+
expected = re.sub(r"^v", "", expected)
|
|
156
|
+
|
|
157
|
+
# convert semver prerelease → PEP 440
|
|
158
|
+
expected = expected.replace("-alpha.", "a")
|
|
159
|
+
expected = expected.replace("-beta.", "b")
|
|
160
|
+
expected = expected.replace("-rc.", "rc")
|
|
161
|
+
|
|
162
|
+
# drop build metadata (+...)
|
|
163
|
+
expected = re.sub(r"\+.*$", "", expected)
|
|
164
|
+
|
|
165
|
+
expected = Version(expected)
|
|
166
|
+
|
|
167
|
+
if actual != expected:
|
|
168
|
+
print(f"Version mismatch: {actual} != {expected} (from {expected_raw})")
|
|
169
|
+
sys.exit(1)
|
|
170
|
+
|
|
171
|
+
print(f"Version OK: {actual}")
|
|
172
|
+
EOF
|
|
173
|
+
|
|
174
|
+
- name: Generate base64 subject hashes
|
|
175
|
+
id: hash
|
|
176
|
+
run: |
|
|
177
|
+
set -euo pipefail
|
|
178
|
+
HASHES=$(sha256sum dist/*.whl dist/*.tar.gz | base64 -w0)
|
|
179
|
+
echo "hashes=$HASHES" >> "$GITHUB_OUTPUT"
|
|
180
|
+
|
|
181
|
+
- name: Upload dist artifacts
|
|
182
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
|
|
183
|
+
with:
|
|
184
|
+
name: dist
|
|
185
|
+
path: |
|
|
186
|
+
dist/
|
|
187
|
+
hashes.txt
|
|
188
|
+
|
|
189
|
+
- name: Upload SBOM
|
|
190
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
|
|
191
|
+
with:
|
|
192
|
+
name: sbom
|
|
193
|
+
path: sbom.cdx.json
|
|
194
|
+
|
|
195
|
+
sign:
|
|
196
|
+
name: sign reproducible artifacts + SBOM
|
|
197
|
+
needs: build
|
|
198
|
+
runs-on: ubuntu-latest
|
|
199
|
+
|
|
200
|
+
permissions:
|
|
201
|
+
id-token: write
|
|
202
|
+
contents: read
|
|
203
|
+
|
|
204
|
+
steps:
|
|
205
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
206
|
+
with:
|
|
207
|
+
name: dist
|
|
208
|
+
path: .
|
|
209
|
+
|
|
210
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
211
|
+
with:
|
|
212
|
+
name: sbom
|
|
213
|
+
path: .
|
|
214
|
+
|
|
215
|
+
- name: List artifacts
|
|
216
|
+
run: |
|
|
217
|
+
echo "Files:"
|
|
218
|
+
find . -maxdepth 2 -type f
|
|
219
|
+
|
|
220
|
+
- name: Sign SBOM (Sigstore)
|
|
221
|
+
uses: sigstore/gh-action-sigstore-python@04cffa1d795717b140764e8b640de88853c92acc
|
|
222
|
+
with:
|
|
223
|
+
inputs: sbom.cdx.json
|
|
224
|
+
staging: false
|
|
225
|
+
verify: true
|
|
226
|
+
verify-cert-identity: https://github.com/${{ github.repository }}/.github/workflows/publish_to_PyPI.yml@${{ github.ref }}
|
|
227
|
+
verify-oidc-issuer: https://token.actions.githubusercontent.com
|
|
228
|
+
upload-signing-artifacts: false
|
|
229
|
+
release-signing-artifacts: false
|
|
230
|
+
|
|
231
|
+
- name: Sign artifacts (Sigstore)
|
|
232
|
+
uses: sigstore/gh-action-sigstore-python@04cffa1d795717b140764e8b640de88853c92acc
|
|
233
|
+
with:
|
|
234
|
+
inputs: dist/*.whl dist/*.tar.gz hashes.txt
|
|
235
|
+
staging: false
|
|
236
|
+
verify: true
|
|
237
|
+
verify-cert-identity: https://github.com/${{ github.repository }}/.github/workflows/publish_to_PyPI.yml@${{ github.ref }}
|
|
238
|
+
verify-oidc-issuer: https://token.actions.githubusercontent.com
|
|
239
|
+
upload-signing-artifacts: false
|
|
240
|
+
release-signing-artifacts: false
|
|
241
|
+
|
|
242
|
+
- name: Upload signed artifacts + SBOM bundles
|
|
243
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
|
|
244
|
+
with:
|
|
245
|
+
name: signed-dist
|
|
246
|
+
path: |
|
|
247
|
+
dist/
|
|
248
|
+
hashes.txt
|
|
249
|
+
sbom.cdx.json
|
|
250
|
+
sbom.cdx.json.sigstore.json
|
|
251
|
+
|
|
252
|
+
provenance:
|
|
253
|
+
needs: [build]
|
|
254
|
+
permissions:
|
|
255
|
+
actions: read
|
|
256
|
+
id-token: write
|
|
257
|
+
contents: write
|
|
258
|
+
# uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@f7dd8c54c2067bafc12ca7a55595d5ee9b75204a
|
|
259
|
+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0
|
|
260
|
+
with:
|
|
261
|
+
base64-subjects: "${{ needs.build.outputs.hashes }}"
|
|
262
|
+
upload-assets: true
|
|
263
|
+
|
|
264
|
+
publish-testpypi:
|
|
265
|
+
name: publish to TestPyPI
|
|
266
|
+
needs: [build, sign]
|
|
267
|
+
runs-on: ubuntu-latest
|
|
268
|
+
environment:
|
|
269
|
+
name: pypi
|
|
270
|
+
|
|
271
|
+
permissions:
|
|
272
|
+
id-token: write
|
|
273
|
+
|
|
274
|
+
steps:
|
|
275
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
276
|
+
with:
|
|
277
|
+
name: dist
|
|
278
|
+
path: .
|
|
279
|
+
|
|
280
|
+
- name: Show hashes (pre-publish verification)
|
|
281
|
+
run: cat hashes.txt
|
|
282
|
+
|
|
283
|
+
- name: Publish to TestPyPI
|
|
284
|
+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
|
|
285
|
+
with:
|
|
286
|
+
repository-url: https://test.pypi.org/legacy/
|
|
287
|
+
print-hash: true
|
|
288
|
+
attestations: true
|
|
289
|
+
|
|
290
|
+
verify-install:
|
|
291
|
+
name: verify install from TestPyPI
|
|
292
|
+
needs: publish-testpypi
|
|
293
|
+
runs-on: ubuntu-latest
|
|
294
|
+
|
|
295
|
+
steps:
|
|
296
|
+
- name: Setup uv
|
|
297
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
|
298
|
+
|
|
299
|
+
- name: Normalize version
|
|
300
|
+
id: normalize_version
|
|
301
|
+
run: |
|
|
302
|
+
VERSION="${GITHUB_REF_NAME}"
|
|
303
|
+
|
|
304
|
+
VERSION="${VERSION#v}" # strip leading v
|
|
305
|
+
VERSION="${VERSION/-alpha./a}"
|
|
306
|
+
VERSION="${VERSION/-beta./b}"
|
|
307
|
+
VERSION="${VERSION/-rc./rc}"
|
|
308
|
+
VERSION=$(echo "$VERSION" | sed 's/+.*//') # remove build metadata
|
|
309
|
+
|
|
310
|
+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
311
|
+
|
|
312
|
+
- name: Install from TestPyPI
|
|
313
|
+
run: |
|
|
314
|
+
set -euo pipefail
|
|
315
|
+
uv run --no-project pip install \
|
|
316
|
+
--index-url https://test.pypi.org/simple \
|
|
317
|
+
--extra-index-url https://pypi.org/simple \
|
|
318
|
+
${PACKAGE_NAME}==${{ steps.normalize_version.outputs.version }}
|
|
319
|
+
uv run --no-project python -c "import ${PACKAGE_NAME}; print(${PACKAGE_NAME}.__version__)"
|
|
320
|
+
|
|
321
|
+
- name: Verify import outside project tree
|
|
322
|
+
run: |
|
|
323
|
+
set -euo pipefail
|
|
324
|
+
mkdir /tmp/testimport
|
|
325
|
+
cd /tmp/testimport
|
|
326
|
+
uv run --no-project python -c "import ${PACKAGE_NAME}; print('Import OK')"
|
|
327
|
+
|
|
328
|
+
publish:
|
|
329
|
+
name: publish to PyPI
|
|
330
|
+
needs: verify-install
|
|
331
|
+
runs-on: ubuntu-latest
|
|
332
|
+
|
|
333
|
+
environment:
|
|
334
|
+
name: pypi
|
|
335
|
+
|
|
336
|
+
permissions:
|
|
337
|
+
id-token: write
|
|
338
|
+
|
|
339
|
+
steps:
|
|
340
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
341
|
+
with:
|
|
342
|
+
name: dist
|
|
343
|
+
path: .
|
|
344
|
+
|
|
345
|
+
- name: Verify hashes before publish
|
|
346
|
+
run: |
|
|
347
|
+
set -euo pipefail
|
|
348
|
+
sha256sum -c hashes.txt
|
|
349
|
+
|
|
350
|
+
- name: Publish to PyPI
|
|
351
|
+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
|
|
352
|
+
with:
|
|
353
|
+
attestations: true
|
|
354
|
+
print-hash: true
|
|
355
|
+
|
|
356
|
+
create-release:
|
|
357
|
+
name: create immutable GitHub release
|
|
358
|
+
needs: [publish, sign, provenance]
|
|
359
|
+
runs-on: ubuntu-latest
|
|
360
|
+
|
|
361
|
+
permissions:
|
|
362
|
+
contents: write
|
|
363
|
+
|
|
364
|
+
steps:
|
|
365
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
366
|
+
with:
|
|
367
|
+
name: dist
|
|
368
|
+
path: .
|
|
369
|
+
|
|
370
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
371
|
+
with:
|
|
372
|
+
name: signed-dist
|
|
373
|
+
path: signed/
|
|
374
|
+
|
|
375
|
+
- name: Collect release files
|
|
376
|
+
run: |
|
|
377
|
+
set -euo pipefail
|
|
378
|
+
mkdir release-assets
|
|
379
|
+
cp dist/* release-assets/
|
|
380
|
+
cp signed/* release-assets/ || true
|
|
381
|
+
|
|
382
|
+
- name: Create GitHub Release (immutable)
|
|
383
|
+
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe
|
|
384
|
+
with:
|
|
385
|
+
files: release-assets/*
|
|
386
|
+
env:
|
|
387
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub. They are provided
|
|
2
|
+
# by a third-party and are governed by separate terms of service, privacy
|
|
3
|
+
# policy, and support documentation.
|
|
4
|
+
|
|
5
|
+
name: Scorecard supply-chain security
|
|
6
|
+
on:
|
|
7
|
+
# For Branch-Protection check. Only the default branch is supported. See
|
|
8
|
+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
|
|
9
|
+
branch_protection_rule:
|
|
10
|
+
# To guarantee Maintained check is occasionally updated. See
|
|
11
|
+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
|
|
12
|
+
schedule:
|
|
13
|
+
- cron: '28 10 * * 5'
|
|
14
|
+
push:
|
|
15
|
+
branches: [ "main" ]
|
|
16
|
+
|
|
17
|
+
# Declare default permissions as read only.
|
|
18
|
+
permissions: read-all
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
analysis:
|
|
22
|
+
name: Scorecard analysis
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
# `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
|
|
25
|
+
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
|
|
26
|
+
permissions:
|
|
27
|
+
# Needed to upload the results to code-scanning dashboard.
|
|
28
|
+
security-events: write
|
|
29
|
+
# Needed to publish results and get a badge (see publish_results below).
|
|
30
|
+
id-token: write
|
|
31
|
+
# Uncomment the permissions below if installing in a private repository.
|
|
32
|
+
# contents: read
|
|
33
|
+
# actions: read
|
|
34
|
+
|
|
35
|
+
steps:
|
|
36
|
+
- name: Harden the runner (Audit all outbound calls)
|
|
37
|
+
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2.19.3
|
|
38
|
+
with:
|
|
39
|
+
egress-policy: audit
|
|
40
|
+
|
|
41
|
+
- name: "Checkout code"
|
|
42
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
43
|
+
with:
|
|
44
|
+
persist-credentials: false
|
|
45
|
+
|
|
46
|
+
- name: "Run analysis"
|
|
47
|
+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
|
|
48
|
+
with:
|
|
49
|
+
results_file: results.sarif
|
|
50
|
+
results_format: sarif
|
|
51
|
+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
|
|
52
|
+
# - you want to enable the Branch-Protection check on a *public* repository, or
|
|
53
|
+
# - you are installing Scorecard on a *private* repository
|
|
54
|
+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
|
|
55
|
+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
|
|
56
|
+
|
|
57
|
+
# Public repositories:
|
|
58
|
+
# - Publish results to OpenSSF REST API for easy access by consumers
|
|
59
|
+
# - Allows the repository to include the Scorecard badge.
|
|
60
|
+
# - See https://github.com/ossf/scorecard-action#publishing-results.
|
|
61
|
+
# For private repositories:
|
|
62
|
+
# - `publish_results` will always be set to `false`, regardless
|
|
63
|
+
# of the value entered here.
|
|
64
|
+
publish_results: true
|
|
65
|
+
|
|
66
|
+
# (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore
|
|
67
|
+
# file_mode: git
|
|
68
|
+
|
|
69
|
+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
|
70
|
+
# format to the repository Actions tab.
|
|
71
|
+
- name: "Upload artifact"
|
|
72
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
73
|
+
with:
|
|
74
|
+
name: SARIF file
|
|
75
|
+
path: results.sarif
|
|
76
|
+
retention-days: 5
|
|
77
|
+
|
|
78
|
+
# Upload the results to GitHub's code scanning dashboard (optional).
|
|
79
|
+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
|
|
80
|
+
- name: "Upload to code-scanning"
|
|
81
|
+
uses: github/codeql-action/upload-sarif@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
|
|
82
|
+
with:
|
|
83
|
+
sarif_file: results.sarif
|