Skip to content

Commit

Permalink
Merge pull request #428 from openPMD/update_test
Browse files Browse the repository at this point in the history
Remove obsolete `python setup.py test` command
  • Loading branch information
RemiLehe authored Oct 23, 2024
2 parents 4aac40b + 0d34968 commit 3a431d4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 18 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ jobs:
conda install --yes cython numpy scipy h5py openpmd-api matplotlib jupyter pytest pyflakes python=${{ matrix.python-version }} python-wget
else
conda install --yes cython numpy scipy h5py matplotlib jupyter pytest pyflakes python=${{ matrix.python-version }} python-wget
fi
fi;
python setup.py install
- shell: bash -eo pipefail -l {0}
name: pyflakes
run: python -m pyflakes openpmd_viewer
- shell: bash -eo pipefail -l {0}
name: Test
run: python setup.py test
run: python -m pytest tests
5 changes: 3 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install cython numpy scipy h5py openpmd-api matplotlib jupyter pytest pyflakes wget
python -m pip install cython numpy scipy h5py openpmd-api matplotlib jupyter pytest pyflakes wget;
python setup.py install
- name: Test
run: python setup.py test
run: python -m pytest tests
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ git pull [email protected]:openPMD/openPMD-viewer.git dev
```
python -m pip wheel .
python -m pip install *whl matplotlib jupyter
python setup.py test
python -m pytest tests
```
(Be patient: the `test_tutorials.py` can take approx. 20 seconds if
you already downloaded the example openPMD files that are required
Expand Down
12 changes: 0 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand

# Get the long description
with open('./README.md') as f:
Expand All @@ -14,14 +12,6 @@
with open('./openpmd_viewer/__version__.py') as f:
exec( f.read() )

# Define a custom class to run the py.test with `python setup.py test`
class PyTest(TestCommand):

def run_tests(self):
import pytest
errcode = pytest.main([])
sys.exit(errcode)

# Main setup command
setup(name='openPMD-viewer',
version=__version__,
Expand All @@ -35,7 +25,6 @@ def run_tests(self):
packages=find_packages('.'),
package_data={'openpmd_viewer': ['notebook_starter/*.ipynb']},
scripts=['openpmd_viewer/notebook_starter/openPMD_notebook'],
tests_require=['pytest', 'jupyter'],
install_requires=install_requires,
extras_require = {
'all': ["ipympl", "ipywidgets", "matplotlib", "numba", "openpmd-api", "wget"],
Expand All @@ -45,7 +34,6 @@ def run_tests(self):
'numba': ["numba"],
'openpmd-api': ["openpmd-api"]
},
cmdclass={'test': PyTest},
platforms='any',
python_requires='>=3.8',
classifiers=[
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
by any of the following commands
$ python tests/test_tutorials.py
$ py.test
$ python setup.py test
$ python -m pytest tests
Copyright 2015-2016, openPMD-viewer contributors
Authors: Remi Lehe, Axel Huebl
Expand Down

0 comments on commit 3a431d4

Please sign in to comment.