Skip to content

Commit 36a865f

Browse files
authored
Merge pull request #190 from ukaea/kzscisoft/uv
Switch to using UV for dependency management
2 parents f2019d0 + 1651073 commit 36a865f

File tree

7 files changed

+1966
-2727
lines changed

7 files changed

+1966
-2727
lines changed

.github/workflows/python-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ jobs:
2222
runs-on: ubuntu-latest
2323

2424
steps:
25-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
2626
- name: Set up Python
27-
uses: actions/setup-python@v3
27+
uses: actions/setup-python@v5
2828
with:
2929
python-version: '3.x'
3030
- name: Install dependencies
3131
run: |
3232
python -m pip install --upgrade pip
33-
pip install poetry
34-
poetry build
33+
pip install uv
34+
uv build
3535
- name: Publish package
3636
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test_run_multiparser.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ jobs:
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121
architecture: x64
22-
- name: Install Poetry
23-
run: python -m pip install poetry
22+
- name: Install UV
23+
run: python -m pip install uv
2424
- name: Run Unit Tests
25-
run: |
26-
poetry install --all-extras
27-
poetry run pytest
25+
run: uv run --all-groups --all-extras -p ${{ matrix.python-version }} pytest --cov=multiparser

docs/development.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Development
22

3-
## Using Poetry
3+
## Using UV
44

