From 88f4476894239fa9017c2a842e6b6637650b3308 Mon Sep 17 00:00:00 2001 From: haasad Date: Thu, 16 Nov 2023 21:31:05 +0100 Subject: [PATCH 1/3] Use importlib to determine package version --- pypardiso/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pypardiso/__init__.py b/pypardiso/__init__.py index ee30dc1..dd9c464 100644 --- a/pypardiso/__init__.py +++ b/pypardiso/__init__.py @@ -1,8 +1,14 @@ # coding: utf-8 +from importlib.metadata import version, PackageNotFoundError from .pardiso_wrapper import PyPardisoSolver from .scipy_aliases import spsolve, factorized from .scipy_aliases import pypardiso_solver as ps -__version__ = '0.4.3' + +try: + __version__ = version(__package__) +except PackageNotFoundError: + __version__ = "0.0.0" + __all__ = ['PyPardisoSolver', 'spsolve', 'factorized', 'ps'] From ce7ddf902ee7646fa11ee7a1ffcb532e14cd0cb5 Mon Sep 17 00:00:00 2001 From: haasad Date: Sat, 18 Nov 2023 09:36:07 +0100 Subject: [PATCH 2/3] Switch to pyproject.toml --- pyproject.toml | 29 +++++++++++++++++++++++++++++ setup.py | 27 --------------------------- 2 files changed, 29 insertions(+), 27 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..6cb551d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["setuptools>=64", "setuptools_scm>=8"] +build-backend = "setuptools.build_meta" + +[project] +name = "pypardiso" +authors = [ + {name = "Adrian Haas"} +] +description = "Python interface to the Intel MKL Pardiso library to solve large sparse linear systems of equations" +readme = "README.md" +requires-python = ">=3.8" +keywords = ["pardiso", "sparse solver"] +license = {file = "LICENSE.txt"} +classifiers = [ + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering :: Mathematics" +] +dynamic = ["version", "dependencies"] + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} + +[project.urls] +Homepage = "https://github.com/haasad/PyPardisoProject" +Repository = "https://github.com/haasad/PyPardisoProject.git" +Changelog = "https://github.com/haasad/PyPardisoProject/releases" + +[tool.setuptools_scm] diff --git a/setup.py b/setup.py deleted file mode 100644 index e19c9a7..0000000 --- a/setup.py +++ /dev/null @@ -1,27 +0,0 @@ -from setuptools import setup - -setup( - name='pypardiso', - version="0.4.3", - packages=['pypardiso'], - install_requires=['mkl', 'numpy', 'scipy'], - author="Adrian Haas", - license=open('LICENSE.txt').read(), - url="https://github.com/haasad/PyPardisoProject", - long_description=open('README.md').read(), - long_description_content_type="text/markdown", - description='Python interface to the Intel MKL Pardiso library to solve large sparse linear systems of equations', - classifiers=[ - 'Intended Audience :: End Users/Desktop', - 'Intended Audience :: Developers', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: BSD License', - 'Operating System :: MacOS :: MacOS X', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: POSIX', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Topic :: Scientific/Engineering :: Information Analysis', - 'Topic :: Scientific/Engineering :: Mathematics', - ], -) From 6bf82e7747832c469538020f5ea1ebbd0f5aa8db Mon Sep 17 00:00:00 2001 From: haasad Date: Sat, 18 Nov 2023 19:12:35 +0100 Subject: [PATCH 3/3] Don't use dynamic dependencies --- pyproject.toml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6cb551d..355f2e4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,10 +16,12 @@ classifiers = [ "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Mathematics" ] -dynamic = ["version", "dependencies"] - -[tool.setuptools.dynamic] -dependencies = {file = ["requirements.txt"]} +dynamic = ["version"] +dependencies = [ + "mkl", + "numpy", + "scipy" +] [project.urls] Homepage = "https://github.com/haasad/PyPardisoProject"