Skip to content

Commit eaedc35

Browse files
authored
feat: restructuring loopstructural
LoopStructural 1.7
2 parents f710193 + 57e9ddb commit eaedc35

314 files changed

Lines changed: 43970 additions & 5419 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/linter.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ on:
1313
workflow_dispatch:
1414

1515
env:
16-
PROJECT_FOLDER: "LoopStructural"
16+
# All linted packages in the workspace: the main library plus every
17+
# package under packages/ (packages/loop_common, packages/loop_interpolation, ...).
18+
PROJECT_FOLDERS: "LoopStructural packages"
1719
PYTHON_VERSION: 3.9
1820
permissions:
1921
contents: write
@@ -43,7 +45,7 @@ jobs:
4345
black .
4446
- name: Lint with ruff
4547
run: |
46-
ruff check ${{env.PROJECT_FOLDER}} --fix
48+
ruff check ${{ env.PROJECT_FOLDERS }} --fix --exit-zero
4749
- uses: stefanzweifel/git-auto-commit-action@v5
4850
with:
4951
commit_message: "style: style fixes by ruff and autoformatting by black"

‎.github/workflows/packages.yml‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: "📦 Workspace packages"
2+
3+
# Stage 2 of ROADMAP.md (outcome 2): loop_common/loop_interpolation live under
4+
# packages/ as independent uv-workspace members so the interpolation code is
5+
# usable outside the LoopStructural framework. This job installs and tests
6+
# them on their own, separately from the root LoopStructural test suite in
7+
# tester.yml. loopstructural-test waits on packages-test (needs:) so the root
8+
# suite only runs once loop_common/loop_interpolation are confirmed working.
9+
10+
on:
11+
push:
12+
branches:
13+
- master
14+
paths:
15+
- 'packages/**'
16+
- .github/workflows/packages.yml
17+
pull_request:
18+
branches:
19+
- master
20+
paths:
21+
- 'packages/**'
22+
- .github/workflows/packages.yml
23+
workflow_dispatch:
24+
25+
permissions:
26+
contents: read
27+
28+
jobs:
29+
packages-test:
30+
name: ${{ matrix.package }} (python ${{ matrix.python-version }})
31+
runs-on: ${{ matrix.os }}
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
package: [loop_common, loop_interpolation]
36+
os: ${{ fromJSON(vars.BUILD_OS)}}
37+
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- name: Set up uv
42+
uses: astral-sh/setup-uv@v3
43+
with:
44+
version: "latest"
45+
46+
- name: Set up Python ${{ matrix.python-version }}
47+
run: uv python install ${{ matrix.python-version }}
48+
49+
- name: Install package with test extras
50+
run: |
51+
uv sync --package ${{ matrix.package }} --extra tests --python ${{ matrix.python-version }}
52+
53+
- name: pytest
54+
run: |
55+
uv run pytest packages/${{ matrix.package }}/tests
56+
loopstructural-test:
57+
name: LoopStructural (python ${{ matrix.python-version }})
58+
needs: packages-test
59+
runs-on: ${{ matrix.os }}
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
os: ${{ fromJSON(vars.BUILD_OS)}}
64+
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
65+
steps:
66+
- uses: actions/checkout@v4
67+
68+
- name: Set up uv
69+
uses: astral-sh/setup-uv@v3
70+
with:
71+
version: "latest"
72+
73+
- name: Set up Python ${{ matrix.python-version }}
74+
run: uv python install ${{ matrix.python-version }}
75+
76+
- name: Install package with test extras
77+
run: |
78+
uv sync --extra tests --python ${{ matrix.python-version }}
79+
80+
- name: pytest
81+
run: |
82+
uv run pytest tests

‎.github/workflows/pypi.yml‎

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,53 @@ name: "📦 PyPI "
22
on:
33
workflow_dispatch:
44

5+
permissions:
6+
contents: read
7+
58
jobs:
9+
# loop_common/loop_interpolation (ROADMAP.md Stage 2) are workspace-local
10+
# deps of LoopStructural (see [tool.uv.sources] in pyproject.toml). They
11+
# must land on PyPI before the LoopStructural sdist below is uploaded, or
12+
# `pip install LoopStructural` breaks for anyone not using uv.
13+
make_sdist_packages:
14+
name: Make SDist (${{ matrix.package }})
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
package: [loop_common, loop_interpolation]
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Build SDist
23+
working-directory: packages/${{ matrix.package }}
24+
run: |
25+
pip install build
26+
python -m build
27+
28+
- uses: actions/upload-artifact@v4
29+
with:
30+
name: dist-${{ matrix.package }}
31+
path: packages/${{ matrix.package }}/dist/
32+
33+
upload_packages_to_pypi:
34+
name: Upload ${{ matrix.package }} to PyPI
35+
needs: ["make_sdist_packages"]
36+
runs-on: "ubuntu-latest"
37+
strategy:
38+
matrix:
39+
package: [loop_common, loop_interpolation]
40+
steps:
41+
- uses: actions/download-artifact@v4
42+
with:
43+
name: dist-${{ matrix.package }}
44+
path: dist
45+
- uses: pypa/gh-action-pypi-publish@release/v1
46+
with:
47+
skip_existing: true
48+
verbose: true
49+
user: ${{ secrets.PYPI_USERNAME }}
50+
password: ${{ secrets.PYPI_PASSWORD }}
51+
652
make_sdist:
753
name: Make SDist
854
runs-on: ubuntu-latest
@@ -20,7 +66,7 @@ jobs:
2066
path: dist/
2167

