Skip to content

Commit 7afc05a

Browse files
committed
Drops Poetry, switches to uv for package management
1 parent 68dd28d commit 7afc05a

4 files changed

Lines changed: 54 additions & 88 deletions

File tree

.github/workflows/build.yml

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,58 +11,46 @@ env:
1111
MINIMUM_PYTHON_VERSION: '3.10'
1212

1313
jobs:
14-
1514
precommit:
1615
runs-on: ubuntu-latest
1716
steps:
18-
- name: Install Python ${{ env.MINIMUM_PYTHON_VERSION }}
19-
uses: actions/setup-python@v4
17+
- uses: actions/checkout@v4
18+
- name: Install uv and set the python version
19+
uses: astral-sh/setup-uv@v6
2020
with:
2121
python-version: ${{ env.MINIMUM_PYTHON_VERSION }}
22-
- uses: actions/checkout@v3
23-
- name: Install pre-commit
24-
run: |
25-
python -m pip install --upgrade pip
26-
python -m pip install pre-commit virtualenv!=20.0.6
27-
pre-commit install
2822
- name: Run static code inspections
29-
run: pre-commit run --all-files
23+
run: uv run pre-commit run --all-files
3024

3125
build:
3226
runs-on: ubuntu-latest
3327
strategy:
3428
matrix:
3529
python-version: ["3.10", "3.11", "3.12"]
3630
steps:
37-
- uses: actions/checkout@v3
31+
- uses: actions/checkout@v4
3832
- name: Set up Python ${{ matrix.python-version }}
39-
uses: actions/setup-python@v4
33+
uses: actions/setup-python@v5
34+
- name: Install uv and set the python version
35+
uses: astral-sh/setup-uv@v6
4036
with:
4137
python-version: ${{ matrix.python-version }}
42-
- name: Install dependencies
38+
- name: Test with uv
4339
run: |
44-
python -m pip install --upgrade pip
45-
python -m pip install tox tox-gh-actions poetry
46-
- name: Test with tox
47-
run: |
48-
tox
40+
uv run pytest --cov-branch --cov-report term-missing --cov=tests/ --cov=midom/
4941
deploy:
5042
if: github.event_name == 'release'
5143
needs: [precommit, build]
5244
runs-on: ubuntu-latest
5345
steps:
54-
- name: Install Python ${{ env.MINIMUM_PYTHON_VERSION }}
55-
uses: actions/setup-python@v4
46+
- uses: actions/checkout@v4
47+
- name: Install uv and set the python version
48+
uses: astral-sh/setup-uv@v6
5649
with:
5750
python-version: ${{ env.MINIMUM_PYTHON_VERSION }}
58-
- uses: actions/checkout@v3
59-
- name: Install dependencies
60-
run: |
61-
python -m pip install --upgrade pip
62-
python -m pip install poetry
6351
- name: Upload to pypi
6452
env:
65-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_PASSWORD }}
53+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_PASSWORD }}
6654
run: |
67-
poetry config http-basic.pypi "__token__" "${POETRY_PYPI_TOKEN_PYPI}"
68-
poetry publish --build
55+
uv build
56+
uv publish

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,5 @@ dmypy.json
132132
.idea/
133133

134134
# This is a library, should just use newest always. Don't retrict
135-
poetry.lock
135+
poetry.lock
136+
uv.lock

.pre-commit-config.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
default_language_version:
2-
python: python3
31
repos:
42
- repo: https://github.com/asottile/pyupgrade
5-
rev: v2.32.0
3+
rev: v2.37.3
64
hooks:
75
- id: pyupgrade
86
language: python
97
args: [--py36-plus]
10-
- repo: https://github.com/ambv/black
8+
- repo: https://github.com/psf/black
119
rev: 22.3.0
1210
hooks:
1311
- id: black
@@ -16,19 +14,19 @@ repos:
1614
rev: 5.0.4
1715
hooks:
1816
- id: flake8
19-
exclude: dicomtrolley/xml_templates.py
2017
language: python
2118
additional_dependencies:
2219
- flake8-bugbear
20+
- flake8-import-order
2321
- pep8-naming
2422
- flake8-docstrings
2523
- mccabe
2624
- yesqa
2725
- repo: https://github.com/pre-commit/mirrors-mypy
28-
rev: 'v0.942'
26+
rev: 'v1.16.1'
2927
hooks:
3028
- id: mypy
3129
additional_dependencies:
32-
- "pydantic>=1.10.4"
30+
- pydantic
3331
- types-requests
34-
- types-Jinja2
32+
- types-Jinja2

