From a3b332378372e7054dcb68b66e6d606d6dc3357f Mon Sep 17 00:00:00 2001 From: q-posev Date: Tue, 3 May 2022 13:44:44 +0200 Subject: [PATCH] Local pip install works --- python/pyproject.toml | 7 +++++ python/pyqmckl/__init__.py | 1 + python/requirements.txt | 2 ++ python/setup.py | 60 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 python/pyproject.toml create mode 100644 python/pyqmckl/__init__.py create mode 100644 python/requirements.txt create mode 100644 python/setup.py diff --git a/python/pyproject.toml b/python/pyproject.toml new file mode 100644 index 0000000..c66b022 --- /dev/null +++ b/python/pyproject.toml @@ -0,0 +1,7 @@ +[build-system] +requires = [ + "setuptools>=42", + "wheel", + "numpy>=1.17.3" +] +build-backend = "setuptools.build_meta" diff --git a/python/pyqmckl/__init__.py b/python/pyqmckl/__init__.py new file mode 100644 index 0000000..7e8cb3b --- /dev/null +++ b/python/pyqmckl/__init__.py @@ -0,0 +1 @@ +from .pyqmckl import * diff --git a/python/requirements.txt b/python/requirements.txt new file mode 100644 index 0000000..99943ac --- /dev/null +++ b/python/requirements.txt @@ -0,0 +1,2 @@ +setuptools>=42 +numpy>=1.17.3 diff --git a/python/setup.py b/python/setup.py new file mode 100644 index 0000000..c3138a4 --- /dev/null +++ b/python/setup.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 +""" +setup.py file for pyqmckl package +""" + +from setuptools import setup, Extension +from os.path import join + +with open("README.md", "r") as fh: + long_description = fh.read() + +mod_name = 'pyqmckl' + + +# Define pyqmckl extension module based on TREXIO source codes + SWIG-generated wrapper +pyqmckl_module = Extension(name = f'{mod_name}._{mod_name}', #f'_{mod_name}', + #sources = [ join('src', mod_name + '_wrap.c') ], + sources = [ join('src', f'{mod_name}.i') ], + #include_dirs = [numpy_includedir], + #library_dirs = [], + #runtime_library_dirs = [], + libraries = ['qmckl'], + extra_compile_args = ['-Wall'], + #extra_link_args = [h5_ldflags], + swig_opts = ['-py3'], + depends = [ join('src', 'qmckl.h') ], + language = 'c' + ) + + +setup(name = mod_name, + version = '0.2.0', + author = "TREX-CoE", + author_email = "posenitskiy@irsamc.ups-tlse.fr", + description = """Python API of the QMCkl library""", + long_description = long_description, + long_description_content_type = "text/markdown", + ext_modules = [pyqmckl_module], + py_modules = [mod_name], + #package_dir = {"" : "src"}, + packages = ['pyqmckl'], + url = 'https://github.com/TREX-CoE/qmckl', + license = 'BSD', + classifiers=[ + "Intended Audience :: Science/Research", + "Intended Audience :: Developers", + "Topic :: Scientific/Engineering", + "Programming Language :: C", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: Implementation :: CPython", + "License :: OSI Approved :: BSD License", + "Operating System :: POSIX", + "Operating System :: Unix", + "Operating System :: MacOS" + ], + python_requires = ">=3.0", + install_requires = ['numpy>=1.17.3'] + )