1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-11-03 20:54:07 +01:00

make trexio a Python package instead of a module to fix some installation issues

This commit is contained in:
q-posev 2021-08-18 13:26:57 +03:00
parent 9f8b6838df
commit 31b14a891a
3 changed files with 11 additions and 11 deletions

View File

@ -186,15 +186,15 @@ cppcheck.out: $(trexio_h)
setup_py = $(srcdir)/python/setup.py setup_py = $(srcdir)/python/setup.py
setup_cfg = $(srcdir)/python/setup.cfg setup_cfg = $(srcdir)/python/setup.cfg
pytrexio_py = $(srcdir)/python/pytrexio.py pytrexio_py = $(srcdir)/python/trexio/pytrexio.py
TESTS_PY = $(srcdir)/python/test/test_py.py TEST_PY = $(srcdir)/python/test/test_full.py
pytrexio_c = $(srcdir)/src/pytrexio_wrap.c pytrexio_c = $(srcdir)/src/pytrexio_wrap.c
pytrexio_i = $(srcdir)/src/pytrexio.i pytrexio_i = $(srcdir)/src/pytrexio.i
numpy_i = $(srcdir)/src/numpy.i numpy_i = $(srcdir)/src/numpy.i
python-test: $(pytrexio_py) $(TESTS_PY) python-test: $(pytrexio_py) $(TEST_PY)
python3 $(TESTS_PY) python3 $(TEST_PY)
$(RM) -r -- __pycache__ $(RM) -r -- __pycache__
python-install: $(pytrexio_py) $(setup_py) $(setup_cfg) python-install: $(pytrexio_py) $(setup_py) $(setup_cfg)
@ -218,7 +218,8 @@ check-numpy:
CLEANFILES += src/pytrexio_wrap.c \ CLEANFILES += src/pytrexio_wrap.c \
src/pytrexio.py \ src/pytrexio.py \
python/pytrexio.py \ python/trexio/pytrexio.py \
python/trexio/trexio.py \
python/src/*.c \ python/src/*.c \
python/src/*.h python/src/*.h

View File

@ -1,10 +1,10 @@
#!/usr/bin/env python #!/usr/bin/env python
""" """
setup.py file for pytrexio setup.py file for TREXIO Python package
""" """
from setuptools import setup, Extension, find_packages from setuptools import setup, Extension
import os import os
rootpath = os.path.dirname(os.path.abspath(__file__)) rootpath = os.path.dirname(os.path.abspath(__file__))
@ -15,7 +15,7 @@ with open("README.md", "r") as fh:
long_description = fh.read() long_description = fh.read()
pytrexio_module = Extension('_pytrexio', pytrexio_module = Extension('trexio._pytrexio',
sources = [os.path.join(srcpath, code) for code in c_files], sources = [os.path.join(srcpath, code) for code in c_files],
include_dirs = ['/usr/include/hdf5/serial', srcpath], include_dirs = ['/usr/include/hdf5/serial', srcpath],
libraries = ['hdf5', 'hdf5_hl'], libraries = ['hdf5', 'hdf5_hl'],
@ -24,7 +24,7 @@ pytrexio_module = Extension('_pytrexio',
) )
setup(name = 'pytrexio', setup(name = 'trexio',
version = '0.1', version = '0.1',
author = "TREX-CoE", author = "TREX-CoE",
author_email = "posenitskiy@irsamc.ups-tlse.fr", author_email = "posenitskiy@irsamc.ups-tlse.fr",
@ -32,10 +32,9 @@ setup(name = 'pytrexio',
long_description = long_description, long_description = long_description,
long_description_content_type = "text/markdown", long_description_content_type = "text/markdown",
ext_modules = [pytrexio_module], ext_modules = [pytrexio_module],
py_modules = ["pytrexio"], packages = ['trexio'],
url = 'https://github.com/TREX-CoE/trexio', url = 'https://github.com/TREX-CoE/trexio',
license = 'BSD', license = 'BSD',
packages = find_packages(),
classifiers=[ classifiers=[
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"Programming Language :: C", "Programming Language :: C",

View File