diff --git a/python/MANIFEST.in b/MANIFEST.in similarity index 100% rename from python/MANIFEST.in rename to MANIFEST.in diff --git a/python/pyproject.toml b/pyproject.toml similarity index 100% rename from python/pyproject.toml rename to pyproject.toml diff --git a/python/setup.cfg b/setup.cfg similarity index 100% rename from python/setup.cfg rename to setup.cfg diff --git a/python/setup.py b/setup.py similarity index 100% rename from python/setup.py rename to setup.py diff --git a/python/test.py b/src/test.py similarity index 84% rename from python/test.py rename to src/test.py index d0649b5..ed3632f 100644 --- a/python/test.py +++ b/src/test.py @@ -4,15 +4,6 @@ import shutil from pytrexio import * -# TODO: make a user-friendly more pythonic API that will have to be autogenerated -# add Exception handling -# check of dimensions and call to safe API -# conversion to and from numpy arrays - -# automatically download (hopefully the latest version) numpy.i using -# wget https://raw.githubusercontent.com/numpy/numpy/main/tools/swig/numpy.i -# but also keep the original copy in case if wget fails - #=========================================================# #======== SETUP THE BACK END AND OUTPUT FILE NAME ========# #=========================================================# @@ -91,18 +82,14 @@ assert rc==TREXIO_SUCCESS test_file2 = trexio_open(output_filename, 'r', TEST_TREXIO_BACKEND) -# TODO: think about adding exception handling if rc != TREXIO_SUCCESS throw an exception but do not return the code itself and then there is less arguments -# TODO: maybe also for the write - result = trexio_read_nucleus_num(test_file2) -assert result[0]==TREXIO_SUCCESS +assert result[0]==0 assert result[1]==nucleus_num #print(result) charges2 = doubleArray(nucleus_num) -print(charges2[3]) -#for i in range(nucleus_num): -# charges2[i] = -1. +for i in range(nucleus_num): + charges2[i] = -1. rc = trexio_read_nucleus_charge(test_file2, charges2) assert rc==TREXIO_SUCCESS diff --git a/python/test-pypi-release-pytrexio.sh b/test-pypi-release-pytrexio.sh similarity index 72% rename from python/test-pypi-release-pytrexio.sh rename to test-pypi-release-pytrexio.sh index a4fa0fd..e208d33 100755 --- a/python/test-pypi-release-pytrexio.sh +++ b/test-pypi-release-pytrexio.sh @@ -15,9 +15,7 @@ python3 -m pip install dist/pytrexio-0.1-cp38-cp38-linux_x86_64.whl # Binary wheel 'pytrexio-0.1-cp38-cp38-linux_x86_64.whl' has an unsupported platform tag 'linux_x86_64'. # 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 - -# TODO: see how SQLite does things since it-s similar to out problem in a way that the have src/ directory with C source and header files and they have master setup.py script to compile and ship it - -#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