Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pyproject.toml #12

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ target/
# Local development environment
.env
.vscode/

# Virtual environment
.venv
40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "slicerio"
dynamic = ["version"]
description = "Utilities for 3D Slicer"
readme = "README.md"
requires-python = ">=3.6"
keywords = ["3DSlicer", "medical imaging", "segmentation"]
authors = [{ name = "Andras Lasso", email = "[email protected]" }]
maintainers = [{ name = "Andras Lasso", email = "[email protected]" }]
license = { file = "LICENSE" }
classifiers = [
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Intended Audience :: Healthcare Industry",
"Intended Audience :: Science/Research",
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Medical Science Apps.",
"Topic :: System :: Networking",
]

dependencies = ["pynrrd", "numpy", "requests"]

[project.optional-dependencies]
dev = ["build", "mypy", "pre-commit", "pytest"]

[project.urls]
Homepage = "https://github.com/lassoan/slicerio"
Download = "https://github.com/lassoan/slicerio/archive/master.zip"

[tool.setuptools.dynamic]
version = {attr = "slicerio.__version__"}

[tool.flake8]
max-line-length = 180
5 changes: 0 additions & 5 deletions setup.cfg

This file was deleted.

50 changes: 2 additions & 48 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,51 +1,5 @@
#!/usr/bin/env python
from setuptools import setup

import os.path
from setuptools import setup, find_packages

# Get __version__ from slicerio/_version.py
base_dir = os.path.dirname(os.path.realpath(__file__))
version_file = os.path.join(base_dir, 'slicerio', '_version.py')
print("base_dir="+base_dir)
print("version_file="+version_file)
with open(version_file) as f:
exec(f.read())
# pylint/flake does not know that this script injects a variable, so we need to disable checks
VERSION = __version__ # pylint:disable=undefined-variable # noqa: F821

# Get long description from README.md
base_path = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(base_path, 'README.md')) as f:
LONG_DESCRIPTION = f.read()

opts = dict(
name="slicerio",
python_requires='>=3.6',
version=VERSION,
maintainer="Andras Lasso",
maintainer_email="[email protected]",
author="Andras Lasso",
author_email="[email protected]",
description="Utilities for 3D Slicer",
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',
url="https://github.com/lassoan/slicerio",
download_url="https://github.com/lassoan/slicerio/archive/master.zip",
keywords="3DSlicer medical imaging segmentation",
classifiers=[
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Intended Audience :: Healthcare Industry",
"Intended Audience :: Science/Research",
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Medical Science Apps.",
"Topic :: System :: Networking"
],
packages=find_packages(),
install_requires=['pynrrd', 'numpy', 'requests'],
)

if __name__ == '__main__':
setup(**opts)
setup()
Loading