2268
upload_to_pypi:
23-
needs: ["make_sdist"]
69+
needs: ["make_sdist", "upload_packages_to_pypi"]
2470
runs-on: "ubuntu-latest"
2571

2672
steps:

‎.github/workflows/qgis-compat.yml‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: "🔌 QGIS plugin compat"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- '**.py'
9+
- .github/workflows/qgis-compat.yml
10+
pull_request:
11+
branches:
12+
- master
13+
paths:
14+
- '**.py'
15+
- .github/workflows/qgis-compat.yml
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
qgis-plugin-compat:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout LoopStructural
26+
uses: actions/checkout@v4
27+
with:
28+
path: LoopStructural
29+
30+
- name: Checkout LoopStructural QGIS plugin
31+
uses: actions/checkout@v4
32+
with:
33+
repository: Loop3D/plugin_loopstructural
34+
path: plugin_loopstructural
35+
36+
- name: Set up uv and Python
37+
uses: astral-sh/setup-uv@v5
38+
with:
39+
python-version: "3.9"
40+
enable-cache: true
41+
42+
- name: Install plugin's non-QGIS test requirements
43+
run: |
44+
uv pip install -r plugin_loopstructural/requirements/testing.txt
45+
uv pip install pydantic eval-type-backport
46+
47+
- name: Install this branch's LoopStructural over the pinned version
48+
run: |
49+
uv pip install --no-deps -e ./LoopStructural/packages/loop_common
50+
uv pip install --no-deps -e ./LoopStructural/packages/loop_interpolation
51+
uv pip install --no-deps -e ./LoopStructural
52+
uv pip install pytest
53+
54+
- name: Import/symbol smoke check on paths the plugin relies on
55+
working-directory: LoopStructural
56+
run: |
57+
uv run pytest tests/unit/test_stable_api_surface.py -v
58+
59+
- name: Run plugin unit tests (non-QGIS) against this branch
60+
working-directory: plugin_loopstructural
61+
run: |
62+
uv run pytest -p no:qgis tests/unit/

‎.github/workflows/release-please.yml‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,16 @@ jobs:
1818
id: release
1919
with:
2020
path: LoopStructural
21-
21+
2222
outputs:
23+
# true if ANY configured component (LoopStructural, loop_common,
24+
# loop_interpolation) released -- gates the pypi.yml trigger, since a
25+
# solo loop_common/loop_interpolation bump still needs publishing.
2326
release_created: ${{ steps.release.outputs.releases_created }}
27+
# true only when the LoopStructural component itself released --
28+
# gates conda/docs builds, which are LoopStructural-specific and
29+
# shouldn't re-run for a workspace-package-only release.
30+
loopstructural_release_created: ${{ steps.release.outputs['LoopStructural--release_created'] }}
2431
package:
2532
needs: release-please
2633
if: ${{ needs.release-please.outputs.release_created == 'true'}}
@@ -34,6 +41,7 @@ jobs:
3441
https://api.github.com/repos/Loop3d/${{env.PACKAGE_NAME}}/actions/workflows/pypi.yml/dispatches \
3542
-d '{"ref":"master"}'
3643
- name: Trigger build for conda and upload
44+
if: ${{ needs.release-please.outputs.loopstructural_release_created == 'true' }}
3745
run: |
3846
curl -X POST \
3947
-H "Authorization: token ${{ secrets.GH_PAT }}" \
@@ -42,9 +50,10 @@ jobs:
4250
-d '{"ref":"master"}'
4351
4452
- name: Trigger build documentation
53+
if: ${{ needs.release-please.outputs.loopstructural_release_created == 'true' }}
4554
run: |
4655
curl -X POST \
4756
-H "Authorization: token ${{ secrets.GH_PAT }}" \
4857
-H "Accept: application/vnd.github.v3+json" \
4958
https://api.github.com/repos/Loop3d/${{env.PACKAGE_NAME}}/actions/workflows/documentation.yml/dispatches \
50-
-d '{"ref":"master"}'
59+
-d '{"ref":"master"}'

‎.pre-commit-config.yaml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 24.10.0
4+
hooks:
5+
- id: black
6+
7+
- repo: https://github.com/astral-sh/ruff-pre-commit
8+
rev: v0.15.22
9+
hooks:
10+
- id: ruff
11+
args: [--fix, --exit-non-zero-on-fix]

‎.release-please-manifest.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"LoopStructural": "1.6.28"
2+
"LoopStructural": "1.6.28",
3+
"packages/loop_common": "0.1.0",
4+
"packages/loop_interpolation": "0.1.0"
5+
36
}

0 commit comments

Comments
 (0)