core-lens 0.1.dev74__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.
- core_lens-0.1.dev74/.github/pull_request_template.md +24 -0
- core_lens-0.1.dev74/.github/workflows/ci.yml +172 -0
- core_lens-0.1.dev74/.github/workflows/gh-pages.yml +38 -0
- core_lens-0.1.dev74/.github/workflows/pre-release.yml +191 -0
- core_lens-0.1.dev74/.github/workflows/release.yml +188 -0
- core_lens-0.1.dev74/.gitignore +369 -0
- core_lens-0.1.dev74/.gitmessage +5 -0
- core_lens-0.1.dev74/.pre-commit-config.yaml +49 -0
- core_lens-0.1.dev74/.python-version +1 -0
- core_lens-0.1.dev74/CONTRIBUTING.md +583 -0
- core_lens-0.1.dev74/LICENSE +674 -0
- core_lens-0.1.dev74/PKG-INFO +107 -0
- core_lens-0.1.dev74/README.md +49 -0
- core_lens-0.1.dev74/SKILLS.md +259 -0
- core_lens-0.1.dev74/docs/Makefile +20 -0
- core_lens-0.1.dev74/docs/make.bat +35 -0
- core_lens-0.1.dev74/docs/source/concepts.md +7 -0
- core_lens-0.1.dev74/docs/source/conf.py +62 -0
- core_lens-0.1.dev74/docs/source/index.rst +25 -0
- core_lens-0.1.dev74/docs/source/intro.md +14 -0
- core_lens-0.1.dev74/docs/source/plots.md +51 -0
- core_lens-0.1.dev74/docs/source/plugins.md +27 -0
- core_lens-0.1.dev74/docs/source/queries.md +60 -0
- core_lens-0.1.dev74/docs/source/quickstart.md +40 -0
- core_lens-0.1.dev74/docs/source/stats.md +105 -0
- core_lens-0.1.dev74/examples/demo_mws.py +311 -0
- core_lens-0.1.dev74/examples/demo_tehsil.py +363 -0
- core_lens-0.1.dev74/hooks/mypy.sh +2 -0
- core_lens-0.1.dev74/hooks/no-parquet-outside-fixtures.sh +34 -0
- core_lens-0.1.dev74/hooks/pytest.sh +2 -0
- core_lens-0.1.dev74/pyproject.toml +97 -0
- core_lens-0.1.dev74/src/core_lens/__init__.py +9 -0
- core_lens-0.1.dev74/src/core_lens/__main__.py +14 -0
- core_lens-0.1.dev74/src/core_lens/_version.py +24 -0
- core_lens-0.1.dev74/src/core_lens/aoi.py +503 -0
- core_lens-0.1.dev74/src/core_lens/base/__init__.py +19 -0
- core_lens-0.1.dev74/src/core_lens/base/entity.py +450 -0
- core_lens-0.1.dev74/src/core_lens/base/namespaces/__init__.py +6 -0
- core_lens-0.1.dev74/src/core_lens/base/namespaces/plot.py +569 -0
- core_lens-0.1.dev74/src/core_lens/base/namespaces/stats.py +906 -0
- core_lens-0.1.dev74/src/core_lens/base/result.py +291 -0
- core_lens-0.1.dev74/src/core_lens/base/view.py +431 -0
- core_lens-0.1.dev74/src/core_lens/entities/__init__.py +6 -0
- core_lens-0.1.dev74/src/core_lens/entities/mws.py +33 -0
- core_lens-0.1.dev74/src/core_lens/entities/tehsil.py +46 -0
- core_lens-0.1.dev74/src/core_lens/export/__init__.py +5 -0
- core_lens-0.1.dev74/src/core_lens/export/formats.py +212 -0
- core_lens-0.1.dev74/src/core_lens/py.typed +0 -0
- core_lens-0.1.dev74/src/core_lens/schema/__init__.py +5 -0
- core_lens-0.1.dev74/src/core_lens/schema/detection.py +220 -0
- core_lens-0.1.dev74/src/core_lens/schema/profile.py +108 -0
- core_lens-0.1.dev74/src/core_lens/utils/__init__.py +1 -0
- core_lens-0.1.dev74/src/core_lens/utils/polars_utils.py +54 -0
- core_lens-0.1.dev74/src/core_lens/utils/season.py +224 -0
- core_lens-0.1.dev74/src/core_lens/utils/spatial.py +343 -0
- core_lens-0.1.dev74/tests/fixtures/generate_fixtures.py +187 -0
- core_lens-0.1.dev74/tests/unit/conftest.py +234 -0
- core_lens-0.1.dev74/tests/unit/test_aoi.py +436 -0
- core_lens-0.1.dev74/tests/unit/test_entities.py +30 -0
- core_lens-0.1.dev74/tests/unit/test_entity.py +88 -0
- core_lens-0.1.dev74/tests/unit/test_export.py +169 -0
- core_lens-0.1.dev74/tests/unit/test_main.py +33 -0
- core_lens-0.1.dev74/tests/unit/test_plot.py +253 -0
- core_lens-0.1.dev74/tests/unit/test_polars_utils.py +14 -0
- core_lens-0.1.dev74/tests/unit/test_profile.py +34 -0
- core_lens-0.1.dev74/tests/unit/test_result.py +272 -0
- core_lens-0.1.dev74/tests/unit/test_schema_detection.py +315 -0
- core_lens-0.1.dev74/tests/unit/test_schema_profile.py +114 -0
- core_lens-0.1.dev74/tests/unit/test_season.py +100 -0
- core_lens-0.1.dev74/tests/unit/test_season_config.py +105 -0
- core_lens-0.1.dev74/tests/unit/test_spatial.py +137 -0
- core_lens-0.1.dev74/tests/unit/test_stats.py +556 -0
- core_lens-0.1.dev74/tests/unit/test_view.py +558 -0
- core_lens-0.1.dev74/uv.lock +3251 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
## 📝 Description
|
|
2
|
+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
|
|
3
|
+
|
|
4
|
+
- **Issue Reference:** [Link or # Issue Number]
|
|
5
|
+
- **Type of Change:**
|
|
6
|
+
- [ ] Bug fix
|
|
7
|
+
- [ ] New feature
|
|
8
|
+
- [ ] Refactor
|
|
9
|
+
- [ ] Documentation
|
|
10
|
+
- [ ] Other
|
|
11
|
+
|
|
12
|
+
## 🛠️ Proposed Changes
|
|
13
|
+
Provide a brief, clear summary of what was added, removed, or changed. For example, classes or functions affected.
|
|
14
|
+
-
|
|
15
|
+
-
|
|
16
|
+
|
|
17
|
+
## 🚦 Checklist
|
|
18
|
+
- [ ] My code follows the project's style guidelines
|
|
19
|
+
- [ ] I have performed a self-review of my own code
|
|
20
|
+
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
21
|
+
- [ ] I have made corresponding changes to the documentation
|
|
22
|
+
- [ ] My changes generate no new warnings
|
|
23
|
+
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
24
|
+
- [ ] New and existing unit tests pass locally with my changes
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- "**"
|
|
7
|
+
tags:
|
|
8
|
+
- "v*"
|
|
9
|
+
pull_request:
|
|
10
|
+
branches:
|
|
11
|
+
- dev
|
|
12
|
+
- main
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
concurrency:
|
|
19
|
+
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
20
|
+
cancel-in-progress: true
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
quality:
|
|
24
|
+
name: Lockfile, lint, types, changelog, audit
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
steps:
|
|
27
|
+
- name: Checkout
|
|
28
|
+
uses: actions/checkout@v5
|
|
29
|
+
with:
|
|
30
|
+
fetch-depth: 0
|
|
31
|
+
|
|
32
|
+
- name: Install uv
|
|
33
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
|
34
|
+
with:
|
|
35
|
+
enable-cache: true
|
|
36
|
+
|
|
37
|
+
- name: Set up Python
|
|
38
|
+
run: uv python install
|
|
39
|
+
|
|
40
|
+
- name: Install dependencies
|
|
41
|
+
run: uv sync --all-extras --all-groups --locked
|
|
42
|
+
|
|
43
|
+
- name: Verify lockfile
|
|
44
|
+
run: uv lock --check
|
|
45
|
+
|
|
46
|
+
- name: Lint
|
|
47
|
+
run: uv run ruff check .
|
|
48
|
+
|
|
49
|
+
- name: Format check
|
|
50
|
+
run: uv run ruff format --check .
|
|
51
|
+
|
|
52
|
+
- name: Typecheck
|
|
53
|
+
run: uv run mypy src/core_lens
|
|
54
|
+
|
|
55
|
+
- name: Changelog check
|
|
56
|
+
if: ${{ github.event_name == 'pull_request' }}
|
|
57
|
+
env:
|
|
58
|
+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
59
|
+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
60
|
+
run: |
|
|
61
|
+
changed_files="$(git diff --name-only "$BASE_SHA" "$HEAD_SHA")"
|
|
62
|
+
|
|
63
|
+
if ! printf '%s\n' "$changed_files" | grep -q '^src/'; then
|
|
64
|
+
echo "No src/ changes detected; skipping changelog requirement."
|
|
65
|
+
exit 0
|
|
66
|
+
fi
|
|
67
|
+
|
|
68
|
+
if printf '%s\n' "$changed_files" | grep -q '^CHANGELOG.md$'; then
|
|
69
|
+
echo "CHANGELOG.md updated."
|
|
70
|
+
exit 0
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
echo "Source files changed without a CHANGELOG.md update."
|
|
74
|
+
exit 1
|
|
75
|
+
|
|
76
|
+
- name: Security audit
|
|
77
|
+
run: uv run pip-audit
|
|
78
|
+
|
|
79
|
+
tests:
|
|
80
|
+
name: Tests (${{ matrix.os }}, Python ${{ matrix.python-version }})
|
|
81
|
+
needs: quality
|
|
82
|
+
runs-on: ${{ matrix.os }}
|
|
83
|
+
strategy:
|
|
84
|
+
fail-fast: false
|
|
85
|
+
matrix:
|
|
86
|
+
os:
|
|
87
|
+
- ubuntu-latest
|
|
88
|
+
python-version:
|
|
89
|
+
- "3.13"
|
|
90
|
+
steps:
|
|
91
|
+
- name: Checkout
|
|
92
|
+
uses: actions/checkout@v5
|
|
93
|
+
|
|
94
|
+
- name: Install uv
|
|
95
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
|
96
|
+
with:
|
|
97
|
+
enable-cache: true
|
|
98
|
+
|
|
99
|
+
- name: Set up Python
|
|
100
|
+
run: uv python install ${{ matrix.python-version }}
|
|
101
|
+
|
|
102
|
+
- name: Install dependencies
|
|
103
|
+
run: uv sync --all-extras --all-groups --locked --python ${{ matrix.python-version }}
|
|
104
|
+
|
|
105
|
+
- name: Run tests
|
|
106
|
+
run: |
|
|
107
|
+
if [ -d tests ]; then
|
|
108
|
+
uv run --python ${{ matrix.python-version }} pytest
|
|
109
|
+
else
|
|
110
|
+
echo "No tests directory found; skipping tests."
|
|
111
|
+
fi
|
|
112
|
+
|
|
113
|
+
coverage:
|
|
114
|
+
name: Coverage
|
|
115
|
+
needs: tests
|
|
116
|
+
runs-on: ubuntu-latest
|
|
117
|
+
steps:
|
|
118
|
+
- name: Checkout
|
|
119
|
+
uses: actions/checkout@v5
|
|
120
|
+
|
|
121
|
+
- name: Install uv
|
|
122
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
|
123
|
+
with:
|
|
124
|
+
enable-cache: true
|
|
125
|
+
|
|
126
|
+
- name: Set up Python
|
|
127
|
+
run: uv python install
|
|
128
|
+
|
|
129
|
+
- name: Install dependencies
|
|
130
|
+
run: uv sync --all-extras --all-groups --locked
|
|
131
|
+
|
|
132
|
+
- name: Run coverage
|
|
133
|
+
run: |
|
|
134
|
+
if [ -d tests ]; then
|
|
135
|
+
uv run pytest --cov=core_lens --cov-report=term-missing --cov-report=xml
|
|
136
|
+
else
|
|
137
|
+
echo "No tests directory found; skipping coverage."
|
|
138
|
+
fi
|
|
139
|
+
|
|
140
|
+
- name: Upload coverage artifact
|
|
141
|
+
if: ${{ hashFiles('coverage.xml') != '' }}
|
|
142
|
+
uses: actions/upload-artifact@v4
|
|
143
|
+
with:
|
|
144
|
+
name: coverage-xml
|
|
145
|
+
path: coverage.xml
|
|
146
|
+
|
|
147
|
+
build:
|
|
148
|
+
name: Build check
|
|
149
|
+
needs: coverage
|
|
150
|
+
runs-on: ubuntu-latest
|
|
151
|
+
steps:
|
|
152
|
+
- name: Checkout
|
|
153
|
+
uses: actions/checkout@v5
|
|
154
|
+
with:
|
|
155
|
+
fetch-depth: 0
|
|
156
|
+
|
|
157
|
+
- name: Install uv
|
|
158
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
|
159
|
+
with:
|
|
160
|
+
enable-cache: true
|
|
161
|
+
|
|
162
|
+
- name: Set up Python
|
|
163
|
+
run: uv python install
|
|
164
|
+
|
|
165
|
+
- name: Install dependencies
|
|
166
|
+
run: uv sync --group dev --locked
|
|
167
|
+
|
|
168
|
+
- name: Build package
|
|
169
|
+
run: uv build
|
|
170
|
+
|
|
171
|
+
- name: Check distribution metadata
|
|
172
|
+
run: uv run twine check dist/*
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
docs:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v5
|
|
17
|
+
|
|
18
|
+
- name: Install uv
|
|
19
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
|
20
|
+
|
|
21
|
+
- name: Set up Python
|
|
22
|
+
run: uv python install
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: uv sync --all-extras --group docs --group dev
|
|
26
|
+
|
|
27
|
+
- name: Sphinx build
|
|
28
|
+
run: |
|
|
29
|
+
uv run sphinx-build docs/source docs/build
|
|
30
|
+
|
|
31
|
+
- name: Deploy to GitHub Pages
|
|
32
|
+
uses: peaceiris/actions-gh-pages@v4
|
|
33
|
+
if: ${{ github.ref == 'refs/heads/main' }}
|
|
34
|
+
with:
|
|
35
|
+
publish_branch: gh-pages
|
|
36
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
37
|
+
publish_dir: docs/build/
|
|
38
|
+
force_orphan: true
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
name: Pre-release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*-alpha.*"
|
|
7
|
+
- "v*.*.*-beta.*"
|
|
8
|
+
- "v*.*.*-rc.*"
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: pre-release-${{ github.ref }}
|
|
15
|
+
cancel-in-progress: false
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
quality:
|
|
19
|
+
name: Lockfile, lint, types, audit
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout
|
|
23
|
+
uses: actions/checkout@v5
|
|
24
|
+
with:
|
|
25
|
+
fetch-depth: 0
|
|
26
|
+
|
|
27
|
+
- name: Install uv
|
|
28
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
|
29
|
+
with:
|
|
30
|
+
enable-cache: true
|
|
31
|
+
|
|
32
|
+
- name: Set up Python
|
|
33
|
+
run: uv python install
|
|
34
|
+
|
|
35
|
+
- name: Install dependencies
|
|
36
|
+
run: uv sync --all-extras --all-groups --locked
|
|
37
|
+
|
|
38
|
+
- name: Verify lockfile
|
|
39
|
+
run: uv lock --check
|
|
40
|
+
|
|
41
|
+
- name: Lint
|
|
42
|
+
run: uv run ruff check .
|
|
43
|
+
|
|
44
|
+
- name: Format check
|
|
45
|
+
run: uv run ruff format --check .
|
|
46
|
+
|
|
47
|
+
- name: Typecheck
|
|
48
|
+
run: uv run mypy src/core_lens
|
|
49
|
+
|
|
50
|
+
- name: Security audit
|
|
51
|
+
run: uv run pip-audit
|
|
52
|
+
|
|
53
|
+
tests:
|
|
54
|
+
name: Tests (${{ matrix.os }}, Python ${{ matrix.python-version }})
|
|
55
|
+
needs: quality
|
|
56
|
+
runs-on: ${{ matrix.os }}
|
|
57
|
+
strategy:
|
|
58
|
+
fail-fast: false
|
|
59
|
+
matrix:
|
|
60
|
+
os:
|
|
61
|
+
- ubuntu-latest
|
|
62
|
+
python-version:
|
|
63
|
+
- "3.13"
|
|
64
|
+
steps:
|
|
65
|
+
- name: Checkout
|
|
66
|
+
uses: actions/checkout@v5
|
|
67
|
+
|
|
68
|
+
- name: Install uv
|
|
69
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
|
70
|
+
with:
|
|
71
|
+
enable-cache: true
|
|
72
|
+
|
|
73
|
+
- name: Set up Python
|
|
74
|
+
run: uv python install ${{ matrix.python-version }}
|
|
75
|
+
|
|
76
|
+
- name: Install dependencies
|
|
77
|
+
run: uv sync --all-extras --all-groups --locked --python ${{ matrix.python-version }}
|
|
78
|
+
|
|
79
|
+
- name: Run tests
|
|
80
|
+
run: |
|
|
81
|
+
if [ -d tests ]; then
|
|
82
|
+
uv run --python ${{ matrix.python-version }} pytest
|
|
83
|
+
else
|
|
84
|
+
echo "No tests directory found; skipping tests."
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
coverage:
|
|
88
|
+
name: Coverage
|
|
89
|
+
needs: tests
|
|
90
|
+
runs-on: ubuntu-latest
|
|
91
|
+
steps:
|
|
92
|
+
- name: Checkout
|
|
93
|
+
uses: actions/checkout@v5
|
|
94
|
+
|
|
95
|
+
- name: Install uv
|
|
96
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
|
97
|
+
with:
|
|
98
|
+
enable-cache: true
|
|
99
|
+
|
|
100
|
+
- name: Set up Python
|
|
101
|
+
run: uv python install
|
|
102
|
+
|
|
103
|
+
- name: Install dependencies
|
|
104
|
+
run: uv sync --all-extras --all-groups --locked
|
|
105
|
+
|
|
106
|
+
- name: Run coverage
|
|
107
|
+
run: |
|
|
108
|
+
if [ -d tests ]; then
|
|
109
|
+
uv run pytest --cov=core_lens --cov-report=term-missing --cov-report=xml
|
|
110
|
+
else
|
|
111
|
+
echo "No tests directory found; skipping coverage."
|
|
112
|
+
fi
|
|
113
|
+
|
|
114
|
+
- name: Upload coverage artifact
|
|
115
|
+
if: ${{ hashFiles('coverage.xml') != '' }}
|
|
116
|
+
uses: actions/upload-artifact@v4
|
|
117
|
+
with:
|
|
118
|
+
name: coverage-xml
|
|
119
|
+
path: coverage.xml
|
|
120
|
+
|
|
121
|
+
build:
|
|
122
|
+
name: Build
|
|
123
|
+
needs: coverage
|
|
124
|
+
runs-on: ubuntu-latest
|
|
125
|
+
steps:
|
|
126
|
+
- name: Checkout
|
|
127
|
+
uses: actions/checkout@v5
|
|
128
|
+
with:
|
|
129
|
+
fetch-depth: 0
|
|
130
|
+
|
|
131
|
+
- name: Install uv
|
|
132
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
|
133
|
+
with:
|
|
134
|
+
enable-cache: true
|
|
135
|
+
|
|
136
|
+
- name: Set up Python
|
|
137
|
+
run: uv python install
|
|
138
|
+
|
|
139
|
+
- name: Install dependencies
|
|
140
|
+
run: uv sync --group dev --locked
|
|
141
|
+
|
|
142
|
+
- name: Build package
|
|
143
|
+
run: uv build
|
|
144
|
+
|
|
145
|
+
- name: Check distribution metadata
|
|
146
|
+
run: uv run twine check dist/*
|
|
147
|
+
|
|
148
|
+
- name: Upload distributions
|
|
149
|
+
uses: actions/upload-artifact@v4
|
|
150
|
+
with:
|
|
151
|
+
name: dist
|
|
152
|
+
path: dist/*
|
|
153
|
+
if-no-files-found: error
|
|
154
|
+
|
|
155
|
+
publish:
|
|
156
|
+
name: Publish to TestPyPI
|
|
157
|
+
needs: build
|
|
158
|
+
runs-on: ubuntu-latest
|
|
159
|
+
permissions:
|
|
160
|
+
id-token: write
|
|
161
|
+
steps:
|
|
162
|
+
- name: Download distributions
|
|
163
|
+
uses: actions/download-artifact@v4
|
|
164
|
+
with:
|
|
165
|
+
name: dist
|
|
166
|
+
path: dist
|
|
167
|
+
|
|
168
|
+
- name: Publish distributions
|
|
169
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
170
|
+
with:
|
|
171
|
+
repository-url: https://test.pypi.org/legacy/
|
|
172
|
+
|
|
173
|
+
github-release:
|
|
174
|
+
name: GitHub Pre-release
|
|
175
|
+
needs: publish
|
|
176
|
+
runs-on: ubuntu-latest
|
|
177
|
+
permissions:
|
|
178
|
+
contents: write
|
|
179
|
+
steps:
|
|
180
|
+
- name: Download distributions
|
|
181
|
+
uses: actions/download-artifact@v4
|
|
182
|
+
with:
|
|
183
|
+
name: dist
|
|
184
|
+
path: dist
|
|
185
|
+
|
|
186
|
+
- name: Create GitHub Pre-release
|
|
187
|
+
uses: softprops/action-gh-release@v2
|
|
188
|
+
with:
|
|
189
|
+
files: dist/*
|
|
190
|
+
generate_release_notes: true
|
|
191
|
+
prerelease: true
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: release-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: false
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
quality:
|
|
17
|
+
name: Lockfile, lint, types, audit
|
|
18
|
+
if: ${{ !contains(github.ref_name, '-') }}
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- name: Checkout
|
|
22
|
+
uses: actions/checkout@v5
|
|
23
|
+
with:
|
|
24
|
+
fetch-depth: 0
|
|
25
|
+
|
|
26
|
+
- name: Install uv
|
|
27
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
|
28
|
+
with:
|
|
29
|
+
enable-cache: true
|
|
30
|
+
|
|
31
|
+
- name: Set up Python
|
|
32
|
+
run: uv python install
|
|
33
|
+
|
|
34
|
+
- name: Install dependencies
|
|
35
|
+
run: uv sync --all-extras --all-groups --locked
|
|
36
|
+
|
|
37
|
+
- name: Verify lockfile
|
|
38
|
+
run: uv lock --check
|
|
39
|
+
|
|
40
|
+
- name: Lint
|
|
41
|
+
run: uv run ruff check .
|
|
42
|
+
|
|
43
|
+
- name: Format check
|
|
44
|
+
run: uv run ruff format --check .
|
|
45
|
+
|
|
46
|
+
- name: Typecheck
|
|
47
|
+
run: uv run mypy src/core_lens
|
|
48
|
+
|
|
49
|
+
- name: Security audit
|
|
50
|
+
run: uv run pip-audit
|
|
51
|
+
|
|
52
|
+
tests:
|
|
53
|
+
name: Tests (${{ matrix.os }}, Python ${{ matrix.python-version }})
|
|
54
|
+
needs: quality
|
|
55
|
+
runs-on: ${{ matrix.os }}
|
|
56
|
+
strategy:
|
|
57
|
+
fail-fast: false
|
|
58
|
+
matrix:
|
|
59
|
+
os:
|
|
60
|
+
- ubuntu-latest
|
|
61
|
+
python-version:
|
|
62
|
+
- "3.13"
|
|
63
|
+
steps:
|
|
64
|
+
- name: Checkout
|
|
65
|
+
uses: actions/checkout@v5
|
|
66
|
+
|
|
67
|
+
- name: Install uv
|
|
68
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
|
69
|
+
with:
|
|
70
|
+
enable-cache: true
|
|
71
|
+
|
|
72
|
+
- name: Set up Python
|
|
73
|
+
run: uv python install ${{ matrix.python-version }}
|
|
74
|
+
|
|
75
|
+
- name: Install dependencies
|
|
76
|
+
run: uv sync --all-extras --all-groups --locked --python ${{ matrix.python-version }}
|
|
77
|
+
|
|
78
|
+
- name: Run tests
|
|
79
|
+
run: |
|
|
80
|
+
if [ -d tests ]; then
|
|
81
|
+
uv run --python ${{ matrix.python-version }} pytest
|
|
82
|
+
else
|
|
83
|
+
echo "No tests directory found; skipping tests."
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
coverage:
|
|
87
|
+
name: Coverage
|
|
88
|
+
needs: tests
|
|
89
|
+
runs-on: ubuntu-latest
|
|
90
|
+
steps:
|
|
91
|
+
- name: Checkout
|
|
92
|
+
uses: actions/checkout@v5
|
|
93
|
+
|
|
94
|
+
- name: Install uv
|
|
95
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
|
96
|
+
with:
|
|
97
|
+
enable-cache: true
|
|
98
|
+
|
|
99
|
+
- name: Set up Python
|
|
100
|
+
run: uv python install
|
|
101
|
+
|
|
102
|
+
- name: Install dependencies
|
|
103
|
+
run: uv sync --all-extras --all-groups --locked
|
|
104
|
+
|
|
105
|
+
- name: Run coverage
|
|
106
|
+
run: |
|
|
107
|
+
if [ -d tests ]; then
|
|
108
|
+
uv run pytest --cov=core_lens --cov-report=term-missing --cov-report=xml
|
|
109
|
+
else
|
|
110
|
+
echo "No tests directory found; skipping coverage."
|
|
111
|
+
fi
|
|
112
|
+
|
|
113
|
+
- name: Upload coverage artifact
|
|
114
|
+
if: ${{ hashFiles('coverage.xml') != '' }}
|
|
115
|
+
uses: actions/upload-artifact@v4
|
|
116
|
+
with:
|
|
117
|
+
name: coverage-xml
|
|
118
|
+
path: coverage.xml
|
|
119
|
+
|
|
120
|
+
build:
|
|
121
|
+
name: Build
|
|
122
|
+
needs: coverage
|
|
123
|
+
runs-on: ubuntu-latest
|
|
124
|
+
steps:
|
|
125
|
+
- name: Checkout
|
|
126
|
+
uses: actions/checkout@v5
|
|
127
|
+
with:
|
|
128
|
+
fetch-depth: 0
|
|
129
|
+
|
|
130
|
+
- name: Install uv
|
|
131
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
|
132
|
+
with:
|
|
133
|
+
enable-cache: true
|
|
134
|
+
|
|
135
|
+
- name: Set up Python
|
|
136
|
+
run: uv python install
|
|
137
|
+
|
|
138
|
+
- name: Install dependencies
|
|
139
|
+
run: uv sync --group dev --locked
|
|
140
|
+
|
|
141
|
+
- name: Build package
|
|
142
|
+
run: uv build
|
|
143
|
+
|
|
144
|
+
- name: Check distribution metadata
|
|
145
|
+
run: uv run twine check dist/*
|
|
146
|
+
|
|
147
|
+
- name: Upload distributions
|
|
148
|
+
uses: actions/upload-artifact@v4
|
|
149
|
+
with:
|
|
150
|
+
name: dist
|
|
151
|
+
path: dist/*
|
|
152
|
+
if-no-files-found: error
|
|
153
|
+
|
|
154
|
+
publish:
|
|
155
|
+
name: Publish to PyPI
|
|
156
|
+
needs: build
|
|
157
|
+
runs-on: ubuntu-latest
|
|
158
|
+
environment: pypi
|
|
159
|
+
permissions:
|
|
160
|
+
id-token: write
|
|
161
|
+
steps:
|
|
162
|
+
- name: Download distributions
|
|
163
|
+
uses: actions/download-artifact@v4
|
|
164
|
+
with:
|
|
165
|
+
name: dist
|
|
166
|
+
path: dist
|
|
167
|
+
|
|
168
|
+
- name: Publish distributions
|
|
169
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
170
|
+
|
|
171
|
+
github-release:
|
|
172
|
+
name: GitHub Release
|
|
173
|
+
needs: publish
|
|
174
|
+
runs-on: ubuntu-latest
|
|
175
|
+
permissions:
|
|
176
|
+
contents: write
|
|
177
|
+
steps:
|
|
178
|
+
- name: Download distributions
|
|
179
|
+
uses: actions/download-artifact@v4
|
|
180
|
+
with:
|
|
181
|
+
name: dist
|
|
182
|
+
path: dist
|
|
183
|
+
|
|
184
|
+
- name: Create GitHub Release
|
|
185
|
+
uses: softprops/action-gh-release@v2
|
|
186
|
+
with:
|
|
187
|
+
files: dist/*
|
|
188
|
+
generate_release_notes: true
|