Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resurrect CI #234

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 85 additions & 128 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ if test "x$enable_python_np" != xno && test "x$DISABLE_BINDINGS" = xno ; then
fi
if test "x$VALID_PYTHON_EXE" = xyes ; then
#now check cython
AC_CHECK_PROGS(CYTHON, [cython-[$PYTHON_VERSION] cython],["nocython"])
AC_CHECK_PROGS(CYTHON, [cython-[$PYTHON_VERSION] cython3 cython],["nocython"])
if test x$CYTHON != "xnocython" ; then
VALID_PYTHON_NUMPY=yes
AC_MSG_NOTICE([Building with Python-NumPy bindings])
Expand Down
5 changes: 2 additions & 3 deletions example/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ xrlexample2.sh: ../perl/xraylib.la xrlexample2.pl
#test the python bindings
xrlexample5.sh: ../python/_xraylib.la xrlexample5.py
@echo "Testing python bindings"
@echo "LD_LIBRARY_PATH=\"${top_builddir}/src/.libs\" DYLD_LIBRARY_PATH=\"${top_builddir}/src/.libs\" PATH=\"${top_builddir}/src/.libs\" PYTHONPATH=\"${top_builddir}/python:${top_builddir}/python/.libs\" $(PYTHON) ${top_srcdir}/example/xrlexample5.py" > xrlexample5.sh
@echo "EXTRA_DLL_SEARCH_PATHS=\"${abs_top_builddir}/src/.libs\" LD_LIBRARY_PATH=\"${top_builddir}/src/.libs\" DYLD_LIBRARY_PATH=\"${top_builddir}/src/.libs\" PATH=\"${top_builddir}/src/.libs\" PYTHONPATH=\"${top_builddir}/python:${top_builddir}/python/.libs\" $(PYTHON) ${top_srcdir}/example/xrlexample5.py" > xrlexample5.sh
@chmod +x xrlexample5.sh

#test the java bindings
Expand Down Expand Up @@ -134,10 +134,9 @@ xrlexample12.sh: ../php/xraylib.la xrlexample12.php
#test the numpy-python bindings
xrlexample13.sh: ../python/xraylib_np.la xrlexample13.py
@echo "Testing python-numpy bindings"
@echo "LD_LIBRARY_PATH=\"${top_builddir}/src/.libs\" DYLD_LIBRARY_PATH=\"${top_builddir}/src/.libs\" PATH=\"${top_builddir}/src/.libs\" PYTHONPATH=\"${top_builddir}/python:${top_builddir}/python/.libs\" $(PYTHON) ${top_srcdir}/example/xrlexample13.py" > xrlexample13.sh
@echo "EXTRA_DLL_SEARCH_PATHS=\"${abs_top_builddir}/src/.libs\" LD_LIBRARY_PATH=\"${top_builddir}/src/.libs\" DYLD_LIBRARY_PATH=\"${top_builddir}/src/.libs\" PATH=\"${top_builddir}/src/.libs\" PYTHONPATH=\"${top_builddir}/python:${top_builddir}/python/.libs\" $(PYTHON) ${top_srcdir}/example/xrlexample13.py" > xrlexample13.sh
@chmod +x xrlexample13.sh


#testing the Pascal-Delphi bindings
xrlexample14.sh: ../pascal/xraylib.ppu xrlexample14.pas
@echo "Testing Pascal bindings"
Expand Down
5 changes: 4 additions & 1 deletion example/xrlexample13.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
#THIS SOFTWARE IS PROVIDED BY Tom Schoonjans ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Tom Schoonjans BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


import os
if "EXTRA_DLL_SEARCH_PATHS" in os.environ and hasattr(os, "add_dll_directory"):
for path in os.environ["EXTRA_DLL_SEARCH_PATHS"].split(os.pathsep):
os.add_dll_directory(path)
import numpy as np
import xraylib_np as xrl_np
import sys



if __name__ == '__main__' :
xrl_np.XRayInit()
print ("Example of python-numpy program using xraylib")
Expand Down
5 changes: 4 additions & 1 deletion example/xrlexample5.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@

"""Example of using various xraylib functionality in python."""


import os
if "EXTRA_DLL_SEARCH_PATHS" in os.environ and hasattr(os, "add_dll_directory"):
for path in os.environ["EXTRA_DLL_SEARCH_PATHS"].split(os.pathsep):
os.add_dll_directory(path)
import xraylib
import math
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion java/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion python/tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ NULL=
TEST_EXTENSIONS = .py
PY_LOG_COMPILER = $(PYTHON)
AM_PY_LOG_FLAGS =
AM_TESTS_ENVIRONMENT = LD_LIBRARY_PATH='${top_builddir}/src/.libs' DYLD_LIBRARY_PATH='${top_builddir}/src/.libs' PATH='${top_builddir}/src/.libs' PYTHONPATH='${top_builddir}/python:${top_builddir}/python/.libs' ; export LD_LIBRARY_PATH DYLD_LIBRARY_PATH PATH PYTHONPATH ;
AM_TESTS_ENVIRONMENT = EXTRA_DLL_SEARCH_PATHS='${abs_top_builddir}/src/.libs' LD_LIBRARY_PATH='${top_builddir}/src/.libs' DYLD_LIBRARY_PATH='${top_builddir}/src/.libs' PATH='${top_builddir}/src/.libs' PYTHONPATH='${top_builddir}/python:${top_builddir}/python/.libs' ; export LD_LIBRARY_PATH DYLD_LIBRARY_PATH PATH PYTHONPATH EXTRA_DLL_SEARCH_PATHS ;

