Skip to content

Commit

Permalink
Transition to pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentRDC committed Dec 15, 2020
1 parent 9e719c5 commit d23e0d4
Show file tree
Hide file tree
Showing 31 changed files with 1,899 additions and 1,992 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,17 @@ jobs:
pip install -r requirements.txt
# Note the use of the -Wa flag to show DeprecationWarnings
# We run the tests on the installed package
- name: Unit tests
run: |
python -Wa -m unittest discover --verbose --buffer
pip install -r dev-requirements.txt
python setup.py install
cd ~
python -Wa -m pytest --pyargs skued --import-mode=importlib
- name: Build documentation
run: |
pip install -r dev-requirements.txt
python setup.py build_sphinx
- name: Doctests
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ Release 2.1.0

* The `fast` argument to `skued.align` and `skued.ialign` has been removed. It was previously-marked as deprecated.
* Fixed an issue where the detected shift in `skued.align` and `skued.ialign` might be partial (i.e. only shift in one direction).

* Fixed an issue with packaging data on Linux
* Added pre-emptive support for Python 3.10+ by removing deprecations.
* Migration of continuous integration testing to GitHub Actions.
* Migration of test infrastructure to pytest.
* Code snippets in documentation are now tested for correctness.
* Increased the precision of the pseudo-voigt approximation in `skued.pseudo_voigt`.
* Fixed many issues regarding documentation being out-of-date.
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ After installing scikit-ued you can use it like any other Python module
as `skued`.

Each version is tested against **Python 3.6+**. If you are using a
different version, tests can be run using the standard library\'s
`unittest` module.
different version, tests can be run using the `pytest` package.

Optional dependencies
---------------------
Expand Down
3 changes: 2 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Sphinx >= 3
sphinx_rtd_theme >= 0.4
cython >= 0.25
cython >= 0.25
pytest >= 6
6 changes: 2 additions & 4 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ repository::
Testing
=======

If you want to check that all the tests are running correctly with your Python
Testing requires `pytest`. If you want to check that all the tests are running correctly with your Python
configuration, type::

python setup.py test

This will only work if you have downloaded a copy of the source code.
python -m pytest --pyargs skued
12 changes: 7 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from glob import glob
from itertools import chain
from pathlib import Path
from unittest import TestLoader

# import numpy
# from Cython.Build import cythonize
Expand All @@ -18,10 +17,13 @@
BASE_PACKAGE = "skued"

WAVELET_FILES = chain.from_iterable(
[glob("skued\\baseline\\data\\*.npy"), glob("skued\\baseline\\data\\*.npz")]
[
(Path("skued") / "baseline" / "data").glob("*.npy"),
(Path("skued") / "baseline" / "data").glob("*.npz"),
]
)

FF_FILES = chain.from_iterable([glob("skued\\simulation\\data\\*.yaml")])
FF_FILES = chain.from_iterable([(Path("skued") / "baseline" / "data").glob("*.yaml")])

base_path = Path(__file__).parent
with open(base_path / BASE_PACKAGE / "__init__.py") as f:
Expand Down Expand Up @@ -71,8 +73,8 @@
python_requires=">=3.6",
packages=PACKAGES,
data_files=[
("skued\\baseline\\data", WAVELET_FILES),
("skued\\simulation\\data", FF_FILES),
(Path("skued") / "baseline" / "data", WAVELET_FILES),
(Path("skued") / "simulation" / "data", FF_FILES),
],
entry_points={"console_scripts": ["skued = skued.__main__:main"]},
include_package_data=True,
Expand Down
Loading

0 comments on commit d23e0d4

Please sign in to comment.