Skip to content

Commit 0eec588

Browse files
committed
Migrate to uv
1 parent 402d624 commit 0eec588

File tree

8 files changed

+599
-676
lines changed

8 files changed

+599
-676
lines changed

.github/workflows/lint.yml

+10-12
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,23 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414

15-
- name: Install poetry
16-
run: python -m pip install poetry
15+
- name: Install dependencies
16+
run: sudo apt-get update -y && sudo apt-get install gdal-bin
1717

18-
- uses: actions/setup-python@v5
18+
- name: Setup uv
19+
uses: astral-sh/setup-uv@v4
1920
with:
20-
python-version: '3.11'
21-
cache: "poetry"
21+
version: "latest"
22+
enable-cache: true
2223

2324
- name: Install dependencies
24-
run: poetry install
25-
26-
- name: Check poetry.lock
27-
run: poetry lock --check
25+
run: uv sync
2826

2927
- name: Type-check with Pyright
30-
run: poetry run pyright .
28+
run: uv run pyright .
3129

3230
- name: Lint with ruff
33-
run: poetry run ruff check --output-format=github .
31+
run: uv run ruff check --output-format=github .
3432

3533
- name: Format with ruff
36-
run: poetry run ruff format .
34+
run: uv run ruff format .

.github/workflows/test.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919

20-
- name: Install poetry
21-
run: python -m pip install poetry
20+
- name: Install dependencies
21+
run: sudo apt-get update -y && sudo apt-get install gdal-bin
2222

23-
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v5
23+
- name: Setup uv
24+
uses: astral-sh/setup-uv@v4
2525
with:
26-
python-version: ${{ matrix.python-version }}
27-
cache: "poetry"
26+
version: "latest"
27+
enable-cache: true
2828

2929
- name: Install dependencies
30-
run: poetry install
30+
run: uv sync
3131

3232
- name: Run pytest
33-
run: poetry run pytest -v --cov --cov-report xml --cov-report term
33+
run: uv run pytest -v --cov --cov-report xml --cov-report term
3434

3535
- name: Upload coverage
3636
uses: codecov/codecov-action@v4

Makefile

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
.PHONY: help init run test
22

33
init: ## 初期化
4-
poetry install
5-
pre-commit install
4+
uv sync
65

76
run: ## 実行
8-
poetry run time python3 -m mojxml testdata/15222-1107-1553.xml
7+
uv run time python3 -m mojxml testdata/15222-1107-1553.xml
98

109
test: ## テスト
11-
poetry run pytest -v --cov --cov-report xml --cov-report html --cov-report term
10+
uv run pytest -v --cov --cov-report xml --cov-report html --cov-report term

poetry.lock

-629
This file was deleted.

pyproject.toml

+31-23
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,55 @@
1-
[tool.poetry]
1+
[project]
22
name = "mojxml"
33
version = "0.5.1"
44
description = 'A tool for fast conversion of Japanese "MOJ Map XML" (land registration polygons) into geospatial formats.'
5-
authors = ["MIERUNE Inc. <[email protected]>"]
5+
authors = [
6+
{ name = "Taku Fukada", email = "[email protected]" },
7+
{ name = "MIERUNE Inc.", email = "[email protected]" },
8+
]
69
readme = "README.md"
7-
homepage = "https://github.com/MIERUNE/mojxml-py"
8-
repository = "https://github.com/MIERUNE/mojxml-py"
910
license = "MIT"
10-
packages = [{ include = "mojxml", from = "src" }]
1111
classifiers = [
1212
"Operating System :: OS Independent",
1313
"Intended Audience :: Developers",
1414
"Topic :: Software Development :: Libraries :: Python Modules",
1515
"Topic :: Scientific/Engineering :: GIS",
1616
"Intended Audience :: Science/Research",
1717
]
18+
requires-python = ">=3.9.0"
19+
dependencies = [
20+
"lxml>=4.9.2",
21+
"fiona>=1.10.0",
22+
"click>=8.1.8",
23+
"pyproj>=3.6.1",
24+
]
1825

19-
[tool.poetry.scripts]
20-
mojxml2ogr = 'mojxml.__main__:main'
26+
[project.urls]
27+
Homepage = "https://github.com/MIERUNE/mojxml-py"
28+
Repository = "https://github.com/MIERUNE/mojxml-py"
2129

22-
[tool.poetry.dependencies]
23-
python = ">=3.9,<4.0"
24-
lxml = ">=4.9.2,<6.0.0"
25-
fiona = "^1.9.1"
26-
click = "^8.1.3"
27-
pyproj = "^3.6.1"
30+
[project.scripts]
31+
mojxml2ogr = 'mojxml.__main__:main'
2832

29-
[tool.poetry.group.dev.dependencies]
30-
pytest = ">=7.4,<9.0"
31-
pytest-cov = ">=4,<6"
32-
pyright = "^1.1"
33-
ruff = ">=0.1,<0.5"
33+
[dependency-groups]
34+
dev = [
35+
"pyqt5-stubs>=5.15.6.0",
36+
"pytest-cov>=6.0.0",
37+
"pytest>=8.3.4",
38+
"ruff>=0.9.3",
39+
"pyright>=1.1.392.post0",
40+
]
3441

3542
[build-system]
36-
requires = ["poetry-core"]
37-
build-backend = "poetry.core.masonry.api"
43+
requires = ["hatchling"]
44+
build-backend = "hatchling.build"
3845

3946
[tool.ruff]
40-
select = ["F", "E", "W", "B", "N", "I", "UP", "C90", "ANN"]
41-
ignore = ["ANN101"]
4247
target-version = "py38"
4348

44-
[tool.ruff.per-file-ignores]
49+
[tool.ruff.lint]
50+
select = ["F", "E", "W", "B", "N", "I", "UP", "C90", "ANN"]
51+
52+
[tool.ruff.lint.per-file-ignores]
4553
"tests/*" = ["ANN"]
4654

4755
[tool.pyright]

tests/test_main.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Tests for __main__.py."""
22

33
from click.testing import CliRunner
4+
45
from mojxml.__main__ import main
56

67

tests/test_reader.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from pathlib import Path
44

55
import pytest
6+
67
from mojxml.reader import iter_content_xmls
78

89

uv.lock

+545
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)