5-
The _Multiparser_ repository makes use of the [Poetry](https://python-poetry.org/) which is a pip-installable dependency management and virtual environment tool for assisting development, and recommended when contributing to the project. The included `poetry.lock` file provides a shareable virtual environment definition. Poetry is able to resolve dependency versions to ensure cross-compatibility.
5+
The _Multiparser_ repository makes use of the [UV](https://docs.astral.sh/uv/) which is a pip-installable dependency management and virtual environment tool for assisting development, and recommended when contributing to the project. The included `uv.lock` file provides a shareable virtual environment definition. UV is able to resolve dependency versions to ensure cross-compatibility.
66

77
## Pre-commit
88

@@ -22,8 +22,8 @@ pre-commit run --all
2222

2323
_Multiparser_ follows the Numpy docstring convention for outlining function and class parameters and return types.
2424

25-
Included within the git hooks is the docstring coverage check tool [_interrogate_](https://pypi.org/project/interrogate/) which checks whether all functions within the `multiparser` module have been documented. The tool can be run in isolation using Poetry:
25+
Included within the git hooks is the docstring coverage check tool [_interrogate_](https://pypi.org/project/interrogate/) which checks whether all functions within the `multiparser` module have been documented. The tool can be run in isolation using UV:
2626

2727
```sh
28-
poetry run interrogate
28+
uv run interrogate
2929
```

multiparser/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
pathlib.Path(os.path.dirname(__file__)).parents[1], "pyproject.toml"
2828
)
2929
if os.path.exists(_metadata):
30-
__version__ = toml.load(_metadata)["tool"]["poetry"]["version"]
30+
__version__ = toml.load(_metadata)["project"]["version"]
3131
else:
3232
__version__ = ""
3333

poetry.lock

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

pyproject.toml

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
[project]
22
name = "multiparser"
3-
version = "1.0.5"
3+
version = "1.0.6"
44
description = "Multiple File Parser for monitoring and processing updates to a given set of output files."
5+
readme = "README.md"
6+
requires-python = ">=3.10,<4.0"
57
authors = [
68
{name = "Kristian Zarębski",email = "[email protected]"}
79
]
@@ -25,60 +27,55 @@ keywords = [
2527
"logging"
2628
]
2729
license = {text = "MIT"}
28-
readme = "README.md"
29-
requires-python = ">=3.10,<4.0"
3030
dependencies = [
31-
"toml (>=0.10.2,<0.11.0)",
32-
"pyyaml (>=6.0.2,<7.0.0)",
33-
"flatdict (>=4.0.1,<5.0.0)",
34-
"loguru (>=0.7.3,<0.8.0)"
31+
"flatdict>=4.0.1",
32+
"loguru>=0.7.3",
33+
"pyyaml>=6.0.2",
34+
"toml>=0.10.2",
3535
]
3636

37-
[project.urls]
38-
Documentation = "https://ukaea.github.io/Multiparser/"
39-
Repository = "https://github.com/ukaea/Multiparser"
40-
Issues = "https://github.com/ukaea/Multiparser/issues"
41-
"Change Log" = "https://github.com/ukaea/Multiparser/blob/main/CHANGELOG.md"
42-
4337
[project.optional-dependencies]
44-
arrow = ["pyarrow (>=19.0.0,<20.0.0)", "pandas (>=2.2.3,<3.0.0)"]
45-
fortran = ["f90nml (>=1.4.4,<2.0.0)"]
46-
47-
[build-system]
48-
requires = ["poetry-core>=2.0.0,<3.0.0"]
49-
build-backend = "poetry.core.masonry.api"
50-
51-
[tool.poetry.group.testing.dependencies]
52-
pytest = "^8.3.4"
53-
pytest-cov = "^6.0.0"
54-
xeger = "^0.4.0"
55-
pytest-mock = "^3.14.0"
56-
pandas = "^2.2.3"
57-
58-
59-
[tool.poetry.group.quality.dependencies]
60-
bandit = "^1.8.2"
61-
62-
63-
[tool.poetry.group.docs.dependencies]
64-
mkdocs = "^1.6.1"
65-
mkdocs-material = "^9.5.50"
66-
pymdown-extensions = "^10.14.2"
67-
mkdocs-mermaid2-plugin = "^1.2.1"
68-
mkdocs-git-revision-date-localized-plugin = "^1.3.0"
69-
mktestdocs = "^0.2.4"
70-
mkdocstrings = "^0.27.0"
71-
mike = "^2.1.3"
38+
arrow = [
39+
"pandas>=2.2.3",
40+
"pyarrow>=20.0.0",
41+
]
42+
fortran = [
43+
"f90nml>=1.4.5",
44+
]
7245

46+
[dependency-groups]
47+
dev = [
48+
"ipykernel>=6.29.5",
49+
"mypy>=1.15.0",
50+
"pandas-stubs>=2.2.3.250308",
51+
"ruff>=0.11.10",
52+
"types-pyyaml>=6.0.12.20250516",
53+
"types-toml>=0.10.8.20240310",
54+
"bandit>=1.8.3",
55+
"pytest>=8.3.5",
56+
"pytest-cov>=6.1.1",
57+
]
58+
docs = [
59+
"mike>=2.1.3",
60+
"mkdocs>=1.6.1",
61+
"mkdocs-git-revision-date-localized-plugin>=1.4.5",
62+
"mkdocs-material>=9.6.14",
63+
"mkdocs-mermaid2-plugin>=1.2.1",
64+
"mkdocstrings>=0.29.1",
65+
"mktestdocs>=0.2.4",
66+
"pymdown-extensions>=10.15",
67+
]
68+
testing = [
69+
"pandas>=2.2.3",
70+
"pytest>=8.3.5",
71+
"pytest-cov>=6.1.1",
72+
"pytest-mock>=3.14.0",
73+
"xeger>=0.4.0",
74+
]
7375

74-
[tool.poetry.group.dev.dependencies]
75-
ipykernel = "^6.29.5"
76-
mypy = "^1.14.1"
77-
pandas-stubs = "^2.2.3.241126"
78-
types-toml = "^0.10.8.20240310"
79-
types-pyyaml = "^6.0.12.20241230"
80-
ruff = "^0.9.3"
81-
interrogate = "^1.7.0"
76+
[build-system]
77+
requires = ["hatchling"]
78+
build-backend = "hatchling.build"
8279

8380
[tool.ruff]
8481
lint.extend-select = ["C901"]

0 commit comments

Comments
 (0)