python-flake8/python-flake8.spec
Tomáš Chvátal 4ca7b43c11 Accepting request 672184 from home:alarrosa:branches:devel:languages:python
- Add missing dependency on python3-typing when python3 < 3.5
- Add fix-mock-patch-with-python3.4.patch to fix building the package in
  Leap 42.3. In python 3.5, mock.patch uses create=True automatically if
  you are patching builtins in a module, but in python 3.4 the argument
  is still needed.

- Enable tests
- Add allow-bytes-filenames.patch to fix some tests that fail because
  they pass bytes objects as filenames.
- Update remove_mock_dependency.patch to fix another test that used mock

OBS-URL: https://build.opensuse.org/request/show/672184
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flake8?expand=0&rev=45
2019-02-06 21:25:51 +00:00

111 lines
3.2 KiB
RPMSpec

#
# spec file for package python-flake8
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without python2
Name: python-flake8
Version: 3.7.5
Release: 0
Summary: Modular source code checker: pep8, pyflakes and co
License: MIT
Group: Development/Languages/Python
URL: https://gitlab.com/pycqa/flake8
Source: https://files.pythonhosted.org/packages/source/f/flake8/flake8-%{version}.tar.gz
Patch0: remove_mock_dependency.patch
Patch1: fix-mock-patch-with-python3.4.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-entrypoints >= 0.3
Requires: python-mccabe >= 0.6.0
Requires: python-pycodestyle >= 2.5.0
Requires: python-pyflakes >= 2.1.0
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module entrypoints >= 0.3}
BuildRequires: %{python_module mccabe >= 0.6.0}
BuildRequires: %{python_module pycodestyle >= 2.5.0}
BuildRequires: %{python_module pyflakes >= 2.1.0}
BuildRequires: %{python_module pytest-runner}
BuildRequires: %{python_module pytest}
%if %{with python2}
BuildRequires: python2-configparser >= 3.7.0
BuildRequires: python2-enum34
BuildRequires: python2-functools32
BuildRequires: python2-mock
BuildRequires: python2-typing
%endif
%if 0%{?python3_version_nodots} < 35
BuildRequires: python3-typing
%endif
# /SECTION
%ifpython2
Requires: python-configparser >= 3.7.0
Requires: python-enum34
Requires: python-functools32
Requires: python-typing
%endif
%ifpython3
%if 0%{?python3_version_nodots} < 35
Requires: python3-typing
%endif
%endif
%python_subpackages
%description
Flake8 is a wrapper around these tools:
- PyFlakes
- pep8
- Ned Batchelder's McCabe script
Flake8 runs all the tools by launching the single ``flake8`` script.
%prep
%setup -q -n flake8-%{version}
%autopatch -p1
%build
%python_build
%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/flake8
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%post
%python_install_alternative flake8
%postun
%python_uninstall_alternative flake8
%check
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python -m pytest tests
%files %{python_files}
%doc README.rst
%license LICENSE
%python_alternative %{_bindir}/flake8
%dir %{python_sitelib}/flake8
%{python_sitelib}/flake8/*
%{python_sitelib}/flake8-%{version}-py*.egg-info
%changelog