@@ -22,7 +22,7 @@ jobs:
# without GTest and Boost
- name: Install Python NumPy and Pybind11
- run: sudo apt install python-numpy python-all-dev python-numpy-dev python3-pybind11
+ run: sudo apt install python-numpy python-all-dev python-numpy-dev python3-pybind11 && sudo pip3 install tox
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
@@ -119,3 +119,6 @@ add_subdirectory(tests)
add_test(NAME BuildExtWithPythonSetupPy
COMMAND ${Python_EXECUTABLE} setup.py build_ext
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+add_test(NAME tox
+ COMMAND tox)
+
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools", "pybind11", "numpy"]
+build-backend = "setuptools.build_meta"
@@ -1,6 +1 @@
-scipy~=1.3.3
-numpy~=1.17.4
-matplotlib~=3.1.2
-PyYAML~=5.3.1
-pybind11~=2.4.3
-setuptools~=45.2.0
+.
@@ -84,6 +84,7 @@ def run_setup(extensions):
license='GPL',
platforms='any',
packages=['scattnlay'], # , 'scattnlay_dp', 'scattnlay_mp'],
+ test_suite="tests",
ext_modules=extensions
)
@@ -0,0 +1,11 @@
+# tox (https://tox.readthedocs.io/) is a tool for running tests
+# in multiple virtualenvs. This configuration file will run the
+# test suite on all supported python versions. To use it, "pip install tox"
+# and then run "tox" from this directory.
+[tox]
+envlist = py38, py39, py310
+[testenv]
+commands =
+ python -m unittest tests/test_py.py