pyproject.toml

Lines changed: 30 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,42 @@
1-
[tool.poetry]
1+
[project]
22
name = "dicomtrolley"
33
version = "3.2.1"
44
description = "Retrieve medical images via WADO-URI, WADO-RS, QIDO-RS, MINT, RAD69 and DICOM-QR"
55
authors = ["sjoerdk <sjoerd.kerkstra@radboudumc.nl>"]
66
readme = "README.md"
77
license = "Apache-2.0"
88
repository = "https://github.com/sjoerdk/dicomtrolley"
9+
requires-python = ">=3.10"
10+
dependencies = [
11+
"requests",
12+
"pydicom>=3.0.1",
13+
"requests-futures>=1.0.0",
14+
"pynetdicom",
15+
"Jinja2",
16+
"requests-toolbelt>=1.0.0",
17+
"pydantic>=2"
18+
]
919

1020
[tool.black]
1121
line-length = 79
1222
target-version = ['py310']
1323

14-
[tool.poetry.dependencies]
15-
python = ">=3.10"
16-
requests = "^2.32.5"
17-
pydicom = "3.0.1"
18-
requests-futures = ">=1.0.0"
19-
pynetdicom = "^3.0.4"
20-
Jinja2 = ">=3.0.3"
21-
requests-toolbelt = ">=1.0.0"
22-
pydantic = "^2.11.9"
23-
24-
[tool.poetry.dev-dependencies]
25-
pytest = ">=7.4.0"
26-
pytest-randomly = ">=3.5.0"
27-
pytest-cov = ">=2.11.1"
28-
tox = ">=3.23.0"
29-
requests-mock = ">=1.11.0"
30-
factory-boy = ">=3.2.1"
31-
sybil = ">=5.0.3"
32-
mkdocs = ">=1.5.2"
33-
mkdocstrings = {extras = ["python"], version = ">=0.22.0"}
34-
mkdocs-gen-files = ">=0.5.0"
35-
mkdocs-section-index = ">=0.3.5"
36-
mkdocs-literate-nav = ">=0.6.0"
37-
markdown-mdantic = ">=1.3.5"
38-
mkdocs-material = ">=9.2.8"
39-
mkdocs-autorefs = ">=0.5.0"
40-
pip-tools = ">=7.3.0"
41-
42-
43-
[tool.tox]
44-
legacy_tox_ini = """
45-
[tox]
46-
isolated_build = True
47-
envlist = py310, py311, py312
48-
[gh-actions]
49-
python =
50-
3.10: py310
51-
3.11: py311
52-
3.12: py312
53-
[testenv]
54-
allowlist_externals = poetry
55-
commands =
56-
poetry install -v
57-
poetry run pytest --cov=tests/ --cov=dicomtrolley/
58-
"""
59-
60-
[build-system]
61-
requires = ["poetry-core>=1.0.8"]
62-
build-backend = "poetry.core.masonry.api"
63-
24+
[dependency-groups]
25+
dev = [
26+
"pytest>=7.4.0",
27+
"pytest-randomly>=3.5.0",
28+
"pytest-cov>=2.11.1",
29+
"tox>=3.23.0",
30+
"requests-mock>=1.11.0",
31+
"factory-boy>=3.2.1",
32+
"sybil>=5.0.3",
33+
"mkdocs>=1.5.2",
34+
"mkdocstrings>=0.22.0",
35+
"mkdocs-gen-files>=0.5.0",
36+
"mkdocs-section-index>=0.3.5",
37+
"mkdocs-literate-nav>=0.6.0",
38+
"markdown-mdantic>=1.3.5",
39+
"mkdocs-material>=9.2.8",
40+
"mkdocs-autorefs>=0.5.0",
41+
"pip-tools>=7.3.0",
42+
]

0 commit comments

Comments
 (0)