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

make python directory and adapt build process

This commit is contained in:
q-posev 2021-08-05 12:55:18 +03:00
parent b8c188343e
commit 2854d617d4
8 changed files with 24 additions and 15 deletions

View File

@ -1 +0,0 @@
include README.md src/pytrexio.py src/pytrexio_wrap.c src/trexio.c src/trexio_hdf5.c src/trexio_text.c

1
python/MANIFEST.in Normal file
View File

@ -0,0 +1 @@
include src/pytrexio.py src/pytrexio_wrap.c src/trexio.c src/trexio_hdf5.c src/trexio_text.c

12
python/setup.cfg Normal file
View File

@ -0,0 +1,12 @@
[metadata]
long_description = file: README.md
licence_file = LICENSE
project_urls =
Bug Tracker = https://github.com/TREX-CoE/trexio/issues
license = BSD 3-Clause License
[options]
zip_safe = False
python_requires = >=3.6
install_requires = h5py

View File

@ -13,6 +13,7 @@ srcpath = os.path.join(rootpath, 'src')
c_files = ['trexio.c', 'trexio_hdf5.c', 'trexio_text.c', 'pytrexio_wrap.c'] c_files = ['trexio.c', 'trexio_hdf5.c', 'trexio_text.c', 'pytrexio_wrap.c']
h_files = ['trexio.h', 'trexio_hdf5.h', 'trexio_text.h', 'trexio_s.h', 'trexio_private.h'] h_files = ['trexio.h', 'trexio_hdf5.h', 'trexio_text.h', 'trexio_s.h', 'trexio_private.h']
# setup.py does not copy all
with open("README.md", "r") as fh: with open("README.md", "r") as fh:
long_description = fh.read() long_description = fh.read()
@ -36,7 +37,6 @@ setup(name = 'pytrexio',
long_description_content_type = "text/markdown", long_description_content_type = "text/markdown",
ext_modules = [pytrexio_module], ext_modules = [pytrexio_module],
py_modules = ["pytrexio"], py_modules = ["pytrexio"],
scripts = ["tests/test_py.py"],
url = 'https://github.com/TREX-CoE/trexio', url = 'https://github.com/TREX-CoE/trexio',
license = 'BSD', license = 'BSD',
packages = find_packages(), packages = find_packages(),

View File

@ -6,9 +6,14 @@ set -e
#source version.py #source version.py
python3 -m pip install --upgrade setuptools wheel twine python3 -m pip install --upgrade setuptools wheel twine
python3 -s setup.py --no-user-cfg build #python3 -s setup.py --no-user-cfg build
python3 -s setup.py build
python3 setup.py sdist bdist_wheel python3 setup.py sdist bdist_wheel
python3 -m pip install dist/pytrexio-0.1-cp38-cp38-linux_x86_64.whl python3 -m pip install dist/pytrexio-0.1-*.whl --force-reinstall
# remove
#python3 -m pip uninstall pytrexio
#python3 -m twine upload dist/pytrexio-0.1.tar.gz #python3 -m twine upload dist/pytrexio-0.1.tar.gz
# NOTE:I get an error: # NOTE:I get an error:
@ -16,6 +21,7 @@ python3 -m pip install dist/pytrexio-0.1-cp38-cp38-linux_x86_64.whl
# when uploading the wheel instead of the tar.gz file to testpypi # when uploading the wheel instead of the tar.gz file to testpypi
# This is a well-known issue, see https://stackoverflow.com/questions/59451069/binary-wheel-cant-be-uploaded-on-pypi-using-twine # This is a well-known issue, see https://stackoverflow.com/questions/59451069/binary-wheel-cant-be-uploaded-on-pypi-using-twine
python3 -m twine upload --repository testpypi dist/pytrexio-0.1.tar.gz #python3 -m twine upload --repository testpypi dist/pytrexio-0.1.tar.gz
rm -rf build dist pytrexio.egg-info rm -rf build pytrexio.egg-info
rm -rf dist

View File

@ -1,9 +0,0 @@
[metadata]
description-file = README.md
project_urls =
Bug Tracker = https://github.com/TREX-CoE/trexio/issues
[options]
python_requires = >=3.6