Skip to content

Commit bc26877

Browse files
authored
Merge pull request #102 from ImagingDataCommons/move_to_pyproject_toml
Modernize packaging, add support for new python versions, prepare for 0.59.2 release
2 parents c58601c + 5d7f421 commit bc26877

File tree

10 files changed

+128
-46
lines changed

10 files changed

+128
-46
lines changed

.github/workflows/run_unit_tests.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: ["3.7", "3.8", "3.9", "3.10"]
18+
python-version: [
19+
"3.7",
20+
"3.8",
21+
"3.9",
22+
"3.10",
23+
"3.11",
24+
"3.12",
25+
"3.13"
26+
]
1927

2028
steps:
2129
- uses: actions/checkout@v2
@@ -26,7 +34,7 @@ jobs:
2634
- name: Install dependencies
2735
run: |
2836
python -m pip install --upgrade pip setuptools
29-
pip install -r requirements_test.txt
37+
pip install '.[test]'
3038
pip install .
3139
- name: Lint with flake8
3240
run: |

.readthedocs.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
version: 2
22

33
build:
4-
os: "ubuntu-20.04"
4+
os: "ubuntu-22.04"
55
tools:
6-
python: "3.8"
6+
python: "3.11"
77

88
python:
99
install:
10-
- requirements: requirements_docs.txt
11-
- path: .
10+
- method: pip
11+
path: .
12+
extra_requirements:
13+
- docs
1214

1315
sphinx:
1416
configuration: docs/conf.py

MANIFEST.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/development.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ Source code is available at Github and can be cloned via git:
77

88
.. code-block:: none
99
10-
git clone https://github.com/ImagingDataCommons/dicomweb-client ~/dicomweb-client
10+
git clone https://github.com/ImagingDataCommons/dicomweb-client /path/to/dicomweb-client
11+
12+
where `/path/to/dicomweb-client` is a suitable path on your system where you
13+
wish to clone the repository.
1114

1215
The :mod:`dicomweb_client` package can be installed in *develop* mode for local development:
1316

1417
.. code-block:: none
1518
16-
pip install -e ~/dicomweb-client
19+
pip install -e /path/to/dicomweb-client
1720
1821
1922
.. _pull-requests:
@@ -54,13 +57,13 @@ Install requirements:
5457

5558
.. code-block:: none
5659
57-
pip install -r ~/dicomweb-client/requirements_test.txt
60+
pip install '/path/to/dicomweb-client[test]'
5861
5962
Run tests (including checks for PEP8 compliance):
6063

6164
.. code-block:: none
6265
63-
cd ~/dicomweb-client
66+
cd /path/to/dicomweb-client
6467
pytest --flake8
6568
6669
.. _building-documentation:
@@ -72,13 +75,13 @@ Install requirements:
7275

7376
.. code-block:: none
7477
75-
pip install -r ~/dicomweb-client/requirements_docs.txt
78+
pip install '/path/to/dicomweb-client[docs]'
7679
7780
Build documentation in *HTML* format:
7881

7982
.. code-block:: none
8083
81-
cd ~/dicomweb-client
84+
cd /path/to/dicomweb-client
8285
sphinx-build -b html docs/ docs/build/
8386
8487
The built ``index.html`` file will be located in ``docs/build``.

pyproject.toml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
[build-system]
2+
requires = ["setuptools>=64"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "dicomweb-client"
7+
version = "0.59.2"
8+
description = "Client for DICOMweb RESTful services."
9+
readme = "README.md"
10+
requires-python = ">=3.6"
11+
authors = [
12+
{ name = "Markus D. Herrmann" },
13+
]
14+
maintainers = [
15+
{ name = "Markus D. Herrmann" },
16+
{ name = "Christopher P. Bridge" },
17+
{ name = "Steve Pieper" },
18+
]
19+
license = { text = "LICENSE" }
20+
classifiers = [
21+
"Environment :: Web Environment",
22+
"License :: OSI Approved :: MIT License",
23+
"Operating System :: MacOS",
24+
"Operating System :: Microsoft :: Windows",
25+
"Operating System :: POSIX :: Linux",
26+
"Intended Audience :: Science/Research",
27+
"Topic :: Internet :: WWW/HTTP",
28+
"Topic :: Multimedia :: Graphics",
29+
"Topic :: Scientific/Engineering :: Information Analysis",
30+
"Programming Language :: Python :: 3",
31+
"Programming Language :: Python :: 3.6",
32+
"Programming Language :: Python :: 3.7",
33+
"Programming Language :: Python :: 3.8",
34+
"Programming Language :: Python :: 3.9",
35+
"Programming Language :: Python :: 3.10",
36+
"Programming Language :: Python :: 3.11",
37+
"Programming Language :: Python :: 3.12",
38+
"Programming Language :: Python :: 3.13",
39+
]
40+
dependencies = [
41+
"numpy>=1.19",
42+
"requests>=2.18",
43+
"retrying>=1.3.3",
44+
"Pillow>=8.3",
45+
"pydicom>=2.2",
46+
"typing-extensions>=4.0; python_version < '3.8.0'",
47+
]
48+
49+
[project.optional-dependencies]
50+
gcp = [
51+
"dataclasses>=0.8; python_version=='3.6'",
52+
"google-auth>=1.6",
53+
]
54+
test = [
55+
"mypy==0.982",
56+
"pytest==7.1.3",
57+
"pytest-cov==3.0.0",
58+
"pytest-flake8==1.1.3",
59+
"pytest-localserver==0.5.0",
60+
"types-requests==2.27.14",
61+
"types-Pillow==9.0.8",
62+
]
63+
docs = [
64+
"sphinx-pyreverse==0.0.17",
65+
"sphinx-rtd-theme==1.0.0",
66+
"sphinxcontrib-autoprogram==0.1.7",
67+
"sphinxcontrib-websupport==1.2.4",
68+
"sphinx-autodoc-typehints==1.12.0",
69+
]
70+
71+
[project.scripts]
72+
dicomweb-client = "dicomweb_client.cli:_main"
73+
74+
[project.urls]
75+
homepage = "https://github.com/imagingdatacommons/dicomweb-client"
76+
documentation = "https://dicomweb-client.readthedocs.io/"
77+
repository = "https://github.com/ImagingDataCommons/dicomweb-client.git"
78+
79+
[tool.pytest.ini_options]
80+
minversion = "7"
81+
addopts = ["--doctest-modules", "-ra", "--strict-config", "--strict-markers"]
82+
testpaths = ["tests"]
83+
log_cli_level = "INFO"
84+
xfail_strict = true
85+
86+
[tool.mypy]
87+
warn_unreachable = true
88+
enable_error_code = ["redundant-expr", "truthy-bool"]
89+
90+
[[tool.mypy.overrides]]
91+
module = "pydicom.*"
92+
ignore_missing_imports = true
93+
94+
[[tool.mypy.overrides]]
95+
module = "google.*"
96+
ignore_missing_imports = true
97+
98+
[[tool.mypy.overrides]]
99+
module = "retrying.*"
100+
ignore_missing_imports = true

requirements_docs.txt

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

requirements_test.txt

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

setup.cfg

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,3 @@ test=pytest
55
max_line_length = 80
66
ignore = E121 E125 W504
77
statistics = True
8-
9-
[mypy]
10-
warn_unreachable = True
11-
12-
[mypy-google.*]
13-
ignore_missing_imports = True
14-
15-
[mypy-pydicom.*]
16-
ignore_missing_imports = True
17-
18-
[mypy-retrying.*]
19-
ignore_missing_imports = True
20-
21-
[tool:pytest]
22-
python_files = tests/*.py
23-
log_cli_level = INFO

src/dicomweb_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '0.59.1'
1+
__version__ = '0.59.2'
22

33
from dicomweb_client.api import DICOMwebClient, DICOMfileClient
44
from dicomweb_client.protocol import DICOMClient

src/dicomweb_client/web.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -877,9 +877,7 @@ def _build_multipart_accept_header_field_value(
877877
media_types: Union[Tuple[Union[str, Tuple[str, str]], ...], None]
878878
Acceptable media types and optionally the UIDs of the corresponding
879879
transfer syntaxes
880-
supported_media_types: Union[
881-
Mapping[str, Union[str, Tuple[str, ...]]], Set[str]
882-
]
880+
supported_media_types: Union[Mapping[str, Union[str, Tuple[str, ...]]], Set[str]]
883881
Set of supported media types or mapping of transfer syntaxes
884882
to their corresponding media types
885883
@@ -888,7 +886,7 @@ def _build_multipart_accept_header_field_value(
888886
str
889887
Accept header field value
890888
891-
"""
889+
""" # noqa: E501
892890
if not isinstance(media_types, (list, tuple, set)):
893891
raise TypeError(
894892
'Acceptable media types must be provided as a sequence.'

0 commit comments

Comments
 (0)