forked from pool/python-proselint
Accepting request 827089 from devel:languages:python
- Replace the sed command from the previous commit with the proper patch remove_nose.patch and send it upstream (gh#amperser/proselint#1097). - Replace unittest+nose with pytest - Tidy spec OBS-URL: https://build.opensuse.org/request/show/827089 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-proselint?expand=0&rev=9
This commit is contained in:
@@ -1,3 +1,16 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Aug 16 17:49:59 UTC 2020 - Matej Cepl <mcepl@suse.com>
|
||||
|
||||
- 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 <jayvdb@gmail.com>
|
||||
|
||||
- Replace unittest+nose with pytest
|
||||
- Tidy spec
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed May 6 09:49:35 UTC 2020 - Matej Cepl <mcepl@suse.com>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
22
remove_nose.patch
Normal file
22
remove_nose.patch
Normal file
@@ -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():
|
||||
Reference in New Issue
Block a user