diff --git a/denose.patch b/denose.patch new file mode 100644 index 0000000..33ebc6b --- /dev/null +++ b/denose.patch @@ -0,0 +1,48 @@ +--- a/tests/test_forced_dumps_implementation.py ++++ b/tests/test_forced_dumps_implementation.py +@@ -1,16 +1,16 @@ + from pylatex.base_classes import LatexObject +-from nose.tools import raises ++from pytest import raises + + + class BadObject(LatexObject): + pass + + +-@raises(TypeError) + def test_latex_object(): +- LatexObject() ++ with raises(TypeError): ++ LatexObject() + + +-@raises(TypeError) + def test_bad_object(): +- BadObject() ++ with raises(TypeError): ++ BadObject() +--- a/setup.py ++++ b/setup.py +@@ -29,8 +29,8 @@ extras = { + 'quantities': ['quantities', 'numpy'], + 'testing': ['flake8<3.0.0', 'pep8-naming==0.8.2', + 'flake8_docstrings==1.3.0', 'pycodestyle==2.0.0', +- 'pydocstyle==3.0.0', 'pyflakes==1.2.3', 'nose', 'flake8-putty', +- 'coverage'], ++ 'pydocstyle==3.0.0', 'pyflakes==1.2.3', 'pytest', 'flake8-putty', ++ 'coverage', 'pytest-cov'], + 'convert_to_py2': ['3to2', 'future>=0.15.2'], + } + +--- a/testall.sh ++++ b/testall.sh +@@ -66,7 +66,7 @@ else + fi + + echo -e '\e[32mTesting tests directory\e[0m' +-if ! $python "$(command -v nosetests)" --with-coverage tests/*; then ++if ! $python "$(command -v pytest)" --cov=pylatex tests/*; then + exit 1 + fi + mv .coverage{,.tests} diff --git a/python-PyLaTeX.changes b/python-PyLaTeX.changes index 70e1bff..8b0ed11 100644 --- a/python-PyLaTeX.changes +++ b/python-PyLaTeX.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 3 06:35:01 UTC 2020 - Matej Cepl + +- Add denose.patch removing nose dependency (gh#JelteF/PyLaTeX#294). + ------------------------------------------------------------------- Mon Jun 8 13:29:44 UTC 2020 - Marketa Calabkova diff --git a/python-PyLaTeX.spec b/python-PyLaTeX.spec index a346f23..dc92456 100644 --- a/python-PyLaTeX.spec +++ b/python-PyLaTeX.spec @@ -26,6 +26,9 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/JelteF/PyLaTeX Source: https://github.com/JelteF/PyLaTeX/archive/v%{version}.tar.gz#/PyLaTeX-%{version}.tar.gz +# PATCH-FEATURE-UPSTREAM denose.patch gh#JelteF/PyLaTeX#294 mcepl@suse.com +# Remove nose dependency +Patch0: denose.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -66,8 +69,11 @@ Recommends: tex(tikz.sty) Recommends: tex(xcolor.sty) BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module nose} +BuildRequires: %{python_module matplotlib} +BuildRequires: %{python_module numpy} BuildRequires: %{python_module ordered-set} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module quantities} BuildRequires: texlive-latex BuildRequires: tex(amsmath.sty) BuildRequires: tex(booktabs.sty) @@ -106,6 +112,7 @@ PyLaTeX is a Python library for creating and compiling LaTeX files. %prep %setup -q -n PyLaTeX-%{version} +%autopatch -p1 %build %python_build @@ -116,7 +123,8 @@ PyLaTeX is a Python library for creating and compiling LaTeX files. %check # Quantities is an optional dependency that currently doesn't work -%python_expand nosetests-%{$python_bin_suffix} -v -e 'test_quantities' +# %%python_expand nosetests-%%{$python_bin_suffix} -v -e 'test_quantities' +%pytest %files %{python_files} %doc README.rst