1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-08-24 22:21:43 +02:00

better structure of the python directory

This commit is contained in:
q-posev 2021-08-18 15:40:42 +03:00
parent df91b9e7e5
commit 902147b45b
6 changed files with 11 additions and 10 deletions

View File

@ -186,8 +186,8 @@ cppcheck.out: $(trexio_h)
setup_py = $(srcdir)/python/setup.py
setup_cfg = $(srcdir)/python/setup.cfg
pytrexio_py = $(srcdir)/python/trexio/pytrexio.py
trexio_api_py = $(srcdir)/python/trexio/trexio_api.py
pytrexio_py = $(srcdir)/python/pytrexio/pytrexio.py
trexio_py = $(srcdir)/python/trexio.py
TEST_PY = $(srcdir)/python/test/test_api.py
pytrexio_c = $(srcdir)/src/pytrexio_wrap.c
pytrexio_i = $(srcdir)/src/pytrexio.i
@ -219,7 +219,7 @@ check-numpy:
CLEANFILES += $(pytrexio_c) \
$(pytrexio_py) \
$(trexio_api_py) \
$(trexio_py) \
python/src/*.c \
python/src/*.h

View File

@ -15,7 +15,7 @@ with open("README.md", "r") as fh:
long_description = fh.read()
pytrexio_module = Extension('trexio._pytrexio',
pytrexio_module = Extension('pytrexio._pytrexio',
sources = [os.path.join(srcpath, code) for code in c_files],
include_dirs = ['/usr/include/hdf5/serial', srcpath],
libraries = ['hdf5', 'hdf5_hl'],
@ -32,7 +32,8 @@ setup(name = 'trexio',
long_description = long_description,
long_description_content_type = "text/markdown",
ext_modules = [pytrexio_module],
packages = ['trexio'],
py_modules = ['trexio'],
packages = ['pytrexio'],
url = 'https://github.com/TREX-CoE/trexio',
license = 'BSD',
classifiers=[

View File

@ -10,7 +10,7 @@ echo "" >> trexio.h
cat prefix_s_front.h > trexio_s.h
cat prefix_fortran.f90 > trexio_f.f90
cat prefix_python.py > trexio_api.py
cat prefix_python.py > trexio.py
# c front end
cat populated/pop_*.c >> trexio.c
@ -23,7 +23,7 @@ cat helper_fortran.f90 >> trexio_f.f90
cat populated/pop_*.fh_90 >> trexio_f.f90
# python front end
cat populated/pop_*.py >> trexio_api.py
cat populated/pop_*.py >> trexio.py
# suffixes
cat suffix_s_front.h >> trexio_s.h

View File

@ -21,7 +21,7 @@
** Python
#+begin_src python :tangle prefix_python.py
try:
from trexio.pytrexio import *
from pytrexio.pytrexio import *
except ImportError:
raise Exception("Could not import pytrexio module from trexio package")

View File

@ -13,7 +13,7 @@ readonly SRC=${TREXIO_ROOT}/src
readonly INCLUDIR=${TREXIO_ROOT}/include
readonly TOOLS=${TREXIO_ROOT}/tools
readonly PYDIR=${TREXIO_ROOT}/python
readonly PYTREXIODIR=${PYDIR}/trexio
readonly PYTREXIODIR=${PYDIR}/pytrexio
# We want the script to crash on the 1st error:
set -e
@ -24,7 +24,7 @@ mkdir -p ${PYTREXIODIR}
# Copy all the source code and header files in the corresponding python directory
mv ${SRC}/pytrexio.py ${PYTREXIODIR}
mv ${SRC}/trexio_api.py ${PYTREXIODIR}
mv ${SRC}/trexio.py ${PYDIR}
cp ${SRC}/*.c ${PYDIR}/src
cp ${SRC}/*.h ${PYDIR}/src
cp ${INCLUDIR}/trexio.h ${PYDIR}/src