Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length = 80
ignore = E121,E125,W504
statistics = true
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build and Publish Client to PyPI
on:
release:
types: [published]
jobs:
build-and-publish-client:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/dicomweb-client
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.7.2"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Build wheel and sdist
run: uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
20 changes: 9 additions & 11 deletions .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,16 @@ jobs:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.7.2"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install '.[test]'
pip install .
run: uv sync
- name: Lint with flake8
run: |
flake8 --exclude='bin,build,.eggs'
run: uv run flake8 src tests --exclude=.venv,build,.eggs
- name: Check type hints with mypy
run: |
mypy src tests
run: uv run mypy src tests
- name: Test with pytest
run: |
pytest --cov=dicomweb_client --cov-fail-under=65 tests
run: uv run pytest --cov=dicomweb_client --cov-fail-under=65 tests
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,6 @@ venv.bak/

# pytest
.pytest_cache

# lock files
*.lock
33 changes: 17 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
[build-system]
requires = ["setuptools>=64"]
build-backend = "setuptools.build_meta"

[project]
name = "dicomweb-client"
version = "0.59.3"
dynamic = ["version"]
description = "Client for DICOMweb RESTful services."
readme = "README.md"
requires-python = ">=3.6"
authors = [
{ name = "Markus D. Herrmann" },
]
requires-python = ">=3.9"
authors = [{ name = "Markus D. Herrmann" }]
maintainers = [
{ name = "Markus D. Herrmann" },
{ name = "Christopher P. Bridge" },
Expand All @@ -28,9 +22,6 @@ classifiers = [
"Topic :: Multimedia :: Graphics",
"Topic :: Scientific/Engineering :: Information Analysis",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -47,12 +38,12 @@ dependencies = [
]

[project.optional-dependencies]
gcp = [
"dataclasses>=0.8; python_version=='3.6'",
"google-auth>=1.6",
]
gcp = ["dataclasses>=0.8; python_version=='3.6'", "google-auth>=1.6"]

[dependency-groups]
test = [
"mypy==0.982",
"flake8==6.1.0",
"pytest==7.1.3",
"pytest-cov==3.0.0",
"pytest-flake8==1.1.3",
Expand All @@ -68,6 +59,9 @@ docs = [
"sphinx-autodoc-typehints==1.12.0",
]

[tool.uv]
default-groups = "all"

[project.scripts]
dicomweb_client = "dicomweb_client.cli:_main"

Expand Down Expand Up @@ -98,3 +92,10 @@ ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "retrying.*"
ignore_missing_imports = true

[tool.hatch.version]
source = "uv-dynamic-versioning"

[build-system]
requires = ["hatchling", "uv-dynamic-versioning"]
build-backend = "hatchling.build"
7 changes: 0 additions & 7 deletions setup.cfg

This file was deleted.

68 changes: 0 additions & 68 deletions setup.py

This file was deleted.

7 changes: 6 additions & 1 deletion src/dicomweb_client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
__version__ = '0.59.3'
import importlib.metadata

from dicomweb_client.api import DICOMwebClient, DICOMfileClient
from dicomweb_client.protocol import DICOMClient
from dicomweb_client.uri import URI, URISuffix, URIType

try:
__version__ = importlib.metadata.version(__name__)
except importlib.metadata.PackageNotFoundError:
__version__ = '0.0.0'

__all__ = [
'DICOMClient',
'DICOMfileClient',
Expand Down
Loading