diff --git a/pyproject.toml b/pyproject.toml index b0f7f1a7..a4352243 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,14 +1,128 @@ [build-system] -requires = [ - "setuptools>=42", +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "torchio" +version = "0.20.0" +description = "Tools for medical image processing with PyTorch" +readme = {file = "README.md", content-type = "text/markdown"} +authors = [ + {name = "TorchIO contributors"} +] +maintainers = [ + {name = "Fernando Perez-Garcia", email = "fepegar@gmail.com"} +] +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: Apache Software License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Scientific/Engineering :: Image Processing", + "Topic :: Scientific/Engineering :: Medical Science Apps.", + "Typing :: Typed" +] +keywords = ["medical", "image processing", "pytorch", "augmentation", "mri"] +requires-python = ">=3.8,<3.13" +dependencies = [ + "deprecated", + "humanize", + "nibabel", + "numpy>=1.15", + "scipy", + "simpleitk!=2.0.*,!=2.1.1.1", + "torch>=1.1", + "tqdm", + "typer", ] -build-backend = "setuptools.build_meta" + +[project.optional-dependencies] +csv = [ + "pandas", +] +dev = [ + "black", + "bump2version", + "coverage", + "flake8", + "mypy", + "parameterized", + "pre-commit", + "Pillow", + "pytest", + "pytest-cov", + "pytest-sugar", + "tox", + "types-Deprecated", +] +doc = [ + "einops", + "furo", + "matplotlib", + "sphinx", + "sphinx-autobuild", + "sphinx-copybutton", + "sphinx-gallery", + "sphinxext-opengraph", +] +plot = [ + "matplotlib", +] +all = [ + "torchio[doc]", + "torchio[plot]", + "torchio[csv]", + "torchio[dev]", +] + +[project.scripts] +tiohd = "torchio.cli.print_info:app" +tiotr = "torchio.cli.apply_transform:app" +torchio-transform = "torchio.cli.apply_transform:app" + +[project.urls] +Homepage = "http://torchio.rtfd.io" +Source = "https://github.com/fepegar/torchio" +"Issue tracker" = "https://github.com/fepegar/torchio/issues" +Documentation = "http://torchio.rtfd.io" +"Release notes" = "https://github.com/fepegar/torchio/releases" [tool.black] preview = false skip-string-normalization = true target-version = ['py311'] +[tool.mypy] +pretty = true + +[[tool.mypy.overrides]] +module = "duecredit.*" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "matplotlib.*" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "nibabel.*" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "scipy.*" +ignore_missing_imports = true + [tool.pytest.ini_options] markers = [ "slow: marks tests as slow (deselect with '-m \"not slow\"')", diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 847c26a8..00000000 --- a/setup.cfg +++ /dev/null @@ -1,129 +0,0 @@ -[metadata] -name = torchio -version = 0.20.0 -description = Tools for medical image processing with PyTorch -long_description = file: README.md -long_description_content_type = text/markdown -url = http://torchio.rtfd.io -author = TorchIO contributors -maintainer = Fernando Perez-Garcia -maintainer_email = fepegar@gmail.com -license = Apache-2.0 -license_files = LICENSE -platforms = OS Independent -classifiers = - Development Status :: 4 - Beta - Environment :: Console - Intended Audience :: Science/Research - License :: OSI Approved :: Apache Software License - Natural Language :: English - Operating System :: OS Independent - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.12 - Programming Language :: Python :: Implementation :: CPython - Topic :: Scientific/Engineering - Topic :: Scientific/Engineering :: Artificial Intelligence - Topic :: Scientific/Engineering :: Image Processing - Topic :: Scientific/Engineering :: Medical Science Apps. - Typing :: Typed -download_url = https://github.com/fepegar/torchio -keywords = medical image processing pytorch augmentation mri -project_urls = - Source = https://github.com/fepegar/torchio - Issue tracker = https://github.com/fepegar/torchio/issues - Documentation = http://torchio.rtfd.io - Release notes = https://github.com/fepegar/torchio/releases - -[options] -install_requires = - Deprecated - SimpleITK!=2.0.*,!=2.1.1.1 - humanize - nibabel - numpy>=1.15 - scipy - torch>=1.1 - tqdm - typer -python_requires = >=3.8, <3.13 -include_package_data = True -zip_safe = False - -[options.packages.find] -where = src - -[options.entry_points] -console_scripts = - tiohd=torchio.cli.print_info:app - tiotr=torchio.cli.apply_transform:app - torchio-transform=torchio.cli.apply_transform:app - -[options.extras_require] -all = - %(csv)s - %(dev)s - %(doc)s - %(plot)s -csv = - pandas -dev = - %(plot)s - black - bump2version - coverage - flake8 - mypy - parameterized - pre-commit - pytest - pytest-cov - tox - types-Deprecated -doc = - einops - furo - matplotlib - sphinx - sphinx-autobuild - sphinx-copybutton - sphinx-gallery - sphinxext-opengraph -plot = - matplotlib - -[options.package_data] -torchio = - py.typed - -[bdist_wheel] -universal = 1 - -[flake8] -max-line-length = 88 -select = C,E,F,W,B,B950 -extend-ignore = - N813, - E123, - W503, - E203, - E501 - -[mypy] -pretty = True - -[mypy-duecredit.*] -ignore_missing_imports = True - -[mypy-matplotlib.*] -ignore_missing_imports = True - -[mypy-nibabel.*] -ignore_missing_imports = True - -[mypy-scipy.*] -ignore_missing_imports = True diff --git a/tox.ini b/tox.ini index dbf2105e..6e2c0151 100644 --- a/tox.ini +++ b/tox.ini @@ -19,3 +19,13 @@ commands = --install-types \ --non-interactive \ src + +[flake8] +max-line-length = 88 +select = C,E,F,W,B,B950 +extend-ignore = + N813, + E123, + W503, + E203, + E501