Skip to content

Commit c3e8d05

Browse files
committed
mirgrate to uv and also allow py314
1 parent 3db2e25 commit c3e8d05

15 files changed

Lines changed: 5218 additions & 3989 deletions

File tree

‎.github/workflows/documentation.yml‎

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,45 +22,18 @@ jobs:
2222
docker-images: true
2323
swap-storage: true
2424

25-
- name: Set up Python 3.10
26-
uses: actions/setup-python@v5
25+
- name: Install uv and set Python 3.10
26+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
2727
with:
28+
version: "0.11.32"
2829
python-version: "3.10"
29-
architecture: "x64"
30+
enable-cache: true
3031

31-
- name: Show Python
32-
run: |
33-
python --version
34-
which python
35-
36-
- name: Setup PDM
37-
uses: pdm-project/setup-pdm@v4
38-
with:
39-
python-version: "3.10"
40-
cache: true
41-
42-
- name: Make PDM use this Python
43-
run: |
44-
pdm use -f "$(python -c 'import sys; print(sys.executable)')"
45-
pdm info
46-
47-
- name: Install dependencies into PDM venv
48-
run: |
49-
pdm sync -d
50-
51-
# 🔧 Add pip to the PDM venv
52-
- name: Ensure pip is available in the PDM venv
53-
run: |
54-
pdm run python -m ensurepip --upgrade
55-
56-
# Install your package (editable) so Sphinx/autodoc can import it
57-
- name: Install project (editable) into PDM venv
58-
run: |
59-
pdm run pip install -e .
32+
- name: Install locked documentation dependencies
33+
run: uv sync --locked --no-default-groups --group doc
6034

6135
- name: Sphinx build
62-
run: |
63-
pdm run doc
36+
run: uv run --no-sync sphinx-build docs docs/_build/html
6437

6538
- name: Deploy to GitHub Pages
6639
uses: peaceiris/actions-gh-pages@v3

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

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3-
4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
1+
# This workflow builds and publishes the package when a release is created.
82

93
name: Upload Python Package
104

@@ -20,14 +14,34 @@ jobs:
2014
name: upload release to PyPI
2115
runs-on: ubuntu-latest
2216
permissions:
23-
# This permission is needed for private repositories.
2417
contents: read
25-
# IMPORTANT: this permission is mandatory for trusted publishing
2618
id-token: write
2719
steps:
28-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
21+
22+
- name: Install uv and set Python 3.14
23+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
24+
with:
25+
version: "0.11.32"
26+
python-version: "3.14"
27+
28+
- name: Build package distributions
29+
run: uv build --no-sources
30+
31+
- name: Smoke-test wheel
32+
run: |
33+
uv venv "${RUNNER_TEMP}/landmarker-wheel-smoke"
34+
uv pip install --python "${RUNNER_TEMP}/landmarker-wheel-smoke/bin/python" --no-deps dist/*.whl
35+
"${RUNNER_TEMP}/landmarker-wheel-smoke/bin/python" -c "import landmarker; print(landmarker.__version__)"
36+
37+
- name: Smoke-test source distribution
38+
run: |
39+
uv venv "${RUNNER_TEMP}/landmarker-sdist-smoke"
40+
uv pip install --python "${RUNNER_TEMP}/landmarker-sdist-smoke/bin/python" --no-deps dist/*.tar.gz
41+
"${RUNNER_TEMP}/landmarker-sdist-smoke/bin/python" -c "import landmarker; print(landmarker.__version__)"
2942
30-
- uses: pdm-project/setup-pdm@v3
43+
- name: Validate package publication
44+
run: uv publish --dry-run --trusted-publishing never
3145

3246
- name: Publish package distributions to PyPI
33-
run: pdm publish
47+
run: uv publish --trusted-publishing always

‎.github/workflows/tests.yml‎

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,25 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python-version: ["3.10", "3.11", "3.12", "3.13"]
15+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1616

1717
steps:
1818
- uses: actions/checkout@v4
1919

20-
- name: Set up Python & PDM ${{ matrix.python-version }}
21-
uses: pdm-project/setup-pdm@v4
20+
- name: Install uv and set Python ${{ matrix.python-version }}
21+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
2222
with:
23+
version: "0.11.32"
2324
python-version: ${{ matrix.python-version }}
24-
cache: true
25+
enable-cache: true
2526

2627
- name: System packages
2728
run: |
2829
sudo apt-get update
2930
sudo apt-get install -y ffmpeg libsm6 libxext6 libopenblas-dev libzmq3-dev
3031
31-
# Make sure PDM points at the interpreter in this job
32-
- name: Ensure PDM uses this interpreter
33-
run: pdm use -f $(python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')}")
34-
35-
# On 3.13/3.14, refresh the lock for this Python so we get cp313/cp314 wheels
36-
- name: Refresh lockfile on 3.13/3.14
37-
if: matrix.python-version == '3.13' || matrix.python-version == '3.14'
38-
run: pdm lock --refresh
39-
40-
# Let PDM handle installing the project + dev deps
41-
- name: Install deps (PDM)
42-
run: pdm sync -d
32+
- name: Install locked test dependencies
33+
run: uv sync --locked --no-default-groups --group test
4334

4435
- name: Test with pytest
45-
run: pdm run pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml
36+
run: uv run --no-sync pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml

‎.gitignore‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ iframe_figures/*
1717
.DS_Store
1818
.directory
1919
.tox
20+
.venv/
2021
.mypy_cache
2122
examples/data
2223
test_notebooks
@@ -44,16 +45,14 @@ build/*
4445
dist/*
4546
sdist/*
4647
wheel/*
47-
.pdm-build
4848
docs/_build/*
4949
cover/*
5050
MANIFEST
51-
.pdm-python
5251

5352
# example files
5453
examples/configs/*
5554
examples/datasets/*
5655
examples/lightning_logs/*
5756
examples/lightning_models/*
5857
examples/main.py
59-
*model_checkpoints/*
58+
*model_checkpoints/*

‎CONTRIBUTING.md‎

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,46 @@ For more information on contributing to open source projects, [GitHub's own guid
1313

1414
## Setting up your development environment
1515

16-
To get started, fork the `landmarker` repository and clone it to your local machine. Then, install the required dependencies using <a href="https://pdm.fming.dev/" target="_blank">pdm</a> (see <a href="https://pdm-project.org/latest/#installation" target="_blank">installation instructions</a>):
16+
To get started, fork the `landmarker` repository and clone it to your local machine. Then, install the required dependencies using <a href="https://docs.astral.sh/uv/" target="_blank">uv</a> (see <a href="https://docs.astral.sh/uv/getting-started/installation/" target="_blank">installation instructions</a>):
1717

1818
```bash
19-
pdm install --dev
19+
uv sync
2020
```
2121

2222
## Running tests
23-
`landmarker` uses [pytest](https://docs.pytest.org/en/stable/) for testing. You can run test by running a pdm script, by using the following command:
23+
`landmarker` uses [pytest](https://docs.pytest.org/en/stable/) for testing. Coverage reporting is enabled by default:
2424

2525
```bash
26-
pdm run test
26+
uv run pytest
2727
```
2828

29-
If you want to run pytest with coverage, you can use the following command:
29+
To run the complete test matrix across all supported Python versions, as well as the lint and type-check environments, use tox:
3030

3131
```bash
32-
pdm run coverage
32+
uv run tox
33+
```
34+
35+
You can also run the lint and type checks directly:
36+
37+
```bash
38+
uv run flake8 src/
39+
uv run mypy src/
3340
```
3441

3542
## Building documentation
3643
`landmarker` uses [sphinx](https://www.sphinx-doc.org/en/master/) for documentation, and use MyST markdown for documentation pages. You can build the documentation locally by running the following command:
3744

3845
```bash
39-
pdm run doc
46+
uv run sphinx-build docs docs/_build/html
4047
```
4148

4249
We also support the use of [sphinx-autobuild](https://github.com/executablebooks/sphinx-autobuild), which will automatically rebuild the documentation when a change is detected and live-reload the page in your browser. You can run it using the following command:
4350

4451
```bash
45-
pdm run docauto
52+
uv run sphinx-autobuild docs docs/_build/html --ignore _collections
4653
```
4754

4855
## Ground Rules
4956
The goal is to maintain a diverse community that's pleasant for everyone.
5057
**Please be considerate and respectful of others**.
51-
Everyone must abide by our [Code of Conduct](https://github.com/GenericMappingTools/.github/blob/main/CODE_OF_CONDUCT.md) and we encourage all to read it carefully.
58+
Everyone must abide by our [Code of Conduct](https://github.com/GenericMappingTools/.github/blob/main/CODE_OF_CONDUCT.md) and we encourage all to read it carefully.

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</p>
66

77
[![PyPI Latest Release](https://img.shields.io/pypi/v/landmarker.svg)](https://pypi.org/project/landmarker/)
8-
[![support-version](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)](https://pypi.org/project/landmarker/)
8+
[![support-version](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue)](https://pypi.org/project/landmarker/)
99
[![codecov](https://img.shields.io/codecov/c/github/predict-idlab/landmarker?logo=codecov)](https://codecov.io/gh/predict-idlab/landmarker)
1010
[![CodeQL](https://github.com/predict-idlab/landmarker/actions/workflows/codeql.yml/badge.svg)](https://github.com/predict-idlab/landmarker/actions/workflows/codeql.yml)
1111
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?)](http://makeapullrequest.com)

0 commit comments

Comments
 (0)