lite-runner 0.1.1__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.
- lite_runner-0.1.1/.copier-answers.yml +19 -0
- lite_runner-0.1.1/.editorconfig +30 -0
- lite_runner-0.1.1/.git_archival.txt +3 -0
- lite_runner-0.1.1/.gitattributes +1 -0
- lite_runner-0.1.1/.github/dependabot.yml +9 -0
- lite_runner-0.1.1/.github/release.yml +5 -0
- lite_runner-0.1.1/.github/workflows/build-and-publish.yml +78 -0
- lite_runner-0.1.1/.github/workflows/ci.yml +230 -0
- lite_runner-0.1.1/.github/workflows/deps-update.yml +54 -0
- lite_runner-0.1.1/.github/workflows/weekly-ci.yml +160 -0
- lite_runner-0.1.1/.gitignore +71 -0
- lite_runner-0.1.1/.pre-commit-config.yaml +215 -0
- lite_runner-0.1.1/.python-version +1 -0
- lite_runner-0.1.1/.yamllint.yaml +5 -0
- lite_runner-0.1.1/CHANGELOG.md +12 -0
- lite_runner-0.1.1/CLAUDE.md +72 -0
- lite_runner-0.1.1/CONTRIBUTING.md +71 -0
- lite_runner-0.1.1/LICENSE +21 -0
- lite_runner-0.1.1/PKG-INFO +281 -0
- lite_runner-0.1.1/README.md +249 -0
- lite_runner-0.1.1/docs/index.md +3 -0
- lite_runner-0.1.1/examples/fake_input.jpg +0 -0
- lite_runner-0.1.1/examples/fake_model.py +62 -0
- lite_runner-0.1.1/examples/run_example.py +45 -0
- lite_runner-0.1.1/examples/run_ltx2.py +80 -0
- lite_runner-0.1.1/examples/run_sweep.py +32 -0
- lite_runner-0.1.1/justfile +160 -0
- lite_runner-0.1.1/mkdocs.yml +33 -0
- lite_runner-0.1.1/pyproject.toml +281 -0
- lite_runner-0.1.1/scripts/gen_ref_pages.py +35 -0
- lite_runner-0.1.1/src/lite_runner/__init__.py +27 -0
- lite_runner-0.1.1/src/lite_runner/_version.py +34 -0
- lite_runner-0.1.1/src/lite_runner/_version.pyi +2 -0
- lite_runner-0.1.1/src/lite_runner/backends.py +619 -0
- lite_runner-0.1.1/src/lite_runner/params.py +317 -0
- lite_runner-0.1.1/src/lite_runner/py.typed +0 -0
- lite_runner-0.1.1/src/lite_runner/runner.py +912 -0
- lite_runner-0.1.1/tests/conftest.py +46 -0
- lite_runner-0.1.1/tests/test_.py +7 -0
- lite_runner-0.1.1/tests/test_backends.py +638 -0
- lite_runner-0.1.1/tests/test_params.py +384 -0
- lite_runner-0.1.1/tests/test_runner.py +1429 -0
- lite_runner-0.1.1/uv.lock +1810 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
|
|
2
|
+
_commit: v0.26.2
|
|
3
|
+
_src_path: https://github.com/tsvikas/python-template
|
|
4
|
+
cli_framework: none
|
|
5
|
+
format_tool: ruff
|
|
6
|
+
get_package_version_from_vcs: true
|
|
7
|
+
github_user: moonmath-ai
|
|
8
|
+
in_codecov: true
|
|
9
|
+
in_pypi: true
|
|
10
|
+
in_rtd: false
|
|
11
|
+
jupyter_files: forbid
|
|
12
|
+
license: MIT
|
|
13
|
+
package_description: Runner for generative models with local and W&B tracking.
|
|
14
|
+
package_name: lite_runner
|
|
15
|
+
project_name: LiteRunner
|
|
16
|
+
python_min: 10
|
|
17
|
+
user_email: tsvika@moonmath.ai
|
|
18
|
+
user_name: MoonMath.ai
|
|
19
|
+
year: 2026
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
indent_style = space
|
|
5
|
+
end_of_line = lf
|
|
6
|
+
charset = utf-8
|
|
7
|
+
trim_trailing_whitespace = true
|
|
8
|
+
insert_final_newline = true
|
|
9
|
+
|
|
10
|
+
# common file types with indent=2
|
|
11
|
+
[*.{toml,yaml,yml}]
|
|
12
|
+
indent_size = 2
|
|
13
|
+
|
|
14
|
+
# CSV-like
|
|
15
|
+
[*.{tsv,tab,csv}]
|
|
16
|
+
indent_style = unset
|
|
17
|
+
trim_trailing_whitespace = false
|
|
18
|
+
insert_final_newline = false
|
|
19
|
+
|
|
20
|
+
# These file types are formatted with tools (indent=2)
|
|
21
|
+
[*.{md,sh,json}]
|
|
22
|
+
indent_size = unset
|
|
23
|
+
|
|
24
|
+
# These file types are formatted with tools (indent=4)
|
|
25
|
+
[*.{py,fish}]
|
|
26
|
+
indent_size = unset
|
|
27
|
+
|
|
28
|
+
# LICENSE files
|
|
29
|
+
[LICENSE]
|
|
30
|
+
indent_size = unset
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.git_archival.txt export-subst
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Configure trusted publishing for this workflow.
|
|
2
|
+
# See: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
|
|
3
|
+
# Go to: https://pypi.org/manage/account/publishing/
|
|
4
|
+
# Fill: lite-runner / moonmath-ai / LiteRunner / build-and-publish.yml / pypi
|
|
5
|
+
# Go to: https://test.pypi.org/manage/account/publishing/
|
|
6
|
+
# Fill: lite-runner / moonmath-ai / LiteRunner / build-and-publish.yml / testpypi
|
|
7
|
+
|
|
8
|
+
name: Build and Publish
|
|
9
|
+
|
|
10
|
+
on:
|
|
11
|
+
push:
|
|
12
|
+
tags: ['v*']
|
|
13
|
+
release:
|
|
14
|
+
types: [published]
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
|
|
19
|
+
env:
|
|
20
|
+
# Many color libraries just need this variable to be set to any value.
|
|
21
|
+
# Set it to 3 to support 8-bit color graphics (256 colors per channel)
|
|
22
|
+
# for libraries that care about the value set.
|
|
23
|
+
FORCE_COLOR: 3
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
ci:
|
|
27
|
+
uses: ./.github/workflows/ci.yml
|
|
28
|
+
|
|
29
|
+
build-and-inspect-package:
|
|
30
|
+
needs: ci
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v6
|
|
34
|
+
with:
|
|
35
|
+
persist-credentials: false
|
|
36
|
+
- uses: hynek/build-and-inspect-python-package@v2
|
|
37
|
+
|
|
38
|
+
publish-to-testpypi:
|
|
39
|
+
if: github.event_name == 'push'
|
|
40
|
+
needs: build-and-inspect-package
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
environment:
|
|
43
|
+
name: testpypi
|
|
44
|
+
url: https://test.pypi.org/p/lite-runner
|
|
45
|
+
permissions:
|
|
46
|
+
# IMPORTANT: this permission is mandatory for trusted publishing, but
|
|
47
|
+
# should NOT be granted anywhere else!
|
|
48
|
+
id-token: write
|
|
49
|
+
steps:
|
|
50
|
+
- name: Download package distributions
|
|
51
|
+
uses: actions/download-artifact@v7
|
|
52
|
+
with:
|
|
53
|
+
name: Packages
|
|
54
|
+
path: dist/
|
|
55
|
+
- name: Publish distribution to TestPyPI
|
|
56
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
57
|
+
with:
|
|
58
|
+
repository-url: https://test.pypi.org/legacy/
|
|
59
|
+
|
|
60
|
+
publish-to-pypi:
|
|
61
|
+
if: github.event_name == 'release'
|
|
62
|
+
needs: build-and-inspect-package
|
|
63
|
+
runs-on: ubuntu-latest
|
|
64
|
+
environment:
|
|
65
|
+
name: pypi
|
|
66
|
+
url: https://pypi.org/p/lite-runner
|
|
67
|
+
permissions:
|
|
68
|
+
# IMPORTANT: this permission is mandatory for trusted publishing, but
|
|
69
|
+
# should NOT be granted anywhere else!
|
|
70
|
+
id-token: write
|
|
71
|
+
steps:
|
|
72
|
+
- name: Download package distributions
|
|
73
|
+
uses: actions/download-artifact@v7
|
|
74
|
+
with:
|
|
75
|
+
name: Packages
|
|
76
|
+
path: dist/
|
|
77
|
+
- name: Publish distribution to PyPI
|
|
78
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
pull_request:
|
|
6
|
+
push:
|
|
7
|
+
branches: [main, develop]
|
|
8
|
+
workflow_call:
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
# Many color libraries just need this variable to be set to any value.
|
|
19
|
+
# Set it to 3 to support 8-bit color graphics (256 colors per channel)
|
|
20
|
+
# for libraries that care about the value set.
|
|
21
|
+
FORCE_COLOR: 3
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
format-python:
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v6
|
|
28
|
+
with:
|
|
29
|
+
persist-credentials: false
|
|
30
|
+
- uses: astral-sh/ruff-action@v3
|
|
31
|
+
with:
|
|
32
|
+
args: format --check
|
|
33
|
+
|
|
34
|
+
ruff-check:
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
steps:
|
|
37
|
+
- uses: actions/checkout@v6
|
|
38
|
+
with:
|
|
39
|
+
persist-credentials: false
|
|
40
|
+
- uses: astral-sh/ruff-action@v3
|
|
41
|
+
|
|
42
|
+
pre-commit:
|
|
43
|
+
env:
|
|
44
|
+
COLUMNS: 120
|
|
45
|
+
runs-on: ubuntu-latest
|
|
46
|
+
steps:
|
|
47
|
+
- uses: actions/checkout@v6
|
|
48
|
+
with:
|
|
49
|
+
persist-credentials: false
|
|
50
|
+
- uses: pre-commit/action@v3.0.1
|
|
51
|
+
|
|
52
|
+
mypy:
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
steps:
|
|
55
|
+
- uses: actions/checkout@v6
|
|
56
|
+
with:
|
|
57
|
+
persist-credentials: false
|
|
58
|
+
- uses: astral-sh/setup-uv@v7
|
|
59
|
+
- name: Install packages
|
|
60
|
+
run: >-
|
|
61
|
+
uv sync
|
|
62
|
+
--exact
|
|
63
|
+
--all-extras
|
|
64
|
+
--no-default-groups
|
|
65
|
+
--group typing
|
|
66
|
+
--group test
|
|
67
|
+
--locked
|
|
68
|
+
- name: List packages
|
|
69
|
+
run: uv pip list
|
|
70
|
+
- name: Run mypy
|
|
71
|
+
run: uv run --no-sync mypy
|
|
72
|
+
|
|
73
|
+
dependencies:
|
|
74
|
+
runs-on: ubuntu-latest
|
|
75
|
+
steps:
|
|
76
|
+
- uses: actions/checkout@v6
|
|
77
|
+
with:
|
|
78
|
+
persist-credentials: false
|
|
79
|
+
- uses: astral-sh/setup-uv@v7
|
|
80
|
+
- name: Install packages
|
|
81
|
+
run: >-
|
|
82
|
+
uv sync
|
|
83
|
+
--exact
|
|
84
|
+
--all-extras
|
|
85
|
+
--all-groups
|
|
86
|
+
--locked
|
|
87
|
+
- name: List packages
|
|
88
|
+
run: uv pip list
|
|
89
|
+
- name: Run deptry
|
|
90
|
+
run: uv run --no-sync --with deptry -- deptry src/
|
|
91
|
+
- name: Run pip-audit
|
|
92
|
+
run: >-
|
|
93
|
+
uv run --no-sync --with pip-audit -- pip-audit --skip-editable
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
test:
|
|
97
|
+
strategy:
|
|
98
|
+
matrix:
|
|
99
|
+
include:
|
|
100
|
+
# test with highest resolution
|
|
101
|
+
- resolution: highest
|
|
102
|
+
os: ubuntu-latest
|
|
103
|
+
python-version: '3.14'
|
|
104
|
+
# test with lowest resolution
|
|
105
|
+
- resolution: lowest
|
|
106
|
+
os: ubuntu-latest
|
|
107
|
+
python-version: '3.10'
|
|
108
|
+
# test with different os
|
|
109
|
+
- resolution: locked
|
|
110
|
+
os: ubuntu-latest
|
|
111
|
+
python-version: '3.10'
|
|
112
|
+
- resolution: locked
|
|
113
|
+
os: macos-latest
|
|
114
|
+
python-version: '3.10'
|
|
115
|
+
# - resolution: locked
|
|
116
|
+
# os: windows-latest
|
|
117
|
+
# python-version: '3.10'
|
|
118
|
+
fail-fast: false
|
|
119
|
+
runs-on: ${{ matrix.os }}
|
|
120
|
+
name: test-${{ matrix.python-version }}-${{ matrix.resolution }}-${{ matrix.os }}
|
|
121
|
+
steps:
|
|
122
|
+
- uses: actions/checkout@v6
|
|
123
|
+
with:
|
|
124
|
+
persist-credentials: false
|
|
125
|
+
- uses: astral-sh/setup-uv@v7
|
|
126
|
+
with:
|
|
127
|
+
python-version: ${{ matrix.python-version }}
|
|
128
|
+
cache-suffix: ${{ matrix.resolution }}
|
|
129
|
+
- name: Install packages
|
|
130
|
+
id: install_packages
|
|
131
|
+
run: >-
|
|
132
|
+
uv sync
|
|
133
|
+
--exact
|
|
134
|
+
--all-extras
|
|
135
|
+
--no-default-groups
|
|
136
|
+
--group test
|
|
137
|
+
${{ matrix.resolution == 'locked' && '--locked'
|
|
138
|
+
|| matrix.resolution == 'lowest' && '--upgrade --resolution lowest-direct'
|
|
139
|
+
|| matrix.resolution == 'highest' && '--upgrade --resolution highest'
|
|
140
|
+
|| '--NON_RECOGNIZED_RESOLUTION'
|
|
141
|
+
}}
|
|
142
|
+
- name: List packages
|
|
143
|
+
run: uv pip list
|
|
144
|
+
- name: Run tests
|
|
145
|
+
id: run_tests
|
|
146
|
+
run: >-
|
|
147
|
+
uv run --no-sync --
|
|
148
|
+
pytest
|
|
149
|
+
--cov-branch
|
|
150
|
+
--cov-report=term
|
|
151
|
+
--cov-report=xml
|
|
152
|
+
--junitxml=junit.xml
|
|
153
|
+
- name: Upload test results to Codecov
|
|
154
|
+
if: ${{ !cancelled() && steps.run_tests.conclusion != 'skipped' }}
|
|
155
|
+
uses: codecov/test-results-action@v1
|
|
156
|
+
with:
|
|
157
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
158
|
+
- name: Upload coverage reports to Codecov
|
|
159
|
+
uses: codecov/codecov-action@v5
|
|
160
|
+
with:
|
|
161
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
test-pypy-and-prerelease:
|
|
165
|
+
strategy:
|
|
166
|
+
matrix:
|
|
167
|
+
include:
|
|
168
|
+
# test with pypy
|
|
169
|
+
- resolution: highest
|
|
170
|
+
os: ubuntu-latest
|
|
171
|
+
python-version: 'pypy3.11'
|
|
172
|
+
# test on prerelease
|
|
173
|
+
- resolution: prerelease
|
|
174
|
+
os: ubuntu-latest
|
|
175
|
+
python-version: '3.14'
|
|
176
|
+
- resolution: prerelease
|
|
177
|
+
os: ubuntu-latest
|
|
178
|
+
python-version: '3.15'
|
|
179
|
+
fail-fast: false
|
|
180
|
+
runs-on: ${{ matrix.os }}
|
|
181
|
+
name: test-${{ matrix.python-version }}-${{ matrix.resolution }}-${{ matrix.os }}
|
|
182
|
+
steps:
|
|
183
|
+
- uses: actions/checkout@v6
|
|
184
|
+
with:
|
|
185
|
+
persist-credentials: false
|
|
186
|
+
- uses: astral-sh/setup-uv@v7
|
|
187
|
+
with:
|
|
188
|
+
python-version: ${{ matrix.python-version }}
|
|
189
|
+
cache-suffix: ${{ matrix.resolution }}
|
|
190
|
+
- name: Install packages
|
|
191
|
+
id: install_packages
|
|
192
|
+
run: >-
|
|
193
|
+
uv sync
|
|
194
|
+
--exact
|
|
195
|
+
--all-extras
|
|
196
|
+
--no-default-groups
|
|
197
|
+
--group test
|
|
198
|
+
${{ matrix.resolution == 'locked' && '--locked'
|
|
199
|
+
|| matrix.resolution == 'lowest' && '--upgrade --resolution lowest-direct'
|
|
200
|
+
|| matrix.resolution == 'highest' && '--upgrade --resolution highest'
|
|
201
|
+
|| matrix.resolution == 'prerelease' && '--upgrade --resolution highest --prerelease allow'
|
|
202
|
+
|| '--NON_RECOGNIZED_RESOLUTION'
|
|
203
|
+
}}
|
|
204
|
+
continue-on-error: true
|
|
205
|
+
- name: Stop job with warning if install fails
|
|
206
|
+
if: ${{ steps.install_packages.outcome == 'failure' }}
|
|
207
|
+
run: >-
|
|
208
|
+
echo "::warning::Stopping job due to installation failure on Python ${{ matrix.python-version }}"
|
|
209
|
+
- name: List packages
|
|
210
|
+
if: ${{ steps.install_packages.outcome == 'success' }}
|
|
211
|
+
run: uv pip list
|
|
212
|
+
- name: Run tests
|
|
213
|
+
if: ${{ steps.install_packages.outcome == 'success' }}
|
|
214
|
+
run: uv run --no-sync -- pytest --cov-branch --cov-report=xml --junitxml=junit.xml
|
|
215
|
+
|
|
216
|
+
pass:
|
|
217
|
+
if: ${{ always() }}
|
|
218
|
+
needs:
|
|
219
|
+
- format-python
|
|
220
|
+
- ruff-check
|
|
221
|
+
- pre-commit
|
|
222
|
+
- mypy
|
|
223
|
+
- dependencies
|
|
224
|
+
- test
|
|
225
|
+
- test-pypy-and-prerelease
|
|
226
|
+
runs-on: ubuntu-latest
|
|
227
|
+
steps:
|
|
228
|
+
- uses: re-actors/alls-green@release/v1
|
|
229
|
+
with:
|
|
230
|
+
jobs: ${{ toJSON(needs) }}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: Update Dependencies
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
update-deps:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
pull-requests: write
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v6
|
|
15
|
+
with:
|
|
16
|
+
persist-credentials: false
|
|
17
|
+
- uses: astral-sh/setup-uv@v7
|
|
18
|
+
- name: Sync dependencies
|
|
19
|
+
run: uv sync
|
|
20
|
+
- name: Update dependencies
|
|
21
|
+
run: uv run just deps-update
|
|
22
|
+
- name: Run security audit
|
|
23
|
+
id: audit
|
|
24
|
+
run: |
|
|
25
|
+
echo 'AUDIT<<EOF' >> "$GITHUB_OUTPUT"
|
|
26
|
+
uv run just deps-audit 2>&1 || true
|
|
27
|
+
echo 'EOF' >> "$GITHUB_OUTPUT"
|
|
28
|
+
- name: Check outdated packages
|
|
29
|
+
id: outdated
|
|
30
|
+
run: |
|
|
31
|
+
echo 'OUTDATED<<EOF' >> "$GITHUB_OUTPUT"
|
|
32
|
+
uv run just deps-list-outdated 2>&1 || true
|
|
33
|
+
echo 'EOF' >> "$GITHUB_OUTPUT"
|
|
34
|
+
- name: Create Pull Request
|
|
35
|
+
uses: peter-evans/create-pull-request@v8
|
|
36
|
+
with:
|
|
37
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
38
|
+
commit-message: "⬆️ Update project dependencies"
|
|
39
|
+
title: "⬆️ Update project dependencies"
|
|
40
|
+
body: |
|
|
41
|
+
Automated dependency update.
|
|
42
|
+
|
|
43
|
+
## Security Audit
|
|
44
|
+
```
|
|
45
|
+
${{ steps.audit.outputs.AUDIT }}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Outdated Packages
|
|
49
|
+
```
|
|
50
|
+
${{ steps.outdated.outputs.OUTDATED }}
|
|
51
|
+
```
|
|
52
|
+
branch: deps/update
|
|
53
|
+
delete-branch: true
|
|
54
|
+
labels: dependencies
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
name: Scheduled CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
schedule:
|
|
6
|
+
- cron: 0 6 * * 0 # Sunday at 6 AM UTC
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
issues: write
|
|
11
|
+
|
|
12
|
+
env:
|
|
13
|
+
# Many color libraries just need this variable to be set to any value.
|
|
14
|
+
# Set it to 3 to support 8-bit color graphics (256 colors per channel)
|
|
15
|
+
# for libraries that care about the value set.
|
|
16
|
+
FORCE_COLOR: 3
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
test:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
timeout-minutes: 30
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v6
|
|
24
|
+
with:
|
|
25
|
+
persist-credentials: false
|
|
26
|
+
- uses: astral-sh/setup-uv@v7
|
|
27
|
+
with:
|
|
28
|
+
python-version: '3.14'
|
|
29
|
+
enable-cache: false
|
|
30
|
+
- name: Install packages
|
|
31
|
+
run: >-
|
|
32
|
+
uv sync
|
|
33
|
+
--exact
|
|
34
|
+
--all-extras
|
|
35
|
+
--no-default-groups
|
|
36
|
+
--group test
|
|
37
|
+
--upgrade
|
|
38
|
+
--resolution highest
|
|
39
|
+
- name: List packages
|
|
40
|
+
run: uv pip list
|
|
41
|
+
- name: Run tests
|
|
42
|
+
run: uv run --no-sync pytest
|
|
43
|
+
- name: Create failure issue
|
|
44
|
+
if: failure()
|
|
45
|
+
uses: actions/github-script@v8
|
|
46
|
+
with:
|
|
47
|
+
script: |
|
|
48
|
+
// Check for existing test failure issues
|
|
49
|
+
const existingIssues = await github.rest.issues.listForRepo({
|
|
50
|
+
owner: context.repo.owner,
|
|
51
|
+
repo: context.repo.repo,
|
|
52
|
+
state: 'open',
|
|
53
|
+
labels: 'scheduled-ci-tests',
|
|
54
|
+
per_page: 10
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
if (existingIssues.data.length > 0) {
|
|
58
|
+
// Update existing issue
|
|
59
|
+
const existingIssue = existingIssues.data[0];
|
|
60
|
+
await github.rest.issues.createComment({
|
|
61
|
+
owner: context.repo.owner,
|
|
62
|
+
repo: context.repo.repo,
|
|
63
|
+
issue_number: existingIssue.number,
|
|
64
|
+
body: `Another test failure occurred on ${context.sha.substring(0, 7)}, see the [workflow run](${context.payload.repository.html_url}/actions/runs/${context.runId})`
|
|
65
|
+
});
|
|
66
|
+
await core.notice(`Updated existing issue ${existingIssue.html_url}`);
|
|
67
|
+
|
|
68
|
+
} else {
|
|
69
|
+
// Create new issue
|
|
70
|
+
const issue = await github.rest.issues.create({
|
|
71
|
+
owner: context.repo.owner,
|
|
72
|
+
repo: context.repo.repo,
|
|
73
|
+
title: `Scheduled CI Tests Failed - ${new Date().toISOString().split('T')[0]}`,
|
|
74
|
+
body: `The scheduled CI tests failed on ${context.sha.substring(0, 7)}.
|
|
75
|
+
|
|
76
|
+
**Failed Jobs:**
|
|
77
|
+
- Check the [workflow run](${context.payload.repository.html_url}/actions/runs/${context.runId})
|
|
78
|
+
|
|
79
|
+
**Likely Causes:**
|
|
80
|
+
- New dependency versions with breaking changes
|
|
81
|
+
|
|
82
|
+
**Next Steps:**
|
|
83
|
+
- Review the logs above
|
|
84
|
+
- Update code for new dependencies or limit package versions
|
|
85
|
+
- Re-run the workflow to verify fixes`,
|
|
86
|
+
labels: ['scheduled-ci-tests'],
|
|
87
|
+
assignees: [context.repo.owner],
|
|
88
|
+
});
|
|
89
|
+
await core.notice(`Created issue ${issue.data.html_url}`);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
pip-audit:
|
|
93
|
+
runs-on: ubuntu-latest
|
|
94
|
+
timeout-minutes: 10
|
|
95
|
+
steps:
|
|
96
|
+
- uses: actions/checkout@v6
|
|
97
|
+
with:
|
|
98
|
+
persist-credentials: false
|
|
99
|
+
- uses: astral-sh/setup-uv@v7
|
|
100
|
+
- name: Export packages
|
|
101
|
+
run: >-
|
|
102
|
+
uv export
|
|
103
|
+
--all-packages
|
|
104
|
+
--all-extras
|
|
105
|
+
--all-groups
|
|
106
|
+
-o requirements.txt
|
|
107
|
+
--no-emit-local
|
|
108
|
+
--locked
|
|
109
|
+
- uses: pypa/gh-action-pip-audit@v1.1.0
|
|
110
|
+
with:
|
|
111
|
+
inputs: requirements.txt
|
|
112
|
+
require-hashes: true
|
|
113
|
+
- name: Create failure issue
|
|
114
|
+
if: failure()
|
|
115
|
+
uses: actions/github-script@v8
|
|
116
|
+
with:
|
|
117
|
+
script: |
|
|
118
|
+
// Check for existing audit failure issues
|
|
119
|
+
const existingIssues = await github.rest.issues.listForRepo({
|
|
120
|
+
owner: context.repo.owner,
|
|
121
|
+
repo: context.repo.repo,
|
|
122
|
+
state: 'open',
|
|
123
|
+
labels: 'scheduled-ci-audit',
|
|
124
|
+
per_page: 10
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
if (existingIssues.data.length > 0) {
|
|
128
|
+
// Update existing issue instead of creating new one
|
|
129
|
+
const existingIssue = existingIssues.data[0];
|
|
130
|
+
await github.rest.issues.createComment({
|
|
131
|
+
owner: context.repo.owner,
|
|
132
|
+
repo: context.repo.repo,
|
|
133
|
+
issue_number: existingIssue.number,
|
|
134
|
+
body: `Another audit failure occurred on ${context.sha.substring(0, 7)}, see the [workflow run](${context.payload.repository.html_url}/actions/runs/${context.runId})`
|
|
135
|
+
});
|
|
136
|
+
await core.notice(`Updated existing issue ${existingIssue.html_url}`);
|
|
137
|
+
|
|
138
|
+
} else {
|
|
139
|
+
// Create new issue
|
|
140
|
+
const issue = await github.rest.issues.create({
|
|
141
|
+
owner: context.repo.owner,
|
|
142
|
+
repo: context.repo.repo,
|
|
143
|
+
title: `Scheduled CI Audit Failed - ${new Date().toISOString().split('T')[0]}`,
|
|
144
|
+
body: `The scheduled CI audit check failed on ${context.sha.substring(0, 7)}.
|
|
145
|
+
|
|
146
|
+
**Failed Jobs:**
|
|
147
|
+
- Check the [workflow run](${context.payload.repository.html_url}/actions/runs/${context.runId})
|
|
148
|
+
|
|
149
|
+
**Likely Causes:**
|
|
150
|
+
- New security vulnerabilities detected by pip-audit
|
|
151
|
+
|
|
152
|
+
**Next Steps:**
|
|
153
|
+
- Review the logs above
|
|
154
|
+
- Update locked dependencies
|
|
155
|
+
- Re-run the workflow to verify fixes`,
|
|
156
|
+
labels: ['scheduled-ci-audit'],
|
|
157
|
+
assignees: [context.repo.owner],
|
|
158
|
+
});
|
|
159
|
+
await core.notice(`Created issue ${issue.data.html_url}`);
|
|
160
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Created by https://www.toptal.com/developers/gitignore/api/pythonvanilla
|
|
2
|
+
# Edit at https://www.toptal.com/developers/gitignore?templates=pythonvanilla
|
|
3
|
+
|
|
4
|
+
### PythonVanilla ###
|
|
5
|
+
# Byte-compiled / optimized / DLL files
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*$py.class
|
|
9
|
+
|
|
10
|
+
# C extensions
|
|
11
|
+
*.so
|
|
12
|
+
|
|
13
|
+
# Distribution / packaging
|
|
14
|
+
.Python
|
|
15
|
+
build/
|
|
16
|
+
develop-eggs/
|
|
17
|
+
dist/
|
|
18
|
+
downloads/
|
|
19
|
+
eggs/
|
|
20
|
+
.eggs/
|
|
21
|
+
lib/
|
|
22
|
+
lib64/
|
|
23
|
+
parts/
|
|
24
|
+
__pypackages__/
|
|
25
|
+
sdist/
|
|
26
|
+
var/
|
|
27
|
+
wheels/
|
|
28
|
+
share/python-wheels/
|
|
29
|
+
*.egg-info/
|
|
30
|
+
.installed.cfg
|
|
31
|
+
*.egg
|
|
32
|
+
MANIFEST
|
|
33
|
+
|
|
34
|
+
# Unit test / coverage reports
|
|
35
|
+
.cache
|
|
36
|
+
.pytest_cache/
|
|
37
|
+
.coverage
|
|
38
|
+
|
|
39
|
+
# End of https://www.toptal.com/developers/gitignore/api/pythonvanilla
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# version file
|
|
43
|
+
_version.py
|
|
44
|
+
|
|
45
|
+
# virtual envs
|
|
46
|
+
venv/
|
|
47
|
+
.venv/
|
|
48
|
+
|
|
49
|
+
# mkdocs documentation
|
|
50
|
+
/site
|
|
51
|
+
/docs/reference
|
|
52
|
+
|
|
53
|
+
# development tools
|
|
54
|
+
.mypy_cache/
|
|
55
|
+
.dmypy.json
|
|
56
|
+
.ruff_cache/
|
|
57
|
+
.hypothesis/
|
|
58
|
+
.benchmarks/
|
|
59
|
+
|
|
60
|
+
# Secrets
|
|
61
|
+
.env
|
|
62
|
+
|
|
63
|
+
# jupyter
|
|
64
|
+
.ipynb_checkpoints/
|
|
65
|
+
|
|
66
|
+
# TODO
|
|
67
|
+
TODO*
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
# specific to this project:
|
|
71
|
+
wandb/
|