From ce10d8ffae08b990abb84fb9bc534620aaf4ffc1 Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Fri, 31 Jan 2025 14:49:09 +1300 Subject: [PATCH 1/2] Convert from setup.py to pyproject.toml. --- pyproject.toml | 31 +++++++++++++++++++++ setup.py | 51 ---------------------------------- src/scaffoldfitter/__init__.py | 3 ++ 3 files changed, 34 insertions(+), 51 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5607971 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,31 @@ +[build-system] +requires = ["setuptools>=61.0", "setuptools_scm>=8.0"] +build-backend = "setuptools.build_meta" + +[tool.setuptools-git-versioning] +enabled = true + +[project] +name = "scaffoldfitter" +dynamic = ["version"] +keywords = ["Medical", "Physiology", "Anatomical", "Mesh", "Finite Element", "Fitting", "SPARC"] +readme = "README.rst" +license = {file = "LICENSE"} +authors = [ + { name="Richard Christie", email="r.christie@auckland.ac.nz" }, +] +dependencies = [ + "cmlibs.maths >= 0.6.2", + "cmlibs.utils >= 0.6", + "cmlibs.zinc >= 4.1" +] +description = "Scaffold/model geometric fitting library using Zinc." +requires-python = ">=3.8" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Topic :: Scientific/Engineering :: Medical Science Apps.", +] + +[tool.setuptools_scm] diff --git a/setup.py b/setup.py deleted file mode 100644 index e5d79cc..0000000 --- a/setup.py +++ /dev/null @@ -1,51 +0,0 @@ -import io -import os - -from setuptools import setup, find_packages - -SETUP_DIR = os.path.dirname(os.path.abspath(__file__)) - - -# List all of your Python package dependencies in the -# requirements.txt file - -def readfile(filename, split=False): - with io.open(filename, encoding="utf-8") as stream: - if split: - return stream.read().split("\n") - return stream.read() - - -readme = readfile("README.rst", split=True) -# For requirements not hosted on PyPi place listings -# into the 'requirements.txt' file. -requires = [ - # minimal requirements listing - "cmlibs.maths >= 0.3", - "cmlibs.utils >= 0.10", - "cmlibs.zinc >= 4.0" -] -readme.extend(['', 'License', '=======', '', '::', '']) -source_license = readfile("LICENSE") - -setup( - name="scaffoldfitter", - version="0.9.0", - description="Scaffold/model geometric fitting library using Zinc.", - long_description="\n".join(readme) + source_license, - long_description_content_type="text/x-rst", - classifiers=[ - "Development Status :: 3 - Alpha", - "Programming Language :: Python", - "Topic :: Scientific/Engineering :: Medical Science Apps." - ], - author="Auckland Bioengineering Institute", - author_email="r.christie@auckland.ac.nz", - url="https://github.com/ABI-Software/scaffoldfitter", - license="Apache Software License", - packages=find_packages("src"), - package_dir={"": "src"}, - include_package_data=True, - zip_safe=False, - install_requires=requires, -) diff --git a/src/scaffoldfitter/__init__.py b/src/scaffoldfitter/__init__.py index e69de29..e112ca8 100644 --- a/src/scaffoldfitter/__init__.py +++ b/src/scaffoldfitter/__init__.py @@ -0,0 +1,3 @@ +import importlib.metadata + +__version__ = importlib.metadata.version("scaffoldfitter") From 89185a67a81531b86da448aab6dc69a4e70f5f23 Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Mon, 3 Feb 2025 13:36:28 +1300 Subject: [PATCH 2/2] Set minimum version of cmlibs.utils to 0.10.0. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5607971..a4e1501 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ authors = [ ] dependencies = [ "cmlibs.maths >= 0.6.2", - "cmlibs.utils >= 0.6", + "cmlibs.utils >= 0.10.0", "cmlibs.zinc >= 4.1" ] description = "Scaffold/model geometric fitting library using Zinc."