Accepting request 681588 from home:jayvdb:coala:python3-bears
- Fix %check to run the tests from GitHub tarball, and use integration-tests-invocation.patch to invoke pycodestyle using sys.executable, and do not install and uninstall pip during tests. - Fix line endings and remove hashbangs - Update to v3.0.0, including support for Python 3.7 OBS-URL: https://build.opensuse.org/request/show/681588 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydocstyle?expand=0&rev=9
This commit is contained in:
parent
19aa9a01b1
commit
e59f9a72fb
44
integration-tests-invocation.patch
Normal file
44
integration-tests-invocation.patch
Normal file
@ -0,0 +1,44 @@
|
||||
--- pydocstyle-3.0.0-orig/src/tests/test_integration.py 2018-10-14 17:54:04.000000000 +0700
|
||||
+++ pydocstyle-3.0.0/src/tests/test_integration.py 2019-02-22 03:23:27.301363601 +0700
|
||||
@@ -80,8 +80,9 @@
|
||||
run_target = self.tempdir if target is None else \
|
||||
os.path.join(self.tempdir, target)
|
||||
|
||||
- cmd = shlex.split("{} {} {}"
|
||||
- .format(self.script_name, run_target, args),
|
||||
+ cmd = shlex.split("{} -m {} {} {}"
|
||||
+ .format(sys.executable, self.script_name,
|
||||
+ run_target, args),
|
||||
posix=False)
|
||||
p = subprocess.Popen(cmd,
|
||||
stdout=subprocess.PIPE,
|
||||
@@ -102,19 +103,6 @@
|
||||
pass
|
||||
|
||||
|
||||
-@pytest.yield_fixture(scope="module")
|
||||
-def install_package(request):
|
||||
- """Install the package in development mode for the tests.
|
||||
-
|
||||
- This is so we can run the integration tests on the installed console
|
||||
- script.
|
||||
- """
|
||||
- cwd = os.path.join(os.path.dirname(__file__), '..', '..')
|
||||
- subprocess.check_call(shlex.split("pip install -e ."), cwd=cwd)
|
||||
- yield
|
||||
- subprocess.check_call(shlex.split("pip uninstall -y pydocstyle"), cwd=cwd)
|
||||
-
|
||||
-
|
||||
@pytest.yield_fixture(scope="function")
|
||||
def env(request):
|
||||
"""Add a testing environment to a test method."""
|
||||
@@ -122,9 +110,6 @@
|
||||
yield test_env
|
||||
|
||||
|
||||
-pytestmark = pytest.mark.usefixtures("install_package")
|
||||
-
|
||||
-
|
||||
def parse_errors(err):
|
||||
"""Parse `err` to a dictionary of {filename: error_codes}.
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4d5bcde961107873bae621f3d580c3e35a426d3687ffc6f8fb356f6628da5a97
|
||||
size 28542
|
3
pydocstyle-3.0.0.tar.gz
Normal file
3
pydocstyle-3.0.0.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:99d4c0b584eca25a179766a1e4c7e69284bc94eb9abf6d8e010d69b5a22596ec
|
||||
size 57749
|
@ -1,9 +1,36 @@
|
||||
-------------------------------------------------------------------
|
||||
|
||||
Mon Mar 3 15:20:38 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
|
||||
|
||||
- Fix %check to run the tests from GitHub tarball, and use
|
||||
integration-tests-invocation.patch to invoke pycodestyle using
|
||||
sys.executable, and do not install and uninstall pip during tests.
|
||||
- Fix line endings and remove hashbangs
|
||||
- Update to v3.0.0
|
||||
+ Major Updates
|
||||
* Support for Python 3.3 has been dropped
|
||||
* Added support for Python 3.7
|
||||
+ New features
|
||||
* Violations are now reported on the line where the docstring starts, not
|
||||
the line of the def/class it corresponds to
|
||||
* Updated description of pep257 and numpy conventions
|
||||
* __all__ parsing is now done on a best-effort basis - if __all__ can't
|
||||
be statically determined, it will be ignored
|
||||
+ Bug Fixes
|
||||
* Fixed a false-positive recognition of section names causing D405 to be
|
||||
reported
|
||||
* Fixed a bug where functions that don't end with a newline will sometimes
|
||||
raise an exception
|
||||
- Set six minimum version to v1.10.0
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
Fri Mar 1 11:13:40 UTC 2019 - Hans-Peter Jansen <hpj@urpla.net>
|
||||
|
||||
- don't run tests, if they're disabled from build conditional
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
Tue Dec 4 12:52:06 UTC 2018 - Matej Cepl <mcepl@suse.com>
|
||||
|
||||
- Remove superfluous devel dependency for noarch package
|
||||
|
@ -17,24 +17,29 @@
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
%bcond_without test
|
||||
Name: python-pydocstyle
|
||||
Version: 2.1.1
|
||||
Version: 3.0.0
|
||||
Release: 0
|
||||
Summary: Python docstring style checker
|
||||
License: MIT
|
||||
Group: Development/Languages/Python
|
||||
Url: https://github.com/PyCQA/pydocstyle/
|
||||
Source: https://files.pythonhosted.org/packages/source/p/pydocstyle/pydocstyle-%{version}.tar.gz
|
||||
Source: https://github.com/PyCQA/pydocstyle/archive/%{version}.tar.gz#/pydocstyle-%{version}.tar.gz
|
||||
# Tests invoke pip and pycodestyle directly, when they should use sys.executable.
|
||||
Patch0: integration-tests-invocation.patch
|
||||
BuildRequires: %{python_module mock}
|
||||
BuildRequires: %{python_module pathlib}
|
||||
# Tests invoke pip
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: python-rpm-macros
|
||||
%if %{with test}
|
||||
BuildRequires: %{python_module six}
|
||||
BuildRequires: %{python_module six > 1.10.0}
|
||||
BuildRequires: %{python_module snowballstemmer}
|
||||
BuildRequires: python-configparser
|
||||
%endif
|
||||
BuildRequires: dos2unix
|
||||
BuildRequires: fdupes
|
||||
Requires: python-six
|
||||
BuildRequires: python-configparser
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-six > 1.10.0
|
||||
Requires: python-snowballstemmer
|
||||
%ifpython2
|
||||
Requires: python-configparser
|
||||
@ -58,27 +63,25 @@ conventions.
|
||||
|
||||
%prep
|
||||
%setup -q -n pydocstyle-%{version}
|
||||
%patch0 -p1
|
||||
dos2unix README.rst
|
||||
|
||||
%build
|
||||
%python_build
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%{python_expand #
|
||||
sed -i -e '/^#! \//, 1d' %{buildroot}%{$python_sitelib}/pydocstyle/__main__.py
|
||||
dos2unix %{buildroot}%{$python_sitelib}/pydocstyle/__main__.py
|
||||
}
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%if %{with test}
|
||||
%check
|
||||
mkdir empty
|
||||
pushd empty
|
||||
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib}
|
||||
$python -c "import pydocstyle"
|
||||
$python -c "from pydocstyle import *"
|
||||
}
|
||||
popd
|
||||
%endif
|
||||
export PYTHONPATH=$(pwd)/src
|
||||
%python_exec -m pytest
|
||||
|
||||
%files %{python_files}
|
||||
%defattr(-,root,root,-)
|
||||
%doc README.rst
|
||||
%license LICENSE-MIT
|
||||
%python3_only %{_bindir}/pydocstyle
|
||||
|
Loading…
x
Reference in New Issue
Block a user