standards-sdk-py 0.1.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.
- standards_sdk_py-0.1.0/.editorconfig +18 -0
- standards_sdk_py-0.1.0/.github/codeql/codeql-config.yml +10 -0
- standards_sdk_py-0.1.0/.github/dependabot.yml +24 -0
- standards_sdk_py-0.1.0/.github/workflows/ci.yml +135 -0
- standards_sdk_py-0.1.0/.github/workflows/codeql.yml +29 -0
- standards_sdk_py-0.1.0/.github/workflows/dco.yml +22 -0
- standards_sdk_py-0.1.0/.github/workflows/publish.yml +158 -0
- standards_sdk_py-0.1.0/.github/workflows/security.yml +73 -0
- standards_sdk_py-0.1.0/.gitignore +72 -0
- standards_sdk_py-0.1.0/.pre-commit-config.yaml +34 -0
- standards_sdk_py-0.1.0/.python-version +1 -0
- standards_sdk_py-0.1.0/Hashgraph-Online.png +0 -0
- standards_sdk_py-0.1.0/LICENSE +189 -0
- standards_sdk_py-0.1.0/PKG-INFO +258 -0
- standards_sdk_py-0.1.0/README.md +215 -0
- standards_sdk_py-0.1.0/SECURITY.md +40 -0
- standards_sdk_py-0.1.0/docs/module-matrix.md +26 -0
- standards_sdk_py-0.1.0/examples/hcs10_messaging.py +22 -0
- standards_sdk_py-0.1.0/examples/inscriber_testnet_e2e.py +66 -0
- standards_sdk_py-0.1.0/examples/registry_broker_core.py +18 -0
- standards_sdk_py-0.1.0/examples/skill_publish_flow.py +24 -0
- standards_sdk_py-0.1.0/pyproject.toml +126 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/__init__.py +97 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/exceptions.py +52 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs10/__init__.py +310 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs11/__init__.py +222 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs12/__init__.py +180 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs14/__init__.py +436 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs15/__init__.py +23 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs15/client.py +337 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs15/models.py +42 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs16/__init__.py +59 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs16/client.py +1044 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs16/models.py +178 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs17/__init__.py +27 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs17/client.py +416 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs17/models.py +58 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs18/__init__.py +25 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs18/client.py +366 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs18/models.py +46 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs2/__init__.py +49 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs2/client.py +840 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs2/models.py +137 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs20/__init__.py +31 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs20/client.py +469 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs20/models.py +89 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs21/__init__.py +51 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs21/client.py +890 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs21/models.py +199 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs26/__init__.py +178 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs27/__init__.py +210 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs3/__init__.py +222 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs5/__init__.py +23 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs5/client.py +331 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs5/models.py +36 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs6/__init__.py +49 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs6/client.py +957 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs6/models.py +134 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs7/__init__.py +49 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs7/client.py +571 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/hcs7/models.py +127 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/inscriber/__init__.py +49 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/inscriber/client.py +903 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/mirror/__init__.py +17 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/mirror/async_client.py +142 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/mirror/client.py +523 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/mirror/models.py +25 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/parity/__init__.py +11 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/parity/checker.py +254 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/parity/generated/go-registry-broker-methods.json +127 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/parity/generated/ts-core-client-methods.json +408 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/parity/generated/ts-registry-broker-methods.json +128 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/parity/inventory.py +312 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/parity/models.py +39 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/parity/parity-manifest.json +2796 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/py.typed +1 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/registry_broker/__init__.py +31 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/registry_broker/async_client.py +843 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/registry_broker/models.py +84 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/registry_broker/operations.py +126 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/registry_broker/sync_client.py +994 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/shared/__init__.py +15 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/shared/config.py +96 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/shared/hcs_method_inventory.py +244 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/shared/hcs_module.py +164 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/shared/http.py +250 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/shared/operation_dispatch.py +60 -0
- standards_sdk_py-0.1.0/src/standards_sdk_py/shared/types.py +12 -0
- standards_sdk_py-0.1.0/tests/test_async_client_extended.py +1145 -0
- standards_sdk_py-0.1.0/tests/test_checker_extended.py +265 -0
- standards_sdk_py-0.1.0/tests/test_config.py +31 -0
- standards_sdk_py-0.1.0/tests/test_exceptions.py +72 -0
- standards_sdk_py-0.1.0/tests/test_hcs2_integration.py +128 -0
- standards_sdk_py-0.1.0/tests/test_hcs6_integration.py +76 -0
- standards_sdk_py-0.1.0/tests/test_hcs7_integration.py +98 -0
- standards_sdk_py-0.1.0/tests/test_hcs_method_surface.py +110 -0
- standards_sdk_py-0.1.0/tests/test_hcs_module.py +328 -0
- standards_sdk_py-0.1.0/tests/test_hcs_modules.py +155 -0
- standards_sdk_py-0.1.0/tests/test_http_transport.py +402 -0
- standards_sdk_py-0.1.0/tests/test_inscriber_broker.py +166 -0
- standards_sdk_py-0.1.0/tests/test_inscriber_full.py +717 -0
- standards_sdk_py-0.1.0/tests/test_inscriber_integration.py +110 -0
- standards_sdk_py-0.1.0/tests/test_inscriber_ledger.py +405 -0
- standards_sdk_py-0.1.0/tests/test_inscriber_retry.py +302 -0
- standards_sdk_py-0.1.0/tests/test_inscriber_top_level_functions.py +34 -0
- standards_sdk_py-0.1.0/tests/test_inscriber_toplevel.py +91 -0
- standards_sdk_py-0.1.0/tests/test_mirror_async.py +210 -0
- standards_sdk_py-0.1.0/tests/test_mirror_client.py +46 -0
- standards_sdk_py-0.1.0/tests/test_mirror_expanded.py +823 -0
- standards_sdk_py-0.1.0/tests/test_mirror_full.py +197 -0
- standards_sdk_py-0.1.0/tests/test_mirror_method_surface.py +95 -0
- standards_sdk_py-0.1.0/tests/test_parity_and_config.py +724 -0
- standards_sdk_py-0.1.0/tests/test_parity_checker.py +10 -0
- standards_sdk_py-0.1.0/tests/test_registry_broker_async.py +38 -0
- standards_sdk_py-0.1.0/tests/test_registry_broker_full.py +449 -0
- standards_sdk_py-0.1.0/tests/test_registry_broker_sync.py +44 -0
- standards_sdk_py-0.1.0/tests/test_sync_client_extended.py +1619 -0
- standards_sdk_py-0.1.0/tests/test_transport.py +45 -0
- standards_sdk_py-0.1.0/uv.lock +1595 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
charset = utf-8
|
|
5
|
+
end_of_line = lf
|
|
6
|
+
insert_final_newline = true
|
|
7
|
+
indent_style = space
|
|
8
|
+
indent_size = 2
|
|
9
|
+
trim_trailing_whitespace = true
|
|
10
|
+
|
|
11
|
+
[*.py]
|
|
12
|
+
indent_size = 4
|
|
13
|
+
|
|
14
|
+
[Makefile]
|
|
15
|
+
indent_style = tab
|
|
16
|
+
|
|
17
|
+
[*.md]
|
|
18
|
+
trim_trailing_whitespace = false
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "pip"
|
|
4
|
+
directory: "/standards-sdk-py"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
day: "monday"
|
|
8
|
+
time: "05:00"
|
|
9
|
+
timezone: "America/New_York"
|
|
10
|
+
open-pull-requests-limit: 10
|
|
11
|
+
labels:
|
|
12
|
+
- "dependencies"
|
|
13
|
+
- "python"
|
|
14
|
+
- package-ecosystem: "github-actions"
|
|
15
|
+
directory: "/standards-sdk-py/.github/workflows"
|
|
16
|
+
schedule:
|
|
17
|
+
interval: "weekly"
|
|
18
|
+
day: "monday"
|
|
19
|
+
time: "05:15"
|
|
20
|
+
timezone: "America/New_York"
|
|
21
|
+
open-pull-requests-limit: 10
|
|
22
|
+
labels:
|
|
23
|
+
- "dependencies"
|
|
24
|
+
- "ci"
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
name: standards-sdk-py-ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
- master
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: standards-sdk-py-ci-${{ github.ref }}
|
|
16
|
+
cancel-in-progress: true
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
quality:
|
|
20
|
+
name: Quality (py${{ matrix.python-version }})
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
strategy:
|
|
23
|
+
fail-fast: false
|
|
24
|
+
matrix:
|
|
25
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
26
|
+
defaults:
|
|
27
|
+
run:
|
|
28
|
+
working-directory: .
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v4
|
|
31
|
+
- uses: actions/setup-python@v5
|
|
32
|
+
with:
|
|
33
|
+
python-version: ${{ matrix.python-version }}
|
|
34
|
+
cache: "pip"
|
|
35
|
+
cache-dependency-path: pyproject.toml
|
|
36
|
+
- name: Install dependencies
|
|
37
|
+
run: |
|
|
38
|
+
python -m pip install --upgrade pip
|
|
39
|
+
pip install -e ".[dev]"
|
|
40
|
+
- name: Lint
|
|
41
|
+
run: ruff check .
|
|
42
|
+
- name: Format
|
|
43
|
+
run: black --check .
|
|
44
|
+
- name: Typecheck
|
|
45
|
+
run: mypy src
|
|
46
|
+
- name: Unit tests
|
|
47
|
+
run: pytest -m "not integration" --cov=standards_sdk_py --cov-report=xml --cov-report=term-missing
|
|
48
|
+
- name: Parity manifest check
|
|
49
|
+
if: matrix.python-version == '3.11'
|
|
50
|
+
run: standards-sdk-py-check-parity
|
|
51
|
+
- name: Generate TS/Go inventories
|
|
52
|
+
if: matrix.python-version == '3.11'
|
|
53
|
+
run: |
|
|
54
|
+
if [ -d ../standards-sdk ] && [ -d ../standards-sdk-go ]; then
|
|
55
|
+
standards-sdk-py-generate-inventory --repo-root ..
|
|
56
|
+
else
|
|
57
|
+
echo "Skipping inventory generation (sibling TS/Go repos not present)."
|
|
58
|
+
fi
|
|
59
|
+
- name: Upload coverage artifact
|
|
60
|
+
if: matrix.python-version == '3.11'
|
|
61
|
+
uses: actions/upload-artifact@v4
|
|
62
|
+
with:
|
|
63
|
+
name: standards-sdk-py-coverage
|
|
64
|
+
path: coverage.xml
|
|
65
|
+
if-no-files-found: error
|
|
66
|
+
|
|
67
|
+
package:
|
|
68
|
+
name: Package Build Check
|
|
69
|
+
needs: quality
|
|
70
|
+
runs-on: ubuntu-latest
|
|
71
|
+
defaults:
|
|
72
|
+
run:
|
|
73
|
+
working-directory: .
|
|
74
|
+
steps:
|
|
75
|
+
- uses: actions/checkout@v4
|
|
76
|
+
- uses: actions/setup-python@v5
|
|
77
|
+
with:
|
|
78
|
+
python-version: "3.11"
|
|
79
|
+
cache: "pip"
|
|
80
|
+
cache-dependency-path: pyproject.toml
|
|
81
|
+
- name: Install packaging toolchain
|
|
82
|
+
run: |
|
|
83
|
+
python -m pip install --upgrade pip
|
|
84
|
+
pip install build twine
|
|
85
|
+
- name: Build wheel and sdist
|
|
86
|
+
run: python -m build
|
|
87
|
+
- name: Validate package metadata
|
|
88
|
+
run: twine check dist/*
|
|
89
|
+
- name: Upload dist artifact
|
|
90
|
+
uses: actions/upload-artifact@v4
|
|
91
|
+
with:
|
|
92
|
+
name: standards-sdk-py-dist
|
|
93
|
+
path: dist/*
|
|
94
|
+
if-no-files-found: error
|
|
95
|
+
|
|
96
|
+
integration:
|
|
97
|
+
name: Live Integration (manual)
|
|
98
|
+
if: github.event_name == 'workflow_dispatch'
|
|
99
|
+
runs-on: ubuntu-latest
|
|
100
|
+
environment: integration
|
|
101
|
+
defaults:
|
|
102
|
+
run:
|
|
103
|
+
working-directory: .
|
|
104
|
+
steps:
|
|
105
|
+
- uses: actions/checkout@v4
|
|
106
|
+
- uses: actions/setup-python@v5
|
|
107
|
+
with:
|
|
108
|
+
python-version: "3.11"
|
|
109
|
+
cache: "pip"
|
|
110
|
+
cache-dependency-path: pyproject.toml
|
|
111
|
+
- name: Install dependencies
|
|
112
|
+
run: |
|
|
113
|
+
python -m pip install --upgrade pip
|
|
114
|
+
pip install -e ".[dev]"
|
|
115
|
+
pip install hedera-sdk-py
|
|
116
|
+
- name: Run integration tests when credentials exist
|
|
117
|
+
env:
|
|
118
|
+
RUN_INTEGRATION: "1"
|
|
119
|
+
RUN_INSCRIBER_INTEGRATION: "1"
|
|
120
|
+
REGISTRY_BROKER_BASE_URL: ${{ secrets.REGISTRY_BROKER_BASE_URL }}
|
|
121
|
+
REGISTRY_BROKER_API_KEY: ${{ secrets.REGISTRY_BROKER_API_KEY }}
|
|
122
|
+
REGISTRY_BROKER_LEDGER_API_KEY: ${{ secrets.REGISTRY_BROKER_LEDGER_API_KEY }}
|
|
123
|
+
HEDERA_NETWORK: ${{ secrets.HEDERA_NETWORK }}
|
|
124
|
+
HEDERA_ACCOUNT_ID: ${{ secrets.HEDERA_ACCOUNT_ID }}
|
|
125
|
+
HEDERA_PRIVATE_KEY: ${{ secrets.HEDERA_PRIVATE_KEY }}
|
|
126
|
+
TESTNET_HEDERA_ACCOUNT_ID: ${{ secrets.TESTNET_HEDERA_ACCOUNT_ID }}
|
|
127
|
+
TESTNET_HEDERA_PRIVATE_KEY: ${{ secrets.TESTNET_HEDERA_PRIVATE_KEY }}
|
|
128
|
+
MAINNET_HEDERA_ACCOUNT_ID: ${{ secrets.MAINNET_HEDERA_ACCOUNT_ID }}
|
|
129
|
+
MAINNET_HEDERA_PRIVATE_KEY: ${{ secrets.MAINNET_HEDERA_PRIVATE_KEY }}
|
|
130
|
+
run: |
|
|
131
|
+
if [ -z "${REGISTRY_BROKER_API_KEY}" ] && [ -z "${REGISTRY_BROKER_LEDGER_API_KEY}" ] && [ -z "${HEDERA_ACCOUNT_ID}" ] && [ -z "${MAINNET_HEDERA_ACCOUNT_ID}" ] && [ -z "${TESTNET_HEDERA_ACCOUNT_ID}" ]; then
|
|
132
|
+
echo "No integration credentials configured; skipping live integration run."
|
|
133
|
+
exit 0
|
|
134
|
+
fi
|
|
135
|
+
pytest -m integration -vv -rs
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: standards-sdk-py-codeql
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
- master
|
|
9
|
+
schedule:
|
|
10
|
+
- cron: "33 6 * * 1"
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
security-events: write
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
analyze:
|
|
19
|
+
name: CodeQL Analyze (Python)
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
- name: Initialize CodeQL
|
|
24
|
+
uses: github/codeql-action/init@v3
|
|
25
|
+
with:
|
|
26
|
+
languages: python
|
|
27
|
+
config-file: .github/codeql/codeql-config.yml
|
|
28
|
+
- name: Perform CodeQL Analysis
|
|
29
|
+
uses: github/codeql-action/analyze@v3
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: standards-sdk-py-dco
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- master
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
pull-requests: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
dco:
|
|
15
|
+
name: DCO Signed-Off
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
- name: Check DCO sign-off
|
|
22
|
+
uses: tim-actions/dco@master
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
name: standards-sdk-py-publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
publish_target:
|
|
7
|
+
description: "Target repository"
|
|
8
|
+
required: true
|
|
9
|
+
default: testpypi
|
|
10
|
+
type: choice
|
|
11
|
+
options:
|
|
12
|
+
- testpypi
|
|
13
|
+
- pypi
|
|
14
|
+
push:
|
|
15
|
+
tags:
|
|
16
|
+
- "standards-sdk-py-v*"
|
|
17
|
+
|
|
18
|
+
permissions:
|
|
19
|
+
contents: read
|
|
20
|
+
|
|
21
|
+
concurrency:
|
|
22
|
+
group: standards-sdk-py-publish-${{ github.ref }}
|
|
23
|
+
cancel-in-progress: false
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
build:
|
|
27
|
+
name: Build + Verify
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
defaults:
|
|
30
|
+
run:
|
|
31
|
+
working-directory: .
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v4
|
|
34
|
+
- uses: actions/setup-python@v5
|
|
35
|
+
with:
|
|
36
|
+
python-version: "3.11"
|
|
37
|
+
cache: "pip"
|
|
38
|
+
cache-dependency-path: pyproject.toml
|
|
39
|
+
- name: Install dependencies
|
|
40
|
+
run: |
|
|
41
|
+
python -m pip install --upgrade pip
|
|
42
|
+
pip install -e ".[dev]"
|
|
43
|
+
pip install build twine
|
|
44
|
+
- name: Validate quality gates
|
|
45
|
+
run: |
|
|
46
|
+
ruff check .
|
|
47
|
+
black --check .
|
|
48
|
+
mypy src
|
|
49
|
+
pytest -m "not integration"
|
|
50
|
+
standards-sdk-py-check-parity
|
|
51
|
+
- name: Build package
|
|
52
|
+
run: python -m build
|
|
53
|
+
- name: Validate package metadata
|
|
54
|
+
run: twine check dist/*
|
|
55
|
+
- name: Upload dist artifacts
|
|
56
|
+
uses: actions/upload-artifact@v4
|
|
57
|
+
with:
|
|
58
|
+
name: standards-sdk-py-dist
|
|
59
|
+
path: dist/*
|
|
60
|
+
if-no-files-found: error
|
|
61
|
+
|
|
62
|
+
publish-testpypi:
|
|
63
|
+
name: Publish to TestPyPI
|
|
64
|
+
needs: build
|
|
65
|
+
if: github.event_name == 'push' || github.event.inputs.publish_target == 'testpypi' || github.event.inputs.publish_target == 'pypi'
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
environment: testpypi
|
|
68
|
+
env:
|
|
69
|
+
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
|
70
|
+
permissions:
|
|
71
|
+
id-token: write
|
|
72
|
+
contents: read
|
|
73
|
+
steps:
|
|
74
|
+
- name: Download dist artifacts
|
|
75
|
+
uses: actions/download-artifact@v4
|
|
76
|
+
with:
|
|
77
|
+
name: standards-sdk-py-dist
|
|
78
|
+
path: dist
|
|
79
|
+
- name: Publish package distributions to TestPyPI (API token)
|
|
80
|
+
if: env.TEST_PYPI_API_TOKEN != ''
|
|
81
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
82
|
+
with:
|
|
83
|
+
repository-url: https://test.pypi.org/legacy/
|
|
84
|
+
packages-dir: dist
|
|
85
|
+
password: ${{ env.TEST_PYPI_API_TOKEN }}
|
|
86
|
+
verbose: true
|
|
87
|
+
- name: Publish package distributions to TestPyPI (Trusted Publisher)
|
|
88
|
+
if: env.TEST_PYPI_API_TOKEN == ''
|
|
89
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
90
|
+
with:
|
|
91
|
+
repository-url: https://test.pypi.org/legacy/
|
|
92
|
+
packages-dir: dist
|
|
93
|
+
verbose: true
|
|
94
|
+
|
|
95
|
+
publish-pypi:
|
|
96
|
+
name: Publish to PyPI
|
|
97
|
+
needs:
|
|
98
|
+
- build
|
|
99
|
+
- publish-testpypi
|
|
100
|
+
if: (github.event_name == 'push' && !contains(github.ref_name, '-rc')) || github.event.inputs.publish_target == 'pypi'
|
|
101
|
+
runs-on: ubuntu-latest
|
|
102
|
+
environment: pypi
|
|
103
|
+
env:
|
|
104
|
+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
105
|
+
permissions:
|
|
106
|
+
id-token: write
|
|
107
|
+
contents: read
|
|
108
|
+
steps:
|
|
109
|
+
- name: Download dist artifacts
|
|
110
|
+
uses: actions/download-artifact@v4
|
|
111
|
+
with:
|
|
112
|
+
name: standards-sdk-py-dist
|
|
113
|
+
path: dist
|
|
114
|
+
- name: Publish package distributions to PyPI (API token)
|
|
115
|
+
if: env.PYPI_API_TOKEN != ''
|
|
116
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
117
|
+
with:
|
|
118
|
+
packages-dir: dist
|
|
119
|
+
password: ${{ env.PYPI_API_TOKEN }}
|
|
120
|
+
verbose: true
|
|
121
|
+
- name: Publish package distributions to PyPI (Trusted Publisher)
|
|
122
|
+
if: env.PYPI_API_TOKEN == ''
|
|
123
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
124
|
+
with:
|
|
125
|
+
packages-dir: dist
|
|
126
|
+
verbose: true
|
|
127
|
+
|
|
128
|
+
attest:
|
|
129
|
+
name: Attest Build Provenance
|
|
130
|
+
needs: publish-pypi
|
|
131
|
+
runs-on: ubuntu-latest
|
|
132
|
+
permissions:
|
|
133
|
+
id-token: write
|
|
134
|
+
attestations: write
|
|
135
|
+
contents: read
|
|
136
|
+
steps:
|
|
137
|
+
- name: Download dist artifacts
|
|
138
|
+
uses: actions/download-artifact@v4
|
|
139
|
+
with:
|
|
140
|
+
name: standards-sdk-py-dist
|
|
141
|
+
path: dist
|
|
142
|
+
- name: Generate artifact attestations
|
|
143
|
+
uses: actions/attest-build-provenance@v2
|
|
144
|
+
with:
|
|
145
|
+
subject-path: "dist/*"
|
|
146
|
+
|
|
147
|
+
github-release:
|
|
148
|
+
name: GitHub Release
|
|
149
|
+
needs: publish-pypi
|
|
150
|
+
if: github.event_name == 'push'
|
|
151
|
+
runs-on: ubuntu-latest
|
|
152
|
+
permissions:
|
|
153
|
+
contents: write
|
|
154
|
+
steps:
|
|
155
|
+
- name: Create GitHub release
|
|
156
|
+
uses: softprops/action-gh-release@v2
|
|
157
|
+
with:
|
|
158
|
+
generate_release_notes: true
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: standards-sdk-py-security
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
- master
|
|
9
|
+
schedule:
|
|
10
|
+
- cron: "21 6 * * 1"
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
dependency-review:
|
|
18
|
+
if: github.event_name == 'pull_request'
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
permissions:
|
|
21
|
+
contents: read
|
|
22
|
+
pull-requests: read
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
- name: Dependency review
|
|
26
|
+
uses: actions/dependency-review-action@v4
|
|
27
|
+
with:
|
|
28
|
+
fail-on-severity: high
|
|
29
|
+
base-ref: ${{ github.event.pull_request.base.sha }}
|
|
30
|
+
head-ref: ${{ github.event.pull_request.head.sha }}
|
|
31
|
+
|
|
32
|
+
static-and-vuln-scans:
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
permissions:
|
|
35
|
+
contents: read
|
|
36
|
+
security-events: write
|
|
37
|
+
defaults:
|
|
38
|
+
run:
|
|
39
|
+
working-directory: .
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@v4
|
|
42
|
+
with:
|
|
43
|
+
fetch-depth: 0
|
|
44
|
+
- uses: actions/setup-python@v5
|
|
45
|
+
with:
|
|
46
|
+
python-version: "3.11"
|
|
47
|
+
cache: "pip"
|
|
48
|
+
cache-dependency-path: pyproject.toml
|
|
49
|
+
- name: Install dependencies
|
|
50
|
+
run: |
|
|
51
|
+
python -m pip install --upgrade pip
|
|
52
|
+
pip install -e ".[dev]"
|
|
53
|
+
- name: Run pip-audit
|
|
54
|
+
run: pip-audit --progress-spinner off --format json --output pip-audit.json
|
|
55
|
+
- name: Run Bandit SAST
|
|
56
|
+
run: bandit -q -r src -f sarif -o bandit.sarif
|
|
57
|
+
- name: Upload pip-audit report
|
|
58
|
+
uses: actions/upload-artifact@v4
|
|
59
|
+
with:
|
|
60
|
+
name: standards-sdk-py-pip-audit
|
|
61
|
+
path: pip-audit.json
|
|
62
|
+
if-no-files-found: error
|
|
63
|
+
- name: Upload Bandit SARIF
|
|
64
|
+
uses: github/codeql-action/upload-sarif@v3
|
|
65
|
+
with:
|
|
66
|
+
sarif_file: bandit.sarif
|
|
67
|
+
category: bandit
|
|
68
|
+
- name: Secret scan (TruffleHog)
|
|
69
|
+
continue-on-error: true
|
|
70
|
+
uses: trufflesecurity/trufflehog@main
|
|
71
|
+
with:
|
|
72
|
+
path: .
|
|
73
|
+
extra_args: --only-verified
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
dist/
|
|
13
|
+
downloads/
|
|
14
|
+
eggs/
|
|
15
|
+
.eggs/
|
|
16
|
+
lib/
|
|
17
|
+
lib64/
|
|
18
|
+
parts/
|
|
19
|
+
sdist/
|
|
20
|
+
share/python-wheels/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
pip-wheel-metadata/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
*.egg
|
|
26
|
+
MANIFEST
|
|
27
|
+
|
|
28
|
+
# Installer logs
|
|
29
|
+
pip-log.txt
|
|
30
|
+
pip-delete-this-directory.txt
|
|
31
|
+
|
|
32
|
+
# Unit test / coverage reports
|
|
33
|
+
.coverage
|
|
34
|
+
.coverage.*
|
|
35
|
+
coverage.xml
|
|
36
|
+
nosetests.xml
|
|
37
|
+
pytest.xml
|
|
38
|
+
htmlcov/
|
|
39
|
+
.pytest_cache/
|
|
40
|
+
|
|
41
|
+
# Type checker / linter caches
|
|
42
|
+
.mypy_cache/
|
|
43
|
+
.pyre/
|
|
44
|
+
.pytype/
|
|
45
|
+
.ruff_cache/
|
|
46
|
+
|
|
47
|
+
# Virtual environments
|
|
48
|
+
.venv/
|
|
49
|
+
venv/
|
|
50
|
+
env/
|
|
51
|
+
ENV/
|
|
52
|
+
|
|
53
|
+
# Local environment files
|
|
54
|
+
.env
|
|
55
|
+
.env.*
|
|
56
|
+
!.env.example
|
|
57
|
+
|
|
58
|
+
# Jupyter
|
|
59
|
+
.ipynb_checkpoints/
|
|
60
|
+
|
|
61
|
+
# IDEs / editors
|
|
62
|
+
.vscode/
|
|
63
|
+
.idea/
|
|
64
|
+
*.iml
|
|
65
|
+
|
|
66
|
+
# OS generated files
|
|
67
|
+
.DS_Store
|
|
68
|
+
Thumbs.db
|
|
69
|
+
|
|
70
|
+
# Docs / static site build artifacts
|
|
71
|
+
site/
|
|
72
|
+
docs/_build/
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v5.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: check-merge-conflict
|
|
6
|
+
- id: check-yaml
|
|
7
|
+
- id: check-toml
|
|
8
|
+
- id: end-of-file-fixer
|
|
9
|
+
- id: trailing-whitespace
|
|
10
|
+
- id: detect-private-key
|
|
11
|
+
|
|
12
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
13
|
+
rev: v0.8.6
|
|
14
|
+
hooks:
|
|
15
|
+
- id: ruff
|
|
16
|
+
args: [--fix]
|
|
17
|
+
- id: ruff-format
|
|
18
|
+
|
|
19
|
+
- repo: https://github.com/psf/black
|
|
20
|
+
rev: 24.10.0
|
|
21
|
+
hooks:
|
|
22
|
+
- id: black
|
|
23
|
+
language_version: python3.11
|
|
24
|
+
|
|
25
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
26
|
+
rev: v1.13.0
|
|
27
|
+
hooks:
|
|
28
|
+
- id: mypy
|
|
29
|
+
args: [--config-file=pyproject.toml]
|
|
30
|
+
additional_dependencies:
|
|
31
|
+
- httpx>=0.27.2,<1.0.0
|
|
32
|
+
- pydantic>=2.10.0,<3.0.0
|
|
33
|
+
- typing-extensions>=4.12.2,<5.0.0
|
|
34
|
+
files: ^src/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
Binary file
|