diff --git a/python-proselint.changes b/python-proselint.changes index fd3de22..8e7dab7 100644 --- a/python-proselint.changes +++ b/python-proselint.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Sun Aug 16 17:49:59 UTC 2020 - Matej Cepl + +- Replace the sed command from the previous commit with + the proper patch remove_nose.patch and send it upstream + (gh#amperser/proselint#1097). + +------------------------------------------------------------------- +Sun Aug 16 16:47:49 UTC 2020 - John Vandenberg + +- Replace unittest+nose with pytest +- Tidy spec + ------------------------------------------------------------------- Wed May 6 09:49:35 UTC 2020 - Matej Cepl diff --git a/python-proselint.spec b/python-proselint.spec index 5b743ff..079c782 100644 --- a/python-proselint.spec +++ b/python-proselint.spec @@ -25,9 +25,12 @@ Summary: A linter for prose License: BSD-3-Clause URL: https://github.com/amperser/proselint Source: https://files.pythonhosted.org/packages/source/p/proselint/proselint-%{version}.tar.gz -# test_weasel_words_misc is empty in this release, and `setup.py test` doesnt recognise nose's SkipTest +# test_weasel_words_misc is empty in release v0.10.2, and contains nose.SkipTest Patch0: disable-empty-test.patch Patch1: test-use-sys-executable.patch +# PATCH-FEATURE-UPSTREAM remove_nose.patch gh#amperser/proselint#1097 mcepl@suse.com +# this patch makes things totally awesome +Patch2: remove_nose.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -35,19 +38,19 @@ Requires: python-click Requires: python-dbm Requires: python-future Requires: python-six +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module click} BuildRequires: %{python_module dbm} BuildRequires: %{python_module future} -BuildRequires: %{python_module nose} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module six} %if %{with python2} BuildRequires: python-mock %endif # /SECTION -Requires(post): update-alternatives -Requires(postun): update-alternatives %python_subpackages %description @@ -60,8 +63,8 @@ existing tools. %prep %setup -q -n proselint-%{version} -%patch0 -p1 -%patch1 -p1 +%autopatch -p1 + sed -i -e '/^#!\//, 1d' proselint/*.py %build @@ -72,15 +75,19 @@ sed -i -e '/^#!\//, 1d' proselint/*.py %python_clone -a %{buildroot}%{_bindir}/proselint %python_expand %fdupes %{buildroot}%{$python_sitelib} -%check -%python_exec setup.py test - %post %python_install_alternative proselint %postun %python_uninstall_alternative proselint +%check +mkdir ~/bin +export PATH=~/bin:$PATH +%{python_expand cp %{buildroot}%{_bindir}/proselint-%{$python_bin_suffix} ~/bin/proselint +PYTHONPATH=%{buildroot}%{$python_sitelib} $python -m pytest +} + %files %{python_files} %doc CHANGELOG.md README.md %license LICENSE.md diff --git a/remove_nose.patch b/remove_nose.patch new file mode 100644 index 0000000..b52f32f --- /dev/null +++ b/remove_nose.patch @@ -0,0 +1,22 @@ +--- a/tests/test_gmeu/test_a_A.py ++++ b/tests/test_gmeu/test_a_A.py +@@ -4,7 +4,7 @@ + """Test GMEU entry 'a', part A.""" + + from proselint.tools import assert_error +-from nose import SkipTest ++from unittest import SkipTest + + + def test_a_vs_an(): +--- a/tests/test_gmeu/test_a_B.py ++++ b/tests/test_gmeu/test_a_B.py +@@ -4,7 +4,7 @@ + """Test GMEU entry 'a', part B.""" + + from proselint.tools import assert_error +-from nose import SkipTest ++from unittest import SkipTest + + + def test_a_distributive():