if ENABLE_PYTHON
dist_check_SCRIPTS = \
Expand Down
3 changes: 1 addition & 2 deletions python/tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ test_env = environment()
test_env.prepend('PYTHONPATH', pydir)
if host_system == 'windows'
test_env.prepend('PATH', src_build_dir)
# see https://github.com/xhochy/python-feedstock/blob/6efc12d0479e958a138bfaf3d1eb6b47a10d5f68/recipe/patches/0014-Add-CondaEcosystemModifyDllSearchPath.patch
test_env.prepend('CONDA_DLL_SEARCH_MODIFICATION_ENABLE', '1')
test_env.append('EXTRA_DLL_SEARCH_PATHS', src_build_dir)
endif

foreach _test : tests
Expand Down
5 changes: 5 additions & 0 deletions python/tests/test-atomiclevelwidth.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import os
if "EXTRA_DLL_SEARCH_PATHS" in os.environ and hasattr(os, "add_dll_directory"):
for path in os.environ["EXTRA_DLL_SEARCH_PATHS"].split(os.pathsep):
os.add_dll_directory(path)
import unittest
import xraylib


class TestAtomicLevelWidth(unittest.TestCase):
def test_Fe_K(self):
width = xraylib.AtomicLevelWidth(26, xraylib.K_SHELL)
Expand Down
5 changes: 5 additions & 0 deletions python/tests/test-atomicweight.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import os
if "EXTRA_DLL_SEARCH_PATHS" in os.environ and hasattr(os, "add_dll_directory"):
for path in os.environ["EXTRA_DLL_SEARCH_PATHS"].split(os.pathsep):
os.add_dll_directory(path)
import unittest
import xraylib


class TestAtomicWeight(unittest.TestCase):
def test_Fe(self):
weight = xraylib.AtomicWeight(26)
Expand Down
5 changes: 5 additions & 0 deletions python/tests/test-auger.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import os
if "EXTRA_DLL_SEARCH_PATHS" in os.environ and hasattr(os, "add_dll_directory"):
for path in os.environ["EXTRA_DLL_SEARCH_PATHS"].split(os.pathsep):
os.add_dll_directory(path)
import unittest
import xraylib


class TestAugerRate(unittest.TestCase):
def test_Pb_K_L3M5(self):
rate = xraylib.AugerRate(82, xraylib.K_L3M5_AUGER)
Expand Down
5 changes: 5 additions & 0 deletions python/tests/test-compoundparser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import os
if "EXTRA_DLL_SEARCH_PATHS" in os.environ and hasattr(os, "add_dll_directory"):
for path in os.environ["EXTRA_DLL_SEARCH_PATHS"].split(os.pathsep):
os.add_dll_directory(path)
import unittest
import xraylib


class TestCompoundParser(unittest.TestCase):
def test_good_compounds(self):
self.assertIsInstance(xraylib.CompoundParser("C19H29COOH"), dict)
Expand Down
5 changes: 5 additions & 0 deletions python/tests/test-comptonprofiles.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import os
if "EXTRA_DLL_SEARCH_PATHS" in os.environ and hasattr(os, "add_dll_directory"):
for path in os.environ["EXTRA_DLL_SEARCH_PATHS"].split(os.pathsep):
os.add_dll_directory(path)
import unittest
import xraylib


class TestComptonProfiles(unittest.TestCase):
def test_pz_0(self):
profile = xraylib.ComptonProfile(26, 0.0)
Expand Down
5 changes: 5 additions & 0 deletions python/tests/test-crystal_diffraction.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import os
if "EXTRA_DLL_SEARCH_PATHS" in os.environ and hasattr(os, "add_dll_directory"):
for path in os.environ["EXTRA_DLL_SEARCH_PATHS"].split(os.pathsep):
os.add_dll_directory(path)
import unittest
import xraylib
import math


class TestCrystalDiffraction(unittest.TestCase):
def test_crystal_diffraction(self):
crystals_list = xraylib.Crystal_GetCrystalsList()
Expand Down
5 changes: 5 additions & 0 deletions python/tests/test-nist-compounds.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import os
if "EXTRA_DLL_SEARCH_PATHS" in os.environ and hasattr(os, "add_dll_directory"):
for path in os.environ["EXTRA_DLL_SEARCH_PATHS"].split(os.pathsep):
os.add_dll_directory(path)
import unittest
import xraylib


class TestNISTCompounds(unittest.TestCase):
def test_good(self):
list = xraylib.GetCompoundDataNISTList()
Expand Down
6 changes: 6 additions & 0 deletions python/tests/test-numpy.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import os
if "EXTRA_DLL_SEARCH_PATHS" in os.environ and hasattr(os, "add_dll_directory"):
for path in os.environ["EXTRA_DLL_SEARCH_PATHS"].split(os.pathsep):
os.add_dll_directory(path)
import unittest
import xraylib
import numpy as np



class TestNumpy(unittest.TestCase):
def _test_np(self, dtype):
for Z in np.arange(10, 20, dtype=dtype):
Expand Down
5 changes: 5 additions & 0 deletions python/tests/test-radionuclides.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import os
if "EXTRA_DLL_SEARCH_PATHS" in os.environ and hasattr(os, "add_dll_directory"):
for path in os.environ["EXTRA_DLL_SEARCH_PATHS"].split(os.pathsep):
os.add_dll_directory(path)
import unittest
import xraylib


class TestRadionuclides(unittest.TestCase):
def test_good(self):
list = xraylib.GetRadioNuclideDataList()
Expand Down