From c94200f0d7a950e49310543e81b0b1f794aa48c6 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Wed, 13 Dec 2023 10:14:27 +0100 Subject: [PATCH] setup.py -> pyproject.toml (#381) Move python/swig/ to swig/ to not interfere with python packaging. --- CMakeLists.txt | 2 +- python/pyproject.toml | 43 ++++++++++++++++++++++++++ python/setup.py | 30 ------------------ {python/swig => swig}/CMakeLists.txt | 0 {python/swig => swig}/parpe.i | 0 {python/swig => swig}/std_unique_ptr.i | 0 6 files changed, 44 insertions(+), 31 deletions(-) create mode 100644 python/pyproject.toml delete mode 100644 python/setup.py rename {python/swig => swig}/CMakeLists.txt (100%) rename {python/swig => swig}/parpe.i (100%) rename {python/swig => swig}/std_unique_ptr.i (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bc8190b3..efad43293 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,7 +199,7 @@ endif() if(BUILD_PYTHON_MODULE AND CMAKE_BUILD_TYPE MATCHES Debug) # Only build swig/python module when we are in debug mode # This requires PIC, but we don't want PIC for release build at the moment - add_subdirectory(python/swig) + add_subdirectory(swig) endif() diff --git a/python/pyproject.toml b/python/pyproject.toml new file mode 100644 index 000000000..9cebdd8d6 --- /dev/null +++ b/python/pyproject.toml @@ -0,0 +1,43 @@ +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "parpe" +version = "0.0.0" +authors = [ + {name = "Daniel Weindl", email = "sci@danielweindl.de"}, +] +description = "parpe python package" +requires-python = ">=3.9" +license = {text = "MIT"} +dependencies = [ + 'numpy>=1.18.1', + 'termcolor>=1.1.0', + 'colorama>=0.4.3', + 'petab>=0.1.18', + 'amici>=0.20.0', + 'h5py>=3.0.0', + 'python-libsbml>=5.17.0', + 'snakemake>=5.10.0', + 'coloredlogs>=15.0', + 'scipy', + 'matplotlib', +] + +[project.optional-dependencies] +test = ["pytest", "pre-commit"] + +[project.scripts] +parpe_petab_to_hdf5 = "parpe.hdf5_pe_input:main" + +[project.urls] +Documentation = "https://parpe.readthedocs.io/" +Repository = "https://github.com/ICB-DCM/parPE/" + +[tool.black] +line-length = 79 + +[tool.semantic_release] +version_toml = "pyproject.toml:project.version" + diff --git a/python/setup.py b/python/setup.py deleted file mode 100644 index 23479437e..000000000 --- a/python/setup.py +++ /dev/null @@ -1,30 +0,0 @@ -from setuptools import setup, find_packages - -ENTRY_POINTS = { - 'console_scripts': [ - 'parpe_petab_to_hdf5 = parpe.hdf5_pe_input:main', - ] -} - -setup( - name='parpe', - version='0.0.0', - url='https://github.com/ICB-DCM/parPE/', - author='Daniel Weindl', - author_email='daniel.weindl@helmholtz-muenchen.de', - description='parpe python package', - packages=find_packages(), - install_requires=['numpy>=1.18.1', - 'termcolor>=1.1.0', - 'colorama>=0.4.3', - 'petab>=0.1.18', - 'amici>=0.11.15', - 'h5py>=3.0.0', - 'python-libsbml>=5.17.0', - 'snakemake>=5.10.0', - 'coloredlogs>=15.0', - 'scipy', - 'matplotlib', - ], - entry_points=ENTRY_POINTS, -) diff --git a/python/swig/CMakeLists.txt b/swig/CMakeLists.txt similarity index 100% rename from python/swig/CMakeLists.txt rename to swig/CMakeLists.txt diff --git a/python/swig/parpe.i b/swig/parpe.i similarity index 100% rename from python/swig/parpe.i rename to swig/parpe.i diff --git a/python/swig/std_unique_ptr.i b/swig/std_unique_ptr.i similarity index 100% rename from python/swig/std_unique_ptr.i rename to swig/std_unique_ptr.i