ai-sdk-m8 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.
- ai_sdk_m8-0.1.0/.codacy.yml +28 -0
- ai_sdk_m8-0.1.0/.gitattributes +1 -0
- ai_sdk_m8-0.1.0/.github/FUNDING.yml +13 -0
- ai_sdk_m8-0.1.0/.github/dependabot.yml +18 -0
- ai_sdk_m8-0.1.0/.github/workflows/CI.yaml +117 -0
- ai_sdk_m8-0.1.0/.github/workflows/PiPy.yml +79 -0
- ai_sdk_m8-0.1.0/.gitignore +218 -0
- ai_sdk_m8-0.1.0/.gitleaks.toml +15 -0
- ai_sdk_m8-0.1.0/.markdownlint.yaml +33 -0
- ai_sdk_m8-0.1.0/AGENTS.md +7 -0
- ai_sdk_m8-0.1.0/CHANGELOG.md +15 -0
- ai_sdk_m8-0.1.0/CLAUDE.md +7 -0
- ai_sdk_m8-0.1.0/LICENSE +21 -0
- ai_sdk_m8-0.1.0/PKG-INFO +86 -0
- ai_sdk_m8-0.1.0/README.md +34 -0
- ai_sdk_m8-0.1.0/REPOSITORY_CONTEXT.md +37 -0
- ai_sdk_m8-0.1.0/SECURITY.md +23 -0
- ai_sdk_m8-0.1.0/ai_sdk_m8/__init__.py +5 -0
- ai_sdk_m8-0.1.0/ai_sdk_m8/py.typed +0 -0
- ai_sdk_m8-0.1.0/pyproject.toml +66 -0
- ai_sdk_m8-0.1.0/tests/test_ci_policy.py +92 -0
- ai_sdk_m8-0.1.0/tests/test_package.py +36 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
engines:
|
|
3
|
+
bandit:
|
|
4
|
+
enabled: true
|
|
5
|
+
ruff:
|
|
6
|
+
enabled: true
|
|
7
|
+
markdownlint:
|
|
8
|
+
enabled: true
|
|
9
|
+
pylint:
|
|
10
|
+
enabled: false
|
|
11
|
+
prospector:
|
|
12
|
+
enabled: false
|
|
13
|
+
pydocstyle:
|
|
14
|
+
enabled: false
|
|
15
|
+
pycodestyle:
|
|
16
|
+
enabled: false
|
|
17
|
+
pyflakes:
|
|
18
|
+
enabled: false
|
|
19
|
+
|
|
20
|
+
exclude_paths:
|
|
21
|
+
- "tests/**"
|
|
22
|
+
- "dist/**"
|
|
23
|
+
- "*.egg-info/**"
|
|
24
|
+
- ".pytest_cache/**"
|
|
25
|
+
- "**/__pycache__/**"
|
|
26
|
+
- "AGENTS.md"
|
|
27
|
+
- "CLAUDE.md"
|
|
28
|
+
- "REPOSITORY_CONTEXT.md"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* text=auto eol=lf
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# These are supported funding model platforms
|
|
2
|
+
|
|
3
|
+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
|
4
|
+
patreon: # Replace with a single Patreon username
|
|
5
|
+
open_collective: # Replace with a single Open Collective username
|
|
6
|
+
ko_fi: eliserra
|
|
7
|
+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
|
8
|
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
9
|
+
liberapay: # Replace with a single Liberapay username
|
|
10
|
+
issuehunt: # Replace with a single IssueHunt username
|
|
11
|
+
otechie: # Replace with a single Otechie username
|
|
12
|
+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
|
13
|
+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
|
|
3
|
+
updates:
|
|
4
|
+
# GitHub Actions — keep workflow action SHAs current
|
|
5
|
+
- package-ecosystem: "github-actions"
|
|
6
|
+
directory: "/"
|
|
7
|
+
schedule:
|
|
8
|
+
interval: "monthly"
|
|
9
|
+
commit-message:
|
|
10
|
+
prefix: "ci"
|
|
11
|
+
|
|
12
|
+
# Python — track package dependencies
|
|
13
|
+
- package-ecosystem: "pip"
|
|
14
|
+
directory: "/"
|
|
15
|
+
schedule:
|
|
16
|
+
interval: "monthly"
|
|
17
|
+
commit-message:
|
|
18
|
+
prefix: "deps"
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["main"]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: ["main"]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
lint:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
20
|
+
|
|
21
|
+
- name: Set up Python
|
|
22
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
23
|
+
with:
|
|
24
|
+
python-version: "3.14"
|
|
25
|
+
cache: "pip"
|
|
26
|
+
|
|
27
|
+
- name: Install dev dependencies
|
|
28
|
+
run: pip install -e ".[dev]"
|
|
29
|
+
|
|
30
|
+
- name: Check formatting
|
|
31
|
+
run: ruff format --check .
|
|
32
|
+
|
|
33
|
+
- name: Lint
|
|
34
|
+
run: ruff check .
|
|
35
|
+
|
|
36
|
+
typecheck:
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
40
|
+
|
|
41
|
+
- name: Set up Python
|
|
42
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
43
|
+
with:
|
|
44
|
+
python-version: "3.14"
|
|
45
|
+
cache: "pip"
|
|
46
|
+
|
|
47
|
+
- name: Install dependencies
|
|
48
|
+
run: pip install -e ".[dev]"
|
|
49
|
+
|
|
50
|
+
- name: Type check
|
|
51
|
+
run: mypy ai_sdk_m8
|
|
52
|
+
|
|
53
|
+
security:
|
|
54
|
+
runs-on: ubuntu-latest
|
|
55
|
+
steps:
|
|
56
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
57
|
+
|
|
58
|
+
- name: Set up Python
|
|
59
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
60
|
+
with:
|
|
61
|
+
python-version: "3.14"
|
|
62
|
+
|
|
63
|
+
- name: Install bandit
|
|
64
|
+
run: pip install bandit
|
|
65
|
+
|
|
66
|
+
- name: Run bandit (grade A — no MEDIUM/HIGH issues)
|
|
67
|
+
run: bandit -r ai_sdk_m8 --severity-level medium -f json -o bandit-report.json
|
|
68
|
+
|
|
69
|
+
- name: Audit dependencies
|
|
70
|
+
run: |
|
|
71
|
+
pip install pip-audit
|
|
72
|
+
pip install -e .
|
|
73
|
+
pip-audit
|
|
74
|
+
|
|
75
|
+
- name: Upload bandit report
|
|
76
|
+
if: always()
|
|
77
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
78
|
+
with:
|
|
79
|
+
name: bandit-security-report
|
|
80
|
+
path: bandit-report.json
|
|
81
|
+
|
|
82
|
+
test:
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
strategy:
|
|
85
|
+
fail-fast: false
|
|
86
|
+
matrix:
|
|
87
|
+
python-version: ["3.12", "3.13", "3.14"]
|
|
88
|
+
|
|
89
|
+
steps:
|
|
90
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
91
|
+
|
|
92
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
93
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
94
|
+
with:
|
|
95
|
+
python-version: ${{ matrix.python-version }}
|
|
96
|
+
cache: "pip"
|
|
97
|
+
|
|
98
|
+
- name: Install dependencies
|
|
99
|
+
run: pip install -e ".[dev]"
|
|
100
|
+
|
|
101
|
+
- name: Run tests
|
|
102
|
+
run: pytest --cov-fail-under=100
|
|
103
|
+
|
|
104
|
+
- name: Upload coverage to Codecov
|
|
105
|
+
if: matrix.python-version == '3.12' && github.actor != 'dependabot[bot]'
|
|
106
|
+
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
|
|
107
|
+
with:
|
|
108
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
109
|
+
files: coverage.xml
|
|
110
|
+
verbose: true
|
|
111
|
+
|
|
112
|
+
- name: Upload coverage to Codacy
|
|
113
|
+
if: matrix.python-version == '3.12' && github.actor != 'dependabot[bot]'
|
|
114
|
+
uses: codacy/codacy-coverage-reporter-action@89d6c85cfafaec52c72b6c5e8b2878d33104c699 # v1
|
|
115
|
+
with:
|
|
116
|
+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
|
117
|
+
coverage-reports: coverage.xml
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: Upload Python Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
release-build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
16
|
+
|
|
17
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
18
|
+
with:
|
|
19
|
+
python-version: "3.x"
|
|
20
|
+
|
|
21
|
+
- name: Build release distributions
|
|
22
|
+
run: |
|
|
23
|
+
python -m pip install build
|
|
24
|
+
python -m build
|
|
25
|
+
|
|
26
|
+
- name: Upload distributions
|
|
27
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
28
|
+
with:
|
|
29
|
+
name: release-dists
|
|
30
|
+
path: dist/
|
|
31
|
+
|
|
32
|
+
pypi-publish:
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
needs:
|
|
35
|
+
- release-build
|
|
36
|
+
permissions:
|
|
37
|
+
# IMPORTANT: this permission is mandatory for trusted publishing
|
|
38
|
+
id-token: write
|
|
39
|
+
|
|
40
|
+
# Dedicated environments with protections for publishing are strongly recommended.
|
|
41
|
+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
|
|
42
|
+
environment:
|
|
43
|
+
name: pypi
|
|
44
|
+
url: https://pypi.org/project/ai-sdk-m8/${{ github.event.release.name }}
|
|
45
|
+
|
|
46
|
+
steps:
|
|
47
|
+
- name: Retrieve release distributions
|
|
48
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
49
|
+
with:
|
|
50
|
+
name: release-dists
|
|
51
|
+
path: dist/
|
|
52
|
+
|
|
53
|
+
- name: Publish release distributions to PyPI
|
|
54
|
+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
|
|
55
|
+
|
|
56
|
+
sbom:
|
|
57
|
+
name: Generate & attach SBOM
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
needs:
|
|
60
|
+
- release-build
|
|
61
|
+
permissions:
|
|
62
|
+
contents: write
|
|
63
|
+
id-token: write
|
|
64
|
+
|
|
65
|
+
steps:
|
|
66
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
67
|
+
|
|
68
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
69
|
+
with:
|
|
70
|
+
python-version: "3.x"
|
|
71
|
+
|
|
72
|
+
- name: Install package
|
|
73
|
+
run: pip install -e ".[jobcontext]"
|
|
74
|
+
|
|
75
|
+
- uses: anchore/sbom-action@66cbf4bc1f1c0d2edc94016e65bc221b6bb0ad6c # v0.24.3
|
|
76
|
+
with:
|
|
77
|
+
artifact-name: ai-sdk-m8-${{ github.event.release.tag_name }}.sbom.spdx.json
|
|
78
|
+
format: spdx-json
|
|
79
|
+
upload-release-assets: true
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
# Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
# poetry.lock
|
|
109
|
+
# poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
# pdm.lock
|
|
116
|
+
# pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
# pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# Redis
|
|
135
|
+
*.rdb
|
|
136
|
+
*.aof
|
|
137
|
+
*.pid
|
|
138
|
+
|
|
139
|
+
# RabbitMQ
|
|
140
|
+
mnesia/
|
|
141
|
+
rabbitmq/
|
|
142
|
+
rabbitmq-data/
|
|
143
|
+
|
|
144
|
+
# ActiveMQ
|
|
145
|
+
activemq-data/
|
|
146
|
+
|
|
147
|
+
# SageMath parsed files
|
|
148
|
+
*.sage.py
|
|
149
|
+
|
|
150
|
+
# Environments
|
|
151
|
+
.env
|
|
152
|
+
.envrc
|
|
153
|
+
.venv
|
|
154
|
+
env/
|
|
155
|
+
venv/
|
|
156
|
+
ENV/
|
|
157
|
+
env.bak/
|
|
158
|
+
venv.bak/
|
|
159
|
+
|
|
160
|
+
# Spyder project settings
|
|
161
|
+
.spyderproject
|
|
162
|
+
.spyproject
|
|
163
|
+
|
|
164
|
+
# Rope project settings
|
|
165
|
+
.ropeproject
|
|
166
|
+
|
|
167
|
+
# mkdocs documentation
|
|
168
|
+
/site
|
|
169
|
+
|
|
170
|
+
# mypy
|
|
171
|
+
.mypy_cache/
|
|
172
|
+
.dmypy.json
|
|
173
|
+
dmypy.json
|
|
174
|
+
|
|
175
|
+
# Pyre type checker
|
|
176
|
+
.pyre/
|
|
177
|
+
|
|
178
|
+
# pytype static type analyzer
|
|
179
|
+
.pytype/
|
|
180
|
+
|
|
181
|
+
# Cython debug symbols
|
|
182
|
+
cython_debug/
|
|
183
|
+
|
|
184
|
+
# PyCharm
|
|
185
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
186
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
188
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
189
|
+
# .idea/
|
|
190
|
+
|
|
191
|
+
# Abstra
|
|
192
|
+
# Abstra is an AI-powered process automation framework.
|
|
193
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
194
|
+
# Learn more at https://abstra.io/docs
|
|
195
|
+
.abstra/
|
|
196
|
+
|
|
197
|
+
# Visual Studio Code
|
|
198
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
199
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
200
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
201
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
202
|
+
# .vscode/
|
|
203
|
+
# Temporary file for partial code execution
|
|
204
|
+
tempCodeRunnerFile.py
|
|
205
|
+
|
|
206
|
+
# Ruff stuff:
|
|
207
|
+
.ruff_cache/
|
|
208
|
+
|
|
209
|
+
# PyPI configuration file
|
|
210
|
+
.pypirc
|
|
211
|
+
|
|
212
|
+
# Marimo
|
|
213
|
+
marimo/_static/
|
|
214
|
+
marimo/_lsp/
|
|
215
|
+
__marimo__/
|
|
216
|
+
|
|
217
|
+
# Streamlit
|
|
218
|
+
.streamlit/secrets.toml
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
title = "ai-sdk-m8 gitleaks config"
|
|
2
|
+
|
|
3
|
+
[extend]
|
|
4
|
+
useDefault = true
|
|
5
|
+
|
|
6
|
+
[allowlist]
|
|
7
|
+
description = "Project-wide allowlist"
|
|
8
|
+
paths = [
|
|
9
|
+
# Test fixtures may contain deterministic low-entropy test values
|
|
10
|
+
'''tests/''',
|
|
11
|
+
]
|
|
12
|
+
# Add SHAs of any prior accidental secret commits here after rotation:
|
|
13
|
+
# commits = [
|
|
14
|
+
# "abc123def456", # description of what was rotated and when
|
|
15
|
+
# ]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
# markdownlint configuration, also consumed by Codacy's markdownlint engine when
|
|
3
|
+
# the repository is set to use its own configuration files.
|
|
4
|
+
#
|
|
5
|
+
# Scope note: a config file supplies markdownlint's *defaults* for every rule it
|
|
6
|
+
# does not mention, so this file deliberately restates the rule this repository
|
|
7
|
+
# already does not enforce (MD013).
|
|
8
|
+
#
|
|
9
|
+
# Fleet baseline (A34): every repo with a CHANGELOG.md carries this MD024
|
|
10
|
+
# override, worded identically, so Codacy's markdownlint engine does not fail
|
|
11
|
+
# on the Keep a Changelog format. See fastapi-m8's `.markdownlint.yaml` for the
|
|
12
|
+
# canonical rationale text this is copied from.
|
|
13
|
+
|
|
14
|
+
# MD024/no-duplicate-heading — restrict to sibling headings.
|
|
15
|
+
#
|
|
16
|
+
# CHANGELOG.md follows Keep a Changelog, where every release section repeats the
|
|
17
|
+
# same subsection names (### Added / ### Changed / ### Fixed …). Under the
|
|
18
|
+
# default setting that makes each release after the first a stack of
|
|
19
|
+
# duplicate-heading errors, purely as a function of how many releases the file
|
|
20
|
+
# records. The duplication is the format, not a defect, and renaming the
|
|
21
|
+
# sections to be unique would break the convention every reader relies on.
|
|
22
|
+
#
|
|
23
|
+
# siblings_only flags a duplicate only when it shares a parent heading, so
|
|
24
|
+
# "### Added" under two different `## [x.y.z]` releases both pass, while two
|
|
25
|
+
# "### Added" blocks inside one release — a real editing mistake — still fail.
|
|
26
|
+
MD024:
|
|
27
|
+
siblings_only: true
|
|
28
|
+
|
|
29
|
+
# MD013/line-length — off (A34, 2026-08-15: was previously omitted from this
|
|
30
|
+
# file, leaving README.md's 5 over-80-column lines failing Codacy). README.md
|
|
31
|
+
# wraps prose for readability rather than to a fixed column. Python line length
|
|
32
|
+
# is enforced separately, by ruff.
|
|
33
|
+
MD013: false
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project adheres
|
|
5
|
+
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [0.1.0] - 2026-10-18
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Repository scaffold: hatchling packaging, empty `ai_sdk_m8` package with
|
|
12
|
+
`__version__`, ruff / mypy strict / bandit / pip-audit / pytest (100%
|
|
13
|
+
coverage) CI, PyPI Trusted Publishing release workflow with an SPDX SBOM
|
|
14
|
+
attached to the GitHub Release, Dependabot, Codacy and gitleaks
|
|
15
|
+
configuration.
|
ai_sdk_m8-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Eli Serra
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
ai_sdk_m8-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: ai-sdk-m8
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Typed client SDK for the m8 AI gateway and the Ed25519 signed-object / job-context primitive.
|
|
5
|
+
Author-email: Eli Serra <e.serra173@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Eli Serra
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Keywords: ai,ed25519,gateway,job-context,microservices,sdk
|
|
29
|
+
Classifier: Development Status :: 3 - Alpha
|
|
30
|
+
Classifier: Intended Audience :: Developers
|
|
31
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
32
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
35
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
36
|
+
Classifier: Typing :: Typed
|
|
37
|
+
Requires-Python: >=3.12
|
|
38
|
+
Requires-Dist: httpx>=0.28
|
|
39
|
+
Requires-Dist: pydantic>=2
|
|
40
|
+
Provides-Extra: dev
|
|
41
|
+
Requires-Dist: bandit>=1.8.0; extra == 'dev'
|
|
42
|
+
Requires-Dist: coverage>=7.0; extra == 'dev'
|
|
43
|
+
Requires-Dist: mypy>=1.14.0; extra == 'dev'
|
|
44
|
+
Requires-Dist: pytest-cov>=6.0; extra == 'dev'
|
|
45
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
46
|
+
Requires-Dist: pyyaml>=6.0; extra == 'dev'
|
|
47
|
+
Requires-Dist: ruff>=0.9.0; extra == 'dev'
|
|
48
|
+
Requires-Dist: types-pyyaml; extra == 'dev'
|
|
49
|
+
Provides-Extra: jobcontext
|
|
50
|
+
Requires-Dist: cryptography>=44; extra == 'jobcontext'
|
|
51
|
+
Description-Content-Type: text/markdown
|
|
52
|
+
|
|
53
|
+
# ai-sdk-m8
|
|
54
|
+
|
|
55
|
+
Typed client SDK for the m8 AI gateway (`ai-gateway-m8`) and the single
|
|
56
|
+
implementation of the Ed25519 signed-object rule with its job-context
|
|
57
|
+
primitive.
|
|
58
|
+
|
|
59
|
+
> Status: scaffold. The package imports and exposes `__version__` only; the
|
|
60
|
+
> client and job-context API land in later releases.
|
|
61
|
+
|
|
62
|
+
## Install
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install ai-sdk-m8
|
|
66
|
+
# signing and verification of job contexts
|
|
67
|
+
pip install "ai-sdk-m8[jobcontext]"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Core dependencies are limited to Pydantic v2 and `httpx`; `cryptography` is
|
|
71
|
+
only installed with the `jobcontext` extra. The SDK holds no provider
|
|
72
|
+
credentials and reads no environment variables.
|
|
73
|
+
|
|
74
|
+
## Development
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
pip install -e ".[dev,jobcontext]"
|
|
78
|
+
ruff format --check . && ruff check .
|
|
79
|
+
mypy ai_sdk_m8
|
|
80
|
+
bandit -r ai_sdk_m8 --severity-level medium
|
|
81
|
+
pytest --cov-fail-under=100
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# ai-sdk-m8
|
|
2
|
+
|
|
3
|
+
Typed client SDK for the m8 AI gateway (`ai-gateway-m8`) and the single
|
|
4
|
+
implementation of the Ed25519 signed-object rule with its job-context
|
|
5
|
+
primitive.
|
|
6
|
+
|
|
7
|
+
> Status: scaffold. The package imports and exposes `__version__` only; the
|
|
8
|
+
> client and job-context API land in later releases.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install ai-sdk-m8
|
|
14
|
+
# signing and verification of job contexts
|
|
15
|
+
pip install "ai-sdk-m8[jobcontext]"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Core dependencies are limited to Pydantic v2 and `httpx`; `cryptography` is
|
|
19
|
+
only installed with the `jobcontext` extra. The SDK holds no provider
|
|
20
|
+
credentials and reads no environment variables.
|
|
21
|
+
|
|
22
|
+
## Development
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install -e ".[dev,jobcontext]"
|
|
26
|
+
ruff format --check . && ruff check .
|
|
27
|
+
mypy ai_sdk_m8
|
|
28
|
+
bandit -r ai_sdk_m8 --severity-level medium
|
|
29
|
+
pytest --cov-fail-under=100
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## License
|
|
33
|
+
|
|
34
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# ai-sdk-m8
|
|
2
|
+
|
|
3
|
+
## Layer
|
|
4
|
+
|
|
5
|
+
Platform (AI SDK).
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Provide the small typed client SDK for the AI gateway (`ai-gateway-m8`) and
|
|
10
|
+
the one implementation of the Ed25519 signed-object rule with its job-context
|
|
11
|
+
primitive. Services and document tools that call the gateway, or that sign or
|
|
12
|
+
verify job contexts, depend on this package instead of re-implementing either.
|
|
13
|
+
|
|
14
|
+
The package is published to PyPI as `ai-sdk-m8` and imported as `ai_sdk_m8`.
|
|
15
|
+
|
|
16
|
+
## Repository boundaries
|
|
17
|
+
|
|
18
|
+
- Core dependencies are limited to Pydantic v2 and `httpx`. Signing and
|
|
19
|
+
verification live behind the `jobcontext` extra, which adds `cryptography`.
|
|
20
|
+
- This is the only implementation of the signed-object rule. Consumers call
|
|
21
|
+
it; they do not carry their own copy.
|
|
22
|
+
- Do not add Vault, SQLAlchemy, provider SDKs, or `auth-sdk-m8` dependencies.
|
|
23
|
+
- The SDK holds no provider credentials and reads no settings or environment
|
|
24
|
+
variables; callers pass explicit configuration.
|
|
25
|
+
- CI, tests, and documentation work from a lone clone: no sibling checkout,
|
|
26
|
+
workspace path, or parent-only tool is referenced.
|
|
27
|
+
|
|
28
|
+
These are repository architecture constraints. If a requested change appears to
|
|
29
|
+
break one, record the decision in the workspace context when that optional
|
|
30
|
+
enhancement is available and confirm the exception before proceeding.
|
|
31
|
+
|
|
32
|
+
## Standalone authority
|
|
33
|
+
|
|
34
|
+
This file, `pyproject.toml`, repository documentation, and existing CI are the
|
|
35
|
+
authoritative local context. A verified nearest workspace may optionally add
|
|
36
|
+
launcher-selected policies and tasks; its absence is a successful standalone
|
|
37
|
+
condition and does not make a parent workspace necessary.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
`ai-sdk-m8` is a client SDK and signing primitive. It holds no provider
|
|
4
|
+
credentials, reads no settings or environment variables, and makes no
|
|
5
|
+
decision on behalf of the gateway: provider and data-class policy is enforced
|
|
6
|
+
by `ai-gateway-m8`.
|
|
7
|
+
|
|
8
|
+
## Supply chain
|
|
9
|
+
|
|
10
|
+
- Releases are published to PyPI only through Trusted Publishing (OIDC); no
|
|
11
|
+
upload token is stored anywhere.
|
|
12
|
+
- Every release attaches a Software Package Data Exchange (SPDX) JSON software
|
|
13
|
+
bill of materials (SBOM) to its GitHub Release.
|
|
14
|
+
- CI actions are pinned by full Secure Hash Algorithm (SHA) commit hash and
|
|
15
|
+
run with read-only default permissions.
|
|
16
|
+
- `pip-audit` and `bandit` run on every pull request.
|
|
17
|
+
|
|
18
|
+
## Reporting a vulnerability
|
|
19
|
+
|
|
20
|
+
Report security vulnerabilities privately through GitHub's **Security** tab on
|
|
21
|
+
this repository — **"Report a vulnerability"** — which opens a private
|
|
22
|
+
security advisory visible only to the maintainers. Do not open a public GitHub
|
|
23
|
+
issue for vulnerabilities. Expected response within 48 h.
|
|
File without changes
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ai-sdk-m8"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Typed client SDK for the m8 AI gateway and the Ed25519 signed-object / job-context primitive."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { file = "LICENSE" }
|
|
11
|
+
authors = [{ name = "Eli Serra", email = "e.serra173@gmail.com" }]
|
|
12
|
+
requires-python = ">=3.12"
|
|
13
|
+
keywords = ["ai", "gateway", "sdk", "ed25519", "job-context", "microservices"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
"Programming Language :: Python :: 3.13",
|
|
20
|
+
"Programming Language :: Python :: 3.14",
|
|
21
|
+
"Topic :: Software Development :: Libraries",
|
|
22
|
+
"Typing :: Typed",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
dependencies = [
|
|
26
|
+
"pydantic>=2",
|
|
27
|
+
"httpx>=0.28",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.optional-dependencies]
|
|
31
|
+
# Signing and verification of signed objects / job contexts.
|
|
32
|
+
jobcontext = ["cryptography>=44"]
|
|
33
|
+
dev = ["pytest>=8.0", "ruff>=0.9.0", "mypy>=1.14.0", "bandit>=1.8.0",
|
|
34
|
+
"coverage>=7.0", "pytest-cov>=6.0", "pyyaml>=6.0", "types-PyYAML"]
|
|
35
|
+
|
|
36
|
+
[tool.hatch.build.targets.wheel]
|
|
37
|
+
packages = ["ai_sdk_m8"]
|
|
38
|
+
|
|
39
|
+
[tool.ruff]
|
|
40
|
+
line-length = 88
|
|
41
|
+
|
|
42
|
+
[tool.ruff.lint]
|
|
43
|
+
select = ["E", "F", "I", "W", "UP", "C90", "D"]
|
|
44
|
+
ignore = [
|
|
45
|
+
"E501",
|
|
46
|
+
"D100", "D104", "D105", "D107",
|
|
47
|
+
"D203", "D211", "D212", "D215",
|
|
48
|
+
"D301", "D401", "D403", "D404", "D415", "D416", "D417",
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
[tool.ruff.lint.mccabe]
|
|
52
|
+
max-complexity = 10
|
|
53
|
+
|
|
54
|
+
[tool.ruff.lint.per-file-ignores]
|
|
55
|
+
"tests/**" = ["D"]
|
|
56
|
+
|
|
57
|
+
[tool.ruff.lint.isort]
|
|
58
|
+
known-first-party = ["ai_sdk_m8"]
|
|
59
|
+
|
|
60
|
+
[tool.mypy]
|
|
61
|
+
python_version = "3.12"
|
|
62
|
+
strict = true
|
|
63
|
+
|
|
64
|
+
[tool.pytest.ini_options]
|
|
65
|
+
testpaths = ["tests"]
|
|
66
|
+
addopts = "--cov=ai_sdk_m8 --cov-report=xml --cov-report=term-missing"
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"""CI, release-workflow and static template policy checks."""
|
|
2
|
+
|
|
3
|
+
import re
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
import yaml
|
|
8
|
+
|
|
9
|
+
ROOT = Path(__file__).resolve().parents[1]
|
|
10
|
+
WORKFLOWS = ROOT / ".github" / "workflows"
|
|
11
|
+
PIPY = WORKFLOWS / "PiPy.yml"
|
|
12
|
+
_USES = re.compile(r"uses:\s+([\w.-]+/[\w.-]+)@(\S+)")
|
|
13
|
+
_SHA = re.compile(r"^[0-9a-f]{40}$")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _load(path: Path) -> dict[str, Any]:
|
|
17
|
+
data: dict[str, Any] = yaml.safe_load(path.read_text(encoding="utf-8"))
|
|
18
|
+
return data
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def test_every_action_is_pinned_by_full_sha() -> None:
|
|
22
|
+
"""Third-party actions are pinned to a 40-hex commit SHA."""
|
|
23
|
+
refs = [m for p in WORKFLOWS.glob("*") for m in _USES.findall(p.read_text())]
|
|
24
|
+
assert refs
|
|
25
|
+
assert all(_SHA.match(ref) for _, ref in refs)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def test_workflows_default_to_read_only_permissions() -> None:
|
|
29
|
+
"""Every workflow declares workflow-level ``contents: read``."""
|
|
30
|
+
for path in WORKFLOWS.glob("*"):
|
|
31
|
+
assert _load(path)["permissions"] == {"contents": "read"}, path.name
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_release_workflow_has_no_pypi_token() -> None:
|
|
35
|
+
"""Trusted Publishing only: no token input anywhere."""
|
|
36
|
+
text = PIPY.read_text(encoding="utf-8")
|
|
37
|
+
assert "PYPI_API_TOKEN" not in text
|
|
38
|
+
assert "password:" not in text
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def test_release_publish_job_uses_oidc_and_environment() -> None:
|
|
42
|
+
"""Only the publish job gets ``id-token: write`` and a named environment."""
|
|
43
|
+
jobs = _load(PIPY)["jobs"]
|
|
44
|
+
assert jobs["pypi-publish"]["permissions"]["id-token"] == "write"
|
|
45
|
+
assert jobs["pypi-publish"]["environment"]["name"] == "pypi"
|
|
46
|
+
assert "id-token" not in jobs["release-build"].get("permissions", {})
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def test_release_workflow_triggers_on_published_release_only() -> None:
|
|
50
|
+
"""The release workflow runs on ``release: published`` and nothing else."""
|
|
51
|
+
wf: dict[Any, Any] = _load(PIPY)
|
|
52
|
+
triggers = wf.get("on") or wf.get(True)
|
|
53
|
+
assert triggers == {"release": {"types": ["published"]}}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def test_release_workflow_attaches_spdx_sbom() -> None:
|
|
57
|
+
"""An SPDX JSON SBOM is attached to the release."""
|
|
58
|
+
text = PIPY.read_text(encoding="utf-8")
|
|
59
|
+
assert "anchore/sbom-action" in text
|
|
60
|
+
assert "format: spdx-json" in text
|
|
61
|
+
assert "upload-release-assets: true" in text
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def test_markdownlint_keeps_md024_siblings_only() -> None:
|
|
65
|
+
"""The fleet MD024 override is present."""
|
|
66
|
+
cfg = _load(ROOT / ".markdownlint.yaml")
|
|
67
|
+
assert cfg["MD024"] == {"siblings_only": True}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def test_tracked_text_files_follow_template_rules() -> None:
|
|
71
|
+
"""UTF-8 without BOM, LF, final newline, no workspace paths."""
|
|
72
|
+
paths = [
|
|
73
|
+
*ROOT.glob("*.md"),
|
|
74
|
+
*ROOT.glob("*.toml"),
|
|
75
|
+
*ROOT.glob("*.yml"),
|
|
76
|
+
*ROOT.glob("*.yaml"),
|
|
77
|
+
*WORKFLOWS.glob("*"),
|
|
78
|
+
*(ROOT / ".github").glob("*.yml"),
|
|
79
|
+
*ROOT.glob(".*.yml"),
|
|
80
|
+
*ROOT.glob(".*.yaml"),
|
|
81
|
+
*ROOT.glob(".*.toml"),
|
|
82
|
+
]
|
|
83
|
+
forbidden = ("/workspace", "fa-workspace", "E:\\Dev", ".workspace/")
|
|
84
|
+
for path in paths:
|
|
85
|
+
raw = path.read_bytes()
|
|
86
|
+
assert not raw.startswith(b"\xef\xbb\xbf"), path
|
|
87
|
+
assert b"\r" not in raw, path
|
|
88
|
+
assert raw.endswith(b"\n"), path
|
|
89
|
+
text = raw.decode("utf-8")
|
|
90
|
+
if path.name in {"AGENTS.md", "CLAUDE.md", "REPOSITORY_CONTEXT.md"}:
|
|
91
|
+
continue
|
|
92
|
+
assert not any(f in text for f in forbidden), path
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"""Package import and version parity checks."""
|
|
2
|
+
|
|
3
|
+
import re
|
|
4
|
+
import tomllib
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
import ai_sdk_m8
|
|
8
|
+
|
|
9
|
+
ROOT = Path(__file__).resolve().parents[1]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_package_imports_and_exposes_version() -> None:
|
|
13
|
+
"""The empty package imports and exports only ``__version__``."""
|
|
14
|
+
assert ai_sdk_m8.__all__ == ["__version__"]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def test_version_matches_pyproject() -> None:
|
|
18
|
+
"""``__version__`` equals the pyproject literal."""
|
|
19
|
+
data = tomllib.loads((ROOT / "pyproject.toml").read_text(encoding="utf-8"))
|
|
20
|
+
assert data["project"]["version"] == ai_sdk_m8.__version__
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def test_changelog_has_current_version_heading() -> None:
|
|
24
|
+
"""CHANGELOG.md carries a Keep a Changelog heading for the version."""
|
|
25
|
+
text = (ROOT / "CHANGELOG.md").read_text(encoding="utf-8")
|
|
26
|
+
pattern = rf"^## \[{re.escape(ai_sdk_m8.__version__)}\] - \d{{4}}-\d{{2}}-\d{{2}}$"
|
|
27
|
+
assert re.search(pattern, text, re.MULTILINE)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def test_core_dependencies_are_bounded() -> None:
|
|
31
|
+
"""Core deps stay pydantic + httpx; cryptography only behind the extra."""
|
|
32
|
+
data = tomllib.loads((ROOT / "pyproject.toml").read_text(encoding="utf-8"))
|
|
33
|
+
names = {re.split(r"[<>=!~ ]", d)[0] for d in data["project"]["dependencies"]}
|
|
34
|
+
assert names == {"pydantic", "httpx"}
|
|
35
|
+
extra = data["project"]["optional-dependencies"]["jobcontext"]
|
|
36
|
+
assert [re.split(r"[<>=!~ ]", d)[0] for d in extra] == ["cryptography"]
|