Skip to content

Commit 4bc688d

Browse files
authored
MIgrate to uv (#99)
1 parent 954c61a commit 4bc688d

File tree

8 files changed

+280
-301
lines changed

8 files changed

+280
-301
lines changed

.github/workflows/lint.yml

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,20 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515

16-
- uses: actions/setup-python@v5
16+
- name: Setup uv
17+
uses: astral-sh/setup-uv@v4
1718
with:
18-
python-version: 3.8
19-
20-
- name: Install poetry
21-
run: |
22-
python -m pip install --upgrade pip
23-
pip install poetry
24-
poetry config virtualenvs.in-project true
25-
- name: Set up cache
26-
uses: actions/cache@v4
27-
id: cache
28-
with:
29-
path: .venv
30-
key: venv-lint-${{ hashFiles('**/poetry.lock') }}
31-
32-
- name: Ensure cache is healthy
33-
if: steps.cache.outputs.cache-hit == 'true'
34-
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
19+
version: "latest"
20+
enable-cache: true
3521

3622
- name: Install dependencies
37-
run: poetry install
38-
39-
- name: Check poetry.lock
40-
run: poetry lock --check
23+
run: uv sync
4124

4225
# - name: pyright
4326
# run: poetry run pyright .
4427

4528
- name: ruff-format
46-
run: poetry run ruff format --check .
29+
run: uv run ruff format --check .
4730

4831
- name: ruff
49-
run: poetry run ruff check --output-format github .
32+
run: uv run ruff check --output-format github .

.github/workflows/test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@ jobs:
2020
- name: Pull QGIS image
2121
run: docker pull qgis/qgis:${{ matrix.qgis_image_tag }}
2222

23+
- name: Setup uv
24+
uses: astral-sh/setup-uv@v4
25+
with:
26+
version: "latest"
27+
enable-cache: true
28+
2329
- name: Export requirements.txt
2430
run: |
25-
pip3 install poetry
26-
poetry export --with dev -f requirements.txt -o requirements.txt
31+
uv export --extra dev > requirements.txt
2732
2833
- name: Run tests
2934
run: >

.pre-commit-config.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ help:
2929

3030
init: ## Startup project
3131
ifeq ($(OS),Windows_NT)
32-
$(QGIS_PYTHON) -m pip install poetry
33-
$(QGIS_PYTHON) -m poetry config --local virtualenvs.in-project true
34-
$(QGIS_PYTHON) -m poetry install
32+
$(QGIS_PYTHON) -m pip install uv
33+
$(QGIS_PYTHON) -m uv venv --python $(QGIS_PYTHON) --system-site-packages
34+
$(QGIS_PYTHON) -m uv sync
3535
$(QGIS_PYTHON) -c "import pathlib;import qgis;open('.venv/Lib/site-packages/qgis.pth', 'w').write(str((pathlib.Path(qgis.__file__)/'../..').resolve()) + '\n' + str((pathlib.Path(qgis.__file__)/'../../plugins').resolve()))"
3636
else
37-
poetry env use $(QGIS_PYTHON)
38-
poetry install
37+
uv venv --python $(QGIS_PYTHON) --system-site-packages
38+
uv sync
3939
echo $(QGIS_STD_PLUGINS) > .venv/lib/python3.9/site-packages/qgis_std_plugins.pth
4040
endif
4141

@@ -52,9 +52,9 @@ package: ## Build zip package
5252

5353
test: ## Test
5454
ifeq ($(OS),Windows_NT)
55-
$(QGIS_PYTHON) -m poetry run python -c "import os; os.add_dll_directory(r'${QGIS_DLL}'); import pytest; pytest.main('-v --cov --cov-report=term'.split())"
55+
$(QGIS_PYTHON) -m uv run python -c "import os; os.add_dll_directory(r'${QGIS_DLL}'); import pytest; pytest.main('-v --cov --cov-report=term'.split())"
5656
else
57-
poetry run pytest -v --cov --cov-report=term
57+
uv run pytest -v --cov --cov-report=term
5858
endif
5959

6060
update-deps: ## Update mojxml library

poetry.lock

Lines changed: 0 additions & 226 deletions
This file was deleted.

poetry.toml

Lines changed: 0 additions & 4 deletions
This file was deleted.

pyproject.toml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
1-
[tool.poetry]
1+
[project]
22
name = "qgis-mojxml-plugin"
33
version = "0.0.0"
4-
description = "A QGIS plugin for converting Japanese “MOJ Map XML” (land registration polygons in Japan) into geospatial formats."
54
authors = [
6-
"MIERUNE Inc. <[email protected]>",
7-
"Taku Fukada <[email protected]>",
5+
{ name = "Taku Fukada", email = "[email protected]" },
6+
{ name = "MIERUNE Inc.", email = "[email protected]" },
87
]
8+
description = "A QGIS plugin to load Japanese “MOJ Map XML” (land registration polygons in Japan)."
99
readme = "README.md"
10-
packages = [{ include = "mojxml_plugin" }]
10+
requires-python = ">=3.9"
1111

12-
[tool.poetry.dependencies]
13-
python = ">=3.8.1,<4.0"
14-
15-
[tool.poetry.group.dev.dependencies]
16-
pytest = "^8.2.2"
17-
pytest-cov = "^5.0.0"
18-
pyqt5-stubs = "^5.15.6.0"
19-
ruff = "^0.4.9"
20-
21-
[build-system]
22-
requires = ["poetry-core"]
23-
build-backend = "poetry.core.masonry.api"
12+
[dependency-groups]
13+
dev = [
14+
"pyqt5-stubs>=5.15.6.0",
15+
"pytest-cov>=6.0.0",
16+
"pytest>=8.3.4",
17+
"ruff>=0.8.1",
18+
]
2419

2520
[tool.pytest.ini_options]
2621
pythonpath = "."

0 commit comments

Comments
 (0)