diff --git a/README.md b/README.md index 78cda5b..3790162 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ # python-pytest-regressions -The python-pytest-regressions package +This [pytest](https://pytest.org/) plugin makes it simple to test general +data, images, files, and numeric tables by saving *expected* data in a +*data directory* (courtesy of +[pytest-datadir]((https://github.com/gabrielcnr/pytest-datadir))) that can be +used to verify that future runs produce the same data. diff --git a/python-pytest-regressions-numexpr.patch b/python-pytest-regressions-numexpr.patch new file mode 100644 index 0000000..294640a --- /dev/null +++ b/python-pytest-regressions-numexpr.patch @@ -0,0 +1,7 @@ +--- a/tox.ini 2022-01-04 05:08:13.000000000 -0700 ++++ b/tox.ini 2022-01-04 08:48:55.580542538 -0700 +@@ -35,3 +35,4 @@ filterwarnings= + ignore::DeprecationWarning:imp + ignore::PendingDeprecationWarning:distutils + ignore::DeprecationWarning:distutils ++ ignore::DeprecationWarning:numexpr diff --git a/python-pytest-regressions-numpy.patch b/python-pytest-regressions-numpy.patch deleted file mode 100644 index c97013b..0000000 --- a/python-pytest-regressions-numpy.patch +++ /dev/null @@ -1,99 +0,0 @@ ---- a/src/pytest_regressions/dataframe_regression.py 2021-01-27 05:48:09.000000000 -0700 -+++ b/src/pytest_regressions/dataframe_regression.py 2021-06-29 15:40:53.166306005 -0600 -@@ -123,7 +123,7 @@ class DataFrameRegressionFixture: - self._check_data_shapes(obtained_column, expected_column) - - data_type = obtained_column.values.dtype -- if data_type in [float, np.float, np.float16, np.float32, np.float64]: -+ if data_type in [float, np.float16, np.float32, np.float64]: - not_close_mask = ~np.isclose( - obtained_column.values, - expected_column.values, -@@ -137,7 +137,7 @@ class DataFrameRegressionFixture: - diff_ids = np.where(not_close_mask)[0] - diff_obtained_data = obtained_column[diff_ids] - diff_expected_data = expected_column[diff_ids] -- if data_type == np.bool: -+ if data_type == bool: - diffs = np.logical_xor(obtained_column, expected_column)[diff_ids] - else: - diffs = np.abs(obtained_column - expected_column)[diff_ids] ---- a/tests/test_dataframe_regression.py 2021-01-27 05:48:09.000000000 -0700 -+++ b/tests/test_dataframe_regression.py 2021-06-29 15:45:46.134848704 -0600 -@@ -193,7 +193,7 @@ def test_arrays_with_different_sizes(dat - - - def test_integer_values_smoke_test(dataframe_regression, no_regen): -- data1 = np.ones(11, dtype=np.int) -+ data1 = np.ones(11, dtype=int) - dataframe_regression.check(pd.DataFrame.from_dict({"data1": data1})) - - -@@ -203,7 +203,7 @@ def test_number_formats(dataframe_regres - - - def test_bool_array(dataframe_regression, no_regen): -- data1 = np.array([True, True, True], dtype=np.bool) -+ data1 = np.array([True, True, True], dtype=bool) - with pytest.raises(AssertionError) as excinfo: - dataframe_regression.check(pd.DataFrame.from_dict({"data1": data1})) - obtained_error_msg = str(excinfo.value) -@@ -228,8 +228,8 @@ def test_bool_array(dataframe_regression - - def test_arrays_of_same_size(dataframe_regression): - same_size_int_arrays = { -- "hello": np.zeros((1,), dtype=np.int), -- "world": np.zeros((1,), dtype=np.int), -+ "hello": np.zeros((1,), dtype=int), -+ "world": np.zeros((1,), dtype=int), - } - dataframe_regression.check(pd.DataFrame.from_dict(same_size_int_arrays)) - ---- a/tests/test_num_regression.py 2021-01-27 05:48:09.000000000 -0700 -+++ b/tests/test_num_regression.py 2021-06-29 15:45:32.014822554 -0600 -@@ -169,7 +169,7 @@ def test_different_data_types(num_regres - - - def test_n_dimensions(num_regression, no_regen): -- data1 = np.ones(shape=(10, 10), dtype=np.int) -+ data1 = np.ones(shape=(10, 10), dtype=int) - with pytest.raises( - AssertionError, - match="Only 1D arrays are supported on num_data_regression fixture.", -@@ -186,7 +186,7 @@ def test_arrays_with_different_sizes(num - - - def test_integer_values_smoke_test(num_regression, no_regen): -- data1 = np.ones(11, dtype=np.int) -+ data1 = np.ones(11, dtype=int) - num_regression.check({"data1": data1}) - - -@@ -228,7 +228,7 @@ def test_fill_different_shape_with_nan_f - - - def test_bool_array(num_regression, no_regen): -- data1 = np.array([True, True, True], dtype=np.bool) -+ data1 = np.array([True, True, True], dtype=bool) - with pytest.raises(AssertionError) as excinfo: - num_regression.check({"data1": data1}) - obtained_error_msg = str(excinfo.value) -@@ -253,8 +253,8 @@ def test_bool_array(num_regression, no_r - - def test_arrays_of_same_size(num_regression): - same_size_int_arrays = { -- "hello": np.zeros((1,), dtype=np.int), -- "world": np.zeros((1,), dtype=np.int), -+ "hello": np.zeros((1,), dtype=int), -+ "world": np.zeros((1,), dtype=int), - } - num_regression.check(same_size_int_arrays) - ---- a/tox.ini 2021-01-27 05:48:09.000000000 -0700 -+++ b/tox.ini 2021-07-29 10:05:57.862722002 -0600 -@@ -35,3 +35,5 @@ filterwarnings= - ignore::DeprecationWarning:imp - ignore::PendingDeprecationWarning:distutils - ignore::DeprecationWarning:distutils -+ ignore::DeprecationWarning:pandas -+ ignore::DeprecationWarning:numexpr diff --git a/python-pytest-regressions.spec b/python-pytest-regressions.spec index fc459e5..53b9563 100644 --- a/python-pytest-regressions.spec +++ b/python-pytest-regressions.spec @@ -1,17 +1,14 @@ %global srcname pytest-regressions Name: python-%{srcname} -Version: 2.2.0 +Version: 2.3.0 Release: 1%{?dist} Summary: Pytest fixtures for writing regression tests License: MIT URL: https://pytest-regressions.readthedocs.io/ Source0: https://github.com/ESSS/%{srcname}/archive/%{version}/%{srcname}-%{version}.tar.gz -# The code uses deprecated numpy types (np.bool, np.float, and np.int). Numpy -# raises DeprecationWarnings, which cause tests to fail. Use bool, float, and -# int instead. -# https://github.com/ESSS/pytest-regressions/commit/ffad2c7fd1d110f420f4e3ca3d39d90cae18a972 -Patch0: %{name}-numpy.patch +# Ignore deprecation warnings triggered by numexpr +Patch0: %{name}-numexpr.patch BuildArch: noarch @@ -22,6 +19,7 @@ BuildRequires: %{py3_dist matplotlib} BuildRequires: %{py3_dist numpy} BuildRequires: %{py3_dist pandas} BuildRequires: %{py3_dist pillow} +BuildRequires: %{py3_dist pip} BuildRequires: %{py3_dist pytest} BuildRequires: %{py3_dist pytest-datadir} BuildRequires: %{py3_dist pyyaml} @@ -31,6 +29,7 @@ BuildRequires: %{py3_dist sphinx} BuildRequires: %{py3_dist sphinx_rtd_theme} BuildRequires: %{py3_dist tox} BuildRequires: %{py3_dist tox-current-env} +BuildRequires: %{py3_dist wheel} %global _desc %{expand: This pytest plugin makes it simple to test general data, images, files, @@ -61,7 +60,7 @@ sed -e 's/\(version = \).*/\1"%{version}"/' \ -i doc/conf.py %build -%py3_build +%pyproject_wheel # Build documentation PYTHONPATH=$PWD/build/lib make -C doc html @@ -70,7 +69,7 @@ rst2html --no-datestamp README.rst README.html rm doc/_build/html/.buildinfo %install -%py3_install +%pyproject_install %check %tox @@ -84,5 +83,8 @@ rm doc/_build/html/.buildinfo %doc doc/_build/html %changelog +* Tue Jan 4 2022 Jerry James - 2.3.0-1 +- Version 2.3.0 + * Tue Jul 13 2021 Jerry James - 2.2.0-1 - Initial RPM diff --git a/sources b/sources index b022ca9..f8793eb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pytest-regressions-2.2.0.tar.gz) = 8fd1c53eea07f3e28c39d37119ed9e7f633487b20b67d9acff79e5920eb62624062eabe5569ddbfba08a93967f612b9adf52027cc508f6a33e1911c9e0bfa411 +SHA512 (pytest-regressions-2.3.0.tar.gz) = 7f0c00836dcc8ac9d8d7fb41a02e16fa50a0cb9dd6c37ee7efd7aded6441c4e46693554d51067235695efabc64cc091334b35553d0776b8394fad537437a1d2a