Skip to content

Commit

Permalink
chore: Migrate to uv (#52)
Browse files Browse the repository at this point in the history
* 100m grid

* Migrate to uv
  • Loading branch information
ciscorn authored Feb 2, 2025
1 parent d8d7244 commit 276bc47
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 280 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PACKAGE_NAME = japanese_grids

# Use this Git ref for packaging
# Use this tag for packaging
VERSION = HEAD

# Windows (OSGeo4W)
Expand Down Expand Up @@ -29,13 +29,13 @@ help:

init: ## Startup project
ifeq ($(OS),Windows_NT)
$(QGIS_PYTHON) -m pip install poetry
$(QGIS_PYTHON) -m poetry config --local virtualenvs.in-project true
$(QGIS_PYTHON) -m poetry install
$(QGIS_PYTHON) -m pip install uv
$(QGIS_PYTHON) -m uv venv --python $(QGIS_PYTHON) --system-site-packages
$(QGIS_PYTHON) -m uv sync
$(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()))"
else
poetry env use $(QGIS_PYTHON)
poetry install
uv venv --python $(QGIS_PYTHON) --system-site-packages
uv sync
echo $(QGIS_STD_PLUGINS) > .venv/lib/python3.9/site-packages/qgis_std_plugins.pth
endif

Expand All @@ -52,7 +52,7 @@ package: ## Build zip package

test: ## Test
ifeq ($(OS),Windows_NT)
$(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())"
$(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())"
else
poetry run pytest -v --cov --cov-report=term
uv run pytest -v --cov --cov-report=term
endif
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![Test](https://github.com/MIERUNE/qgis-japan-mesh/actions/workflows/test.yml/badge.svg)](https://github.com/MIERUNE/qgis-japan-mesh/actions/workflows/test.yml)

A QGIS Plugin to handle common Japanese grid square codes — 日本で使われている「標準地域メッシュ」と「国土基本図図郭」を QGIS で扱うためのプラグインです。
A QGIS Plugin to handle common Japanese grid squares — 日本で使われている「標準地域メッシュ」と「国土基本図図郭」を QGIS で扱うためのプラグインです。

![image](./docs/image.jpeg)

Expand Down Expand Up @@ -45,4 +45,3 @@ make deploy

- Taku Fukada ([@ciscorn](https://github.com/ciscorn)) - Original Author
- And all contributors

226 changes: 0 additions & 226 deletions poetry.lock

This file was deleted.

2 changes: 0 additions & 2 deletions poetry.toml

This file was deleted.

57 changes: 15 additions & 42 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,56 +1,29 @@
[tool.poetry]
name = "japanese_grids"
[project]
name = "qgis-japan-mesh"
version = "0.0.0"
description = ""
authors = [
"MIERUNE Inc. <[email protected]>",
"Taku Fukada <[email protected]>",
]
authors = [{ name = "Taku Fukada", email = "[email protected]" }]
readme = "README.md"
packages = [{ include = "japanese_grids" }]

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"

[tool.poetry.group.dev.dependencies]
pytest = "^8.2"
pytest-cov = "^5.0"
pyqt5-stubs = "^5.15"
ruff = "^0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires-python = ">=3.9"

[dependency-groups]
dev = [
"pyqt5-stubs>=5.15.6.0",
"pytest-cov>=6.0.0",
"pytest>=8.3.4",
"ruff>=0.8.1",
]

[tool.pytest.ini_options]
pythonpath = "."
addopts = ["--import-mode=importlib"]
# filterwarnings = "ignore::DeprecationWarning"

[tool.ruff]
target-version = "py38"

[tool.ruff.lint]
select = [
"F",
"E",
"W",
"B",
"N",
"UP",
"I",
"C90",
"C4",
"DTZ",
"PIE",
"PT",
"Q",
"SIM",
"RUF",
]
ignore = ["N802", "E501", "RUF001"]

select = ["F", "E", "W", "B", "C90", "N", "I"]
ignore = ["N802", "E501"]

[tool.coverage.run]
source = ['japanese_grids']
# concurrency = ["thread"]
concurrency = ["thread"]

0 comments on commit 276bc47

Please sign in to comment.