framex-kit 0.2.8__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.
- framex_kit-0.2.8/.coveragerc +27 -0
- framex_kit-0.2.8/.github/workflows/page.yml +43 -0
- framex_kit-0.2.8/.github/workflows/pre-commit.yml +21 -0
- framex_kit-0.2.8/.github/workflows/release.yml +111 -0
- framex_kit-0.2.8/.github/workflows/secret-detection.yaml +17 -0
- framex_kit-0.2.8/.github/workflows/test.yml +30 -0
- framex_kit-0.2.8/.gitignore +67 -0
- framex_kit-0.2.8/.gitlab-ci.yml +157 -0
- framex_kit-0.2.8/.pre-commit-config.yaml +51 -0
- framex_kit-0.2.8/.python-version +1 -0
- framex_kit-0.2.8/CHANGELOG.md +804 -0
- framex_kit-0.2.8/LICENSE +18 -0
- framex_kit-0.2.8/PKG-INFO +186 -0
- framex_kit-0.2.8/README.md +162 -0
- framex_kit-0.2.8/book/.gitignore +1 -0
- framex_kit-0.2.8/book/book.toml +23 -0
- framex_kit-0.2.8/book/rust-toolchain.toml +2 -0
- framex_kit-0.2.8/book/src/CHANGELOG.md +0 -0
- framex_kit-0.2.8/book/src/SUMMARY.md +38 -0
- framex_kit-0.2.8/book/src/advanced_usage/advanced_test.md +67 -0
- framex_kit-0.2.8/book/src/advanced_usage/authentication.md +86 -0
- framex_kit-0.2.8/book/src/advanced_usage/concurrency_and_ingress.md +144 -0
- framex_kit-0.2.8/book/src/advanced_usage/monitor.md +59 -0
- framex_kit-0.2.8/book/src/advanced_usage/overview.md +35 -0
- framex_kit-0.2.8/book/src/advanced_usage/proxy_function.md +104 -0
- framex_kit-0.2.8/book/src/advanced_usage/ray_engine.md +54 -0
- framex_kit-0.2.8/book/src/advanced_usage/remote_calls.md +88 -0
- framex_kit-0.2.8/book/src/advanced_usage/system_proxy_plugin.md +99 -0
- framex_kit-0.2.8/book/src/basic_usage/cross_plugin_access.md +176 -0
- framex_kit-0.2.8/book/src/basic_usage/overview.md +58 -0
- framex_kit-0.2.8/book/src/basic_usage/plugin_configreation.md +103 -0
- framex_kit-0.2.8/book/src/basic_usage/plugin_debugging_&_testing.md +86 -0
- framex_kit-0.2.8/book/src/basic_usage/plugin_loading_&_startup.md +78 -0
- framex_kit-0.2.8/book/src/basic_usage/plugin_register_&_api_expose.md +202 -0
- framex_kit-0.2.8/book/src/basic_usage/project_structure.md +108 -0
- framex_kit-0.2.8/book/src/contribution.md +1 -0
- framex_kit-0.2.8/book/src/development.md +173 -0
- framex_kit-0.2.8/book/src/faq.md +46 -0
- framex_kit-0.2.8/book/src/image.png +0 -0
- framex_kit-0.2.8/book/src/img/contribution.png +0 -0
- framex_kit-0.2.8/book/src/img/hub.svg +4 -0
- framex_kit-0.2.8/book/src/img/v2andv3.png +0 -0
- framex_kit-0.2.8/book/src/img/v2andv3.svg +4 -0
- framex_kit-0.2.8/book/src/overview.md +58 -0
- framex_kit-0.2.8/book/src/quickstart.md +299 -0
- framex_kit-0.2.8/book/theme/index.hbs +353 -0
- framex_kit-0.2.8/book/theme/last-changed.css +6 -0
- framex_kit-0.2.8/book/theme/pagetoc.css +110 -0
- framex_kit-0.2.8/book/theme/pagetoc.js +91 -0
- framex_kit-0.2.8/config.js +32 -0
- framex_kit-0.2.8/flake.lock +96 -0
- framex_kit-0.2.8/flake.nix +44 -0
- framex_kit-0.2.8/mypy.ini +13 -0
- framex_kit-0.2.8/poe_tasks.toml +70 -0
- framex_kit-0.2.8/pyproject.toml +63 -0
- framex_kit-0.2.8/pytest.ini +34 -0
- framex_kit-0.2.8/releaserc.toml +87 -0
- framex_kit-0.2.8/renovate.json +7 -0
- framex_kit-0.2.8/ruff.toml +93 -0
- framex_kit-0.2.8/src/framex/__init__.py +198 -0
- framex_kit-0.2.8/src/framex/adapter/__init__.py +13 -0
- framex_kit-0.2.8/src/framex/adapter/base.py +68 -0
- framex_kit-0.2.8/src/framex/adapter/local_adapyer.py +57 -0
- framex_kit-0.2.8/src/framex/adapter/ray_adapter.py +54 -0
- framex_kit-0.2.8/src/framex/cli.py +91 -0
- framex_kit-0.2.8/src/framex/config.py +165 -0
- framex_kit-0.2.8/src/framex/consts.py +14 -0
- framex_kit-0.2.8/src/framex/driver/__init__.py +0 -0
- framex_kit-0.2.8/src/framex/driver/application.py +188 -0
- framex_kit-0.2.8/src/framex/driver/auth.py +128 -0
- framex_kit-0.2.8/src/framex/driver/decorator.py +18 -0
- framex_kit-0.2.8/src/framex/driver/ingress.py +180 -0
- framex_kit-0.2.8/src/framex/log.py +105 -0
- framex_kit-0.2.8/src/framex/plugin/__init__.py +156 -0
- framex_kit-0.2.8/src/framex/plugin/base.py +29 -0
- framex_kit-0.2.8/src/framex/plugin/load.py +57 -0
- framex_kit-0.2.8/src/framex/plugin/manage.py +271 -0
- framex_kit-0.2.8/src/framex/plugin/model.py +75 -0
- framex_kit-0.2.8/src/framex/plugin/on.py +219 -0
- framex_kit-0.2.8/src/framex/plugins/__init__.py +0 -0
- framex_kit-0.2.8/src/framex/plugins/echo.py +50 -0
- framex_kit-0.2.8/src/framex/plugins/proxy/__init__.py +302 -0
- framex_kit-0.2.8/src/framex/plugins/proxy/builder.py +93 -0
- framex_kit-0.2.8/src/framex/plugins/proxy/config.py +40 -0
- framex_kit-0.2.8/src/framex/plugins/proxy/model.py +14 -0
- framex_kit-0.2.8/src/framex/utils.py +162 -0
- framex_kit-0.2.8/tests/__init__.py +0 -0
- framex_kit-0.2.8/tests/api/__init__.py +0 -0
- framex_kit-0.2.8/tests/api/test_echo.py +56 -0
- framex_kit-0.2.8/tests/api/test_health.py +7 -0
- framex_kit-0.2.8/tests/api/test_invoker.py +30 -0
- framex_kit-0.2.8/tests/api/test_proxy.py +102 -0
- framex_kit-0.2.8/tests/conftest.py +70 -0
- framex_kit-0.2.8/tests/consts.py +203 -0
- framex_kit-0.2.8/tests/driver/__init__.py +0 -0
- framex_kit-0.2.8/tests/driver/test_application.py +122 -0
- framex_kit-0.2.8/tests/driver/test_auth.py +218 -0
- framex_kit-0.2.8/tests/driver/test_ingress.py +104 -0
- framex_kit-0.2.8/tests/mock.py +93 -0
- framex_kit-0.2.8/tests/plugins/__init__.py +0 -0
- framex_kit-0.2.8/tests/plugins/_hidden.py +3 -0
- framex_kit-0.2.8/tests/plugins/alias_model.py +33 -0
- framex_kit-0.2.8/tests/plugins/error_import.py +1 -0
- framex_kit-0.2.8/tests/plugins/export.py +20 -0
- framex_kit-0.2.8/tests/plugins/invoker/__init__.py +83 -0
- framex_kit-0.2.8/tests/test_cli.py +189 -0
- framex_kit-0.2.8/tests/test_config.py +48 -0
- framex_kit-0.2.8/tests/test_exception.py +33 -0
- framex_kit-0.2.8/tests/test_plugin.py +252 -0
- framex_kit-0.2.8/tests/test_plugins.py +209 -0
- framex_kit-0.2.8/tests/test_utils.py +183 -0
- framex_kit-0.2.8/tests/test_wrapper.py +112 -0
- framex_kit-0.2.8/uv.lock +2833 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[run]
|
|
2
|
+
branch = true
|
|
3
|
+
data_file = .coverage/.coverage
|
|
4
|
+
parallel = true
|
|
5
|
+
concurrency = thread
|
|
6
|
+
sigterm = true
|
|
7
|
+
source = src
|
|
8
|
+
|
|
9
|
+
# plugins = coverage_plugins.subprocess
|
|
10
|
+
|
|
11
|
+
[report]
|
|
12
|
+
exclude_also =
|
|
13
|
+
def __repr__
|
|
14
|
+
if self.debug:
|
|
15
|
+
if settings.DEBUG
|
|
16
|
+
raise AssertionError
|
|
17
|
+
raise NotImplementedError
|
|
18
|
+
if 0:
|
|
19
|
+
if __name__ == "__main__":
|
|
20
|
+
def main():
|
|
21
|
+
if TYPE_CHECKING:
|
|
22
|
+
class .*Protocol\):
|
|
23
|
+
@(abc\.)?abstractmethod
|
|
24
|
+
pass
|
|
25
|
+
def __str__
|
|
26
|
+
if settings.server.use_ray:
|
|
27
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: Page
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- master
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
runs-on: ubuntu-24.04
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v6
|
|
17
|
+
- name: setup rust toolchain
|
|
18
|
+
run: rustup update && rustup toolchain install
|
|
19
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
20
|
+
- run: cargo install mdbook-katex
|
|
21
|
+
- uses: taiki-e/install-action@v2
|
|
22
|
+
with:
|
|
23
|
+
tool: mdbook@0.4.52
|
|
24
|
+
- name: build book
|
|
25
|
+
run: cd book && mdbook build
|
|
26
|
+
- uses: actions/upload-pages-artifact@v4
|
|
27
|
+
with:
|
|
28
|
+
path: book/book
|
|
29
|
+
|
|
30
|
+
deploy:
|
|
31
|
+
needs: build
|
|
32
|
+
permissions:
|
|
33
|
+
pages: write
|
|
34
|
+
id-token: write
|
|
35
|
+
environment:
|
|
36
|
+
name: github-pages
|
|
37
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
38
|
+
runs-on: ubuntu-24.04
|
|
39
|
+
if: github.repository == 'touale/FrameX-kit'
|
|
40
|
+
steps:
|
|
41
|
+
- name: Deploy to GitHub Pages
|
|
42
|
+
id: deployment
|
|
43
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Pre-Commit Check
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master, main, dev ]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
pre-commit:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
env:
|
|
12
|
+
PYPI_URL: https://pypi.org/simple
|
|
13
|
+
PYTHON_VERSION: "3.11"
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v6
|
|
16
|
+
- uses: actions/setup-python@v6
|
|
17
|
+
with:
|
|
18
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
19
|
+
- uses: pre-commit/action@v3.0.1
|
|
20
|
+
- uses: pre-commit-ci/lite-action@v1.1.0
|
|
21
|
+
if: always()
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
release:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-release-${{ github.ref_name }}
|
|
11
|
+
cancel-in-progress: false
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
# Note: We checkout the repository at the branch that triggered the workflow
|
|
18
|
+
# with the entire history to ensure to match PSR's release branch detection
|
|
19
|
+
# and history evaluation.
|
|
20
|
+
# However, we forcefully reset the branch to the workflow sha because it is
|
|
21
|
+
# possible that the branch was updated while the workflow was running. This
|
|
22
|
+
# prevents accidentally releasing un-evaluated changes.
|
|
23
|
+
- name: Setup | Checkout Repository on Release Branch
|
|
24
|
+
uses: actions/checkout@v6
|
|
25
|
+
with:
|
|
26
|
+
ref: ${{ github.ref_name }}
|
|
27
|
+
fetch-depth: 0
|
|
28
|
+
|
|
29
|
+
- name: Setup | Force release branch to be at workflow sha
|
|
30
|
+
run: |
|
|
31
|
+
git reset --hard ${{ github.sha }}
|
|
32
|
+
|
|
33
|
+
- name: Action | Semantic Version Release
|
|
34
|
+
id: release
|
|
35
|
+
# Adjust tag with desired version if applicable.
|
|
36
|
+
uses: python-semantic-release/python-semantic-release@v10.5.3
|
|
37
|
+
with:
|
|
38
|
+
config_file: releaserc.toml
|
|
39
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
40
|
+
|
|
41
|
+
- name: Publish | Upload to GitHub Release Assets
|
|
42
|
+
uses: python-semantic-release/publish-action@v10.5.3
|
|
43
|
+
if: steps.release.outputs.released == 'true'
|
|
44
|
+
with:
|
|
45
|
+
config_file: releaserc.toml
|
|
46
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
47
|
+
tag: ${{ steps.release.outputs.tag }}
|
|
48
|
+
|
|
49
|
+
- name: Upload | Distribution Artifacts
|
|
50
|
+
uses: actions/upload-artifact@v6
|
|
51
|
+
with:
|
|
52
|
+
name: distribution-artifacts
|
|
53
|
+
path: dist
|
|
54
|
+
if-no-files-found: error
|
|
55
|
+
|
|
56
|
+
outputs:
|
|
57
|
+
released: ${{ steps.release.outputs.released || 'false' }}
|
|
58
|
+
|
|
59
|
+
public-testpypi:
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
needs: release
|
|
62
|
+
if: ${{ needs.release.outputs.released == 'true' }}
|
|
63
|
+
|
|
64
|
+
permissions:
|
|
65
|
+
contents: read
|
|
66
|
+
id-token: write
|
|
67
|
+
|
|
68
|
+
steps:
|
|
69
|
+
- name: Setup | Download Build Artifacts
|
|
70
|
+
uses: actions/download-artifact@v7
|
|
71
|
+
id: artifact-download
|
|
72
|
+
with:
|
|
73
|
+
name: distribution-artifacts
|
|
74
|
+
path: dist
|
|
75
|
+
|
|
76
|
+
# see https://docs.pypi.org/trusted-publishers/
|
|
77
|
+
- name: Publish package distributions to PyPI
|
|
78
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
79
|
+
with:
|
|
80
|
+
packages-dir: dist
|
|
81
|
+
print-hash: true
|
|
82
|
+
verbose: true
|
|
83
|
+
repository-url: https://test.pypi.org/legacy/
|
|
84
|
+
|
|
85
|
+
public-pypi:
|
|
86
|
+
runs-on: ubuntu-latest
|
|
87
|
+
needs: [public-testpypi, release]
|
|
88
|
+
if: ${{ needs.release.outputs.released == 'true' }}
|
|
89
|
+
|
|
90
|
+
permissions:
|
|
91
|
+
contents: read
|
|
92
|
+
id-token: write
|
|
93
|
+
|
|
94
|
+
environment:
|
|
95
|
+
name: production
|
|
96
|
+
|
|
97
|
+
steps:
|
|
98
|
+
- name: Setup | Download Build Artifacts
|
|
99
|
+
uses: actions/download-artifact@v7
|
|
100
|
+
id: artifact-download
|
|
101
|
+
with:
|
|
102
|
+
name: distribution-artifacts
|
|
103
|
+
path: dist
|
|
104
|
+
|
|
105
|
+
# see https://docs.pypi.org/trusted-publishers/
|
|
106
|
+
- name: Publish package distributions to PyPI
|
|
107
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
108
|
+
with:
|
|
109
|
+
packages-dir: dist
|
|
110
|
+
print-hash: true
|
|
111
|
+
verbose: true
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: Secret Detection
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
detect:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v6
|
|
13
|
+
with:
|
|
14
|
+
fetch-depth: 0
|
|
15
|
+
- uses: gitleaks/gitleaks-action@v2
|
|
16
|
+
env:
|
|
17
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Test Project
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
jobs:
|
|
5
|
+
test:
|
|
6
|
+
runs-on: ubuntu-latest
|
|
7
|
+
env:
|
|
8
|
+
PYTHON_VERSION: "3.11"
|
|
9
|
+
UV_VERSION: "0.5"
|
|
10
|
+
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v6
|
|
13
|
+
- uses: actions/setup-python@v6
|
|
14
|
+
with:
|
|
15
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
16
|
+
- name: Install UV
|
|
17
|
+
run: |
|
|
18
|
+
pip install uv==${{ env.UV_VERSION }}
|
|
19
|
+
uv sync --group dev
|
|
20
|
+
- name: Run Tests
|
|
21
|
+
run: uv run poe test-ci
|
|
22
|
+
- name: Upload coverage reports to Codecov
|
|
23
|
+
uses: codecov/codecov-action@v5
|
|
24
|
+
with:
|
|
25
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
26
|
+
- name: Upload test results to Codecov
|
|
27
|
+
if: ${{ !cancelled() }}
|
|
28
|
+
uses: codecov/test-results-action@v1
|
|
29
|
+
with:
|
|
30
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Temporary and binary files
|
|
2
|
+
*~
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.so
|
|
5
|
+
*.cfg
|
|
6
|
+
!setup.cfg
|
|
7
|
+
*.orig
|
|
8
|
+
*.log
|
|
9
|
+
*.pot
|
|
10
|
+
__pycache__/*
|
|
11
|
+
.cache/*
|
|
12
|
+
.*.swp
|
|
13
|
+
*/.ipynb_checkpoints/*
|
|
14
|
+
*.pyc
|
|
15
|
+
|
|
16
|
+
# Project files
|
|
17
|
+
.ropeproject
|
|
18
|
+
.project
|
|
19
|
+
.pydevproject
|
|
20
|
+
.settings
|
|
21
|
+
.idea
|
|
22
|
+
.vscode
|
|
23
|
+
|
|
24
|
+
# Package files
|
|
25
|
+
*.egg
|
|
26
|
+
*.eggs/
|
|
27
|
+
.installed.cfg
|
|
28
|
+
*.egg-info
|
|
29
|
+
|
|
30
|
+
# Unittest and coverage
|
|
31
|
+
htmlcov/*
|
|
32
|
+
.coverage
|
|
33
|
+
.tox
|
|
34
|
+
junit.xml
|
|
35
|
+
coverage.xml
|
|
36
|
+
cov.xml
|
|
37
|
+
report.xml
|
|
38
|
+
.coverage.*
|
|
39
|
+
**/cassettes
|
|
40
|
+
|
|
41
|
+
# Build and docs folder/files
|
|
42
|
+
build/*
|
|
43
|
+
dist/*
|
|
44
|
+
sdist/*
|
|
45
|
+
docs/api/*
|
|
46
|
+
docs/_build/*
|
|
47
|
+
docs/build/*
|
|
48
|
+
cover/*
|
|
49
|
+
MANIFEST
|
|
50
|
+
.mypy_cache/*
|
|
51
|
+
|
|
52
|
+
# Unused code
|
|
53
|
+
backup/*
|
|
54
|
+
|
|
55
|
+
# macOS Desktop Services Store
|
|
56
|
+
.DS_Store
|
|
57
|
+
|
|
58
|
+
.history
|
|
59
|
+
|
|
60
|
+
src/**demo
|
|
61
|
+
|
|
62
|
+
# Config
|
|
63
|
+
config.toml
|
|
64
|
+
|
|
65
|
+
log
|
|
66
|
+
data
|
|
67
|
+
cache
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
stages:
|
|
2
|
+
- test
|
|
3
|
+
- release
|
|
4
|
+
- deploy
|
|
5
|
+
|
|
6
|
+
variables:
|
|
7
|
+
# Registry
|
|
8
|
+
CI_TEMPLATE_REGISTRY_HOST: "docker.io"
|
|
9
|
+
APT_SOURCE: "https://mirrors.aliyun.com"
|
|
10
|
+
GITLAB_SOURCE: ""
|
|
11
|
+
|
|
12
|
+
# Cache
|
|
13
|
+
PRE_COMMIT_HOME: "$CI_PROJECT_DIR/.pre-commit"
|
|
14
|
+
CARGO_HOME: $CI_PROJECT_DIR/cargo
|
|
15
|
+
|
|
16
|
+
# Pip
|
|
17
|
+
PIP_TIMEOUT: 30
|
|
18
|
+
PIP_RETRIES: 5
|
|
19
|
+
PIP_TRUSTED_HOST: ""
|
|
20
|
+
PYPI_URL: https://pypi.org/simple
|
|
21
|
+
|
|
22
|
+
# Python & UV
|
|
23
|
+
PYTHON_VERSION: "3.11"
|
|
24
|
+
UV_VERSION: "0.5"
|
|
25
|
+
UV_LINK_MODE: "copy"
|
|
26
|
+
UV_FROZEN: "true"
|
|
27
|
+
|
|
28
|
+
# โ๏ธ Shared templates
|
|
29
|
+
.base_test_job_template: &base_test_job_template
|
|
30
|
+
stage: test
|
|
31
|
+
retry:
|
|
32
|
+
max: 2
|
|
33
|
+
when:
|
|
34
|
+
- runner_system_failure
|
|
35
|
+
tags:
|
|
36
|
+
- k8s_runner_persionnel_matching
|
|
37
|
+
rules:
|
|
38
|
+
- if: "$CI_COMMIT_MESSAGE =~ /^v/ || $CI_COMMIT_TAG"
|
|
39
|
+
when: never
|
|
40
|
+
- if: "$CI_COMMIT_BRANCH"
|
|
41
|
+
|
|
42
|
+
.base_git_env_template: &base_git_env_template
|
|
43
|
+
before_script:
|
|
44
|
+
- |
|
|
45
|
+
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d && \
|
|
46
|
+
echo "deb $APT_SOURCE/debian/ bookworm main" > /etc/apt/sources.list && \
|
|
47
|
+
echo "deb $APT_SOURCE/debian-security/ bookworm-security main" >> /etc/apt/sources.list && \
|
|
48
|
+
echo "deb $APT_SOURCE/debian/ bookworm-updates main" >> /etc/apt/sources.list && \
|
|
49
|
+
apt-get update -y && apt-get install -y --no-install-recommends git
|
|
50
|
+
|
|
51
|
+
renovate:
|
|
52
|
+
image: ${CI_TEMPLATE_REGISTRY_HOST}/renovatebot/renovate:full
|
|
53
|
+
stage: test
|
|
54
|
+
variables:
|
|
55
|
+
RENOVATE_PLATFORM: gitlab
|
|
56
|
+
RENOVATE_ENDPOINT: $GITLAB_SOURCE
|
|
57
|
+
RENOVATE_TOKEN: $GITLAB_TOKEN
|
|
58
|
+
LOG_LEVEL: debug
|
|
59
|
+
RENOVATE_REPOSITORIES: "$CI_PROJECT_PATH"
|
|
60
|
+
RENOVATE_CACHE_NPM: "false"
|
|
61
|
+
RENOVATE_CACHE_PIP: "false"
|
|
62
|
+
RENOVATE_PYPI_PASS: "$PYPI_PASS"
|
|
63
|
+
script:
|
|
64
|
+
- renovate
|
|
65
|
+
rules:
|
|
66
|
+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
67
|
+
when: never
|
|
68
|
+
- if: '$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_REF_NAME == "dev"'
|
|
69
|
+
|
|
70
|
+
# ๐ Secret scan
|
|
71
|
+
include:
|
|
72
|
+
- template: Security/Secret-Detection.gitlab-ci.yml
|
|
73
|
+
|
|
74
|
+
secret_detection:
|
|
75
|
+
<<: *base_test_job_template
|
|
76
|
+
allow_failure: false
|
|
77
|
+
script:
|
|
78
|
+
- /analyzer run
|
|
79
|
+
- cat gl-secret-detection-report.json
|
|
80
|
+
|
|
81
|
+
# โ
Pre-commit check
|
|
82
|
+
check-pre-commit:
|
|
83
|
+
<<: *base_test_job_template
|
|
84
|
+
<<: *base_git_env_template
|
|
85
|
+
image: ${CI_TEMPLATE_REGISTRY_HOST}/library/python:3.11-slim
|
|
86
|
+
cache:
|
|
87
|
+
key: ${CI_PROJECT_ID}-pre-commit-cache
|
|
88
|
+
paths:
|
|
89
|
+
- $PRE_COMMIT_HOME
|
|
90
|
+
script:
|
|
91
|
+
- pip install pre-commit==4.2.0 -i $PYPI_URL
|
|
92
|
+
- |
|
|
93
|
+
pre-commit run --all-files --show-diff-on-failure
|
|
94
|
+
|
|
95
|
+
# ๐งช Project test
|
|
96
|
+
test-project:
|
|
97
|
+
<<: *base_test_job_template
|
|
98
|
+
image: ${CI_TEMPLATE_REGISTRY_HOST}/astral-sh/uv:${UV_VERSION}-python${PYTHON_VERSION}-bookworm-slim
|
|
99
|
+
cache:
|
|
100
|
+
key: ${CI_PROJECT_ID}-test-cache
|
|
101
|
+
paths:
|
|
102
|
+
- tests/api/cassettes
|
|
103
|
+
script:
|
|
104
|
+
- uv sync --group dev
|
|
105
|
+
- uv run poe test-ci
|
|
106
|
+
coverage: '/(?i)total.*? (100(?:\.0+)?%|[1-9]?\d(?:\.\d+)?%)$/'
|
|
107
|
+
artifacts:
|
|
108
|
+
reports:
|
|
109
|
+
coverage_report:
|
|
110
|
+
coverage_format: cobertura
|
|
111
|
+
path: cov.xml
|
|
112
|
+
junit: report.xml
|
|
113
|
+
|
|
114
|
+
# ๐ Semantic Release
|
|
115
|
+
release:
|
|
116
|
+
<<: *base_git_env_template
|
|
117
|
+
image: ${CI_TEMPLATE_REGISTRY_HOST}/astral-sh/uv:${UV_VERSION}-python${PYTHON_VERSION}-bookworm-slim
|
|
118
|
+
stage: release
|
|
119
|
+
rules:
|
|
120
|
+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
121
|
+
when: never
|
|
122
|
+
- if: "$CI_COMMIT_MESSAGE =~ /^v/ || $CI_COMMIT_TAG"
|
|
123
|
+
when: never
|
|
124
|
+
- if: '$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_REF_NAME == "dev"'
|
|
125
|
+
variables:
|
|
126
|
+
GIT_DEPTH: 0
|
|
127
|
+
before_script:
|
|
128
|
+
- !reference [.base_git_env_template, before_script]
|
|
129
|
+
- git checkout -B "$CI_COMMIT_REF_NAME" "origin/$CI_COMMIT_REF_NAME"
|
|
130
|
+
- git status
|
|
131
|
+
script:
|
|
132
|
+
- uv sync --extra release
|
|
133
|
+
- uv run poe release
|
|
134
|
+
|
|
135
|
+
pages:
|
|
136
|
+
<<: *base_test_job_template
|
|
137
|
+
stage: deploy
|
|
138
|
+
image: ${CI_TEMPLATE_REGISTRY_HOST}/library/rust:latest
|
|
139
|
+
rules:
|
|
140
|
+
- if: '$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_REF_NAME == "dev"'
|
|
141
|
+
changes:
|
|
142
|
+
- book/**/*
|
|
143
|
+
cache:
|
|
144
|
+
key: ${CI_PROJECT_ID}-pages-cache
|
|
145
|
+
paths:
|
|
146
|
+
- $CARGO_HOME
|
|
147
|
+
before_script:
|
|
148
|
+
- export PATH="$PATH:$CARGO_HOME/bin"
|
|
149
|
+
- cargo install mdbook
|
|
150
|
+
- cargo install mdbook-toc
|
|
151
|
+
- cargo install mdbook-katex
|
|
152
|
+
- cargo install mdbook-last-changed
|
|
153
|
+
script:
|
|
154
|
+
- cd book && mdbook build -d ../public
|
|
155
|
+
artifacts:
|
|
156
|
+
paths:
|
|
157
|
+
- public
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
default_stages: [pre-commit]
|
|
2
|
+
|
|
3
|
+
repos:
|
|
4
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks.git
|
|
5
|
+
rev: v6.0.0
|
|
6
|
+
hooks:
|
|
7
|
+
- id: check-added-large-files
|
|
8
|
+
args: ['--maxkb=500']
|
|
9
|
+
- id: check-toml
|
|
10
|
+
- id: check-yaml
|
|
11
|
+
args:
|
|
12
|
+
- "--unsafe"
|
|
13
|
+
- id: end-of-file-fixer
|
|
14
|
+
# - id: trailing-whitespace
|
|
15
|
+
- id: check-json
|
|
16
|
+
- id: debug-statements
|
|
17
|
+
- id: check-case-conflict
|
|
18
|
+
- id: detect-private-key
|
|
19
|
+
- id: name-tests-test
|
|
20
|
+
files: ^tests/(?!plugins/).+\.py$
|
|
21
|
+
exclude: ^tests/(consts|mock)\.py$
|
|
22
|
+
args:
|
|
23
|
+
- "--pytest-test-first"
|
|
24
|
+
|
|
25
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
26
|
+
rev: v0.14.10
|
|
27
|
+
hooks:
|
|
28
|
+
- id: ruff
|
|
29
|
+
args: [--fix, --exit-non-zero-on-fix]
|
|
30
|
+
- id: ruff-format
|
|
31
|
+
|
|
32
|
+
- repo: https://github.com/codespell-project/codespell.git
|
|
33
|
+
rev: v2.4.1
|
|
34
|
+
hooks:
|
|
35
|
+
- id: codespell
|
|
36
|
+
files: \.(py|md|toml|yml|yaml|txt|rst)$
|
|
37
|
+
|
|
38
|
+
- repo: https://github.com/hukkin/mdformat
|
|
39
|
+
rev: 1.0.0
|
|
40
|
+
hooks:
|
|
41
|
+
- id: mdformat
|
|
42
|
+
files: ^(?!CHANGELOG\.md$).*\.(md|markdown)$
|
|
43
|
+
# Optionally add plugins
|
|
44
|
+
additional_dependencies:
|
|
45
|
+
- mdformat-gfm
|
|
46
|
+
- mdformat-black
|
|
47
|
+
|
|
48
|
+
- repo: https://github.com/ComPWA/taplo-pre-commit
|
|
49
|
+
rev: v0.9.3
|
|
50
|
+
hooks:
|
|
51
|
+
- id: taplo-format
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|