mirror of
https://github.com/TREX-CoE/trexio.git
synced 2025-01-08 20:33:36 +01:00
better structure of the python directory
This commit is contained in:
parent
df91b9e7e5
commit
902147b45b
@ -186,8 +186,8 @@ 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/trexio/pytrexio.py
|
pytrexio_py = $(srcdir)/python/pytrexio/pytrexio.py
|
||||||
trexio_api_py = $(srcdir)/python/trexio/trexio_api.py
|
trexio_py = $(srcdir)/python/trexio.py
|
||||||
TEST_PY = $(srcdir)/python/test/test_api.py
|
TEST_PY = $(srcdir)/python/test/test_api.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
|
||||||
@ -219,7 +219,7 @@ check-numpy:
|
|||||||
|
|
||||||
CLEANFILES += $(pytrexio_c) \
|
CLEANFILES += $(pytrexio_c) \
|
||||||
$(pytrexio_py) \
|
$(pytrexio_py) \
|
||||||
$(trexio_api_py) \
|
$(trexio_py) \
|
||||||
python/src/*.c \
|
python/src/*.c \
|
||||||
python/src/*.h
|
python/src/*.h
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ with open("README.md", "r") as fh:
|
|||||||
long_description = fh.read()
|
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],
|
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'],
|
||||||
@ -32,7 +32,8 @@ setup(name = 'trexio',
|
|||||||
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],
|
||||||
packages = ['trexio'],
|
py_modules = ['trexio'],
|
||||||
|
packages = ['pytrexio'],
|
||||||
url = 'https://github.com/TREX-CoE/trexio',
|
url = 'https://github.com/TREX-CoE/trexio',
|
||||||
license = 'BSD',
|
license = 'BSD',
|
||||||
classifiers=[
|
classifiers=[
|
||||||
|
@ -10,7 +10,7 @@ echo "" >> trexio.h
|
|||||||
|
|
||||||
cat prefix_s_front.h > trexio_s.h
|
cat prefix_s_front.h > trexio_s.h
|
||||||
cat prefix_fortran.f90 > trexio_f.f90
|
cat prefix_fortran.f90 > trexio_f.f90
|
||||||
cat prefix_python.py > trexio_api.py
|
cat prefix_python.py > trexio.py
|
||||||
|
|
||||||
# c front end
|
# c front end
|
||||||
cat populated/pop_*.c >> trexio.c
|
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
|
cat populated/pop_*.fh_90 >> trexio_f.f90
|
||||||
|
|
||||||
# python front end
|
# python front end
|
||||||
cat populated/pop_*.py >> trexio_api.py
|
cat populated/pop_*.py >> trexio.py
|
||||||
|
|
||||||
# suffixes
|
# suffixes
|
||||||
cat suffix_s_front.h >> trexio_s.h
|
cat suffix_s_front.h >> trexio_s.h
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
** Python
|
** Python
|
||||||
#+begin_src python :tangle prefix_python.py
|
#+begin_src python :tangle prefix_python.py
|
||||||
try:
|
try:
|
||||||
from trexio.pytrexio import *
|
from pytrexio.pytrexio import *
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise Exception("Could not import pytrexio module from trexio package")
|
raise Exception("Could not import pytrexio module from trexio package")
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ readonly SRC=${TREXIO_ROOT}/src
|
|||||||
readonly INCLUDIR=${TREXIO_ROOT}/include
|
readonly INCLUDIR=${TREXIO_ROOT}/include
|
||||||
readonly TOOLS=${TREXIO_ROOT}/tools
|
readonly TOOLS=${TREXIO_ROOT}/tools
|
||||||
readonly PYDIR=${TREXIO_ROOT}/python
|
readonly PYDIR=${TREXIO_ROOT}/python
|
||||||
readonly PYTREXIODIR=${PYDIR}/trexio
|
readonly PYTREXIODIR=${PYDIR}/pytrexio
|
||||||
|
|
||||||
# We want the script to crash on the 1st error:
|
# We want the script to crash on the 1st error:
|
||||||
set -e
|
set -e
|
||||||
@ -24,7 +24,7 @@ mkdir -p ${PYTREXIODIR}
|
|||||||
|
|
||||||
# Copy all the source code and header files in the corresponding python directory
|
# Copy all the source code and header files in the corresponding python directory
|
||||||
mv ${SRC}/pytrexio.py ${PYTREXIODIR}
|
mv ${SRC}/pytrexio.py ${PYTREXIODIR}
|
||||||
mv ${SRC}/trexio_api.py ${PYTREXIODIR}
|
mv ${SRC}/trexio.py ${PYDIR}
|
||||||
cp ${SRC}/*.c ${PYDIR}/src
|
cp ${SRC}/*.c ${PYDIR}/src
|
||||||
cp ${SRC}/*.h ${PYDIR}/src
|
cp ${SRC}/*.h ${PYDIR}/src
|
||||||
cp ${INCLUDIR}/trexio.h ${PYDIR}/src
|
cp ${INCLUDIR}/trexio.h ${PYDIR}/src
|
||||||
|
Loading…
Reference in New Issue
Block a user