forked from pool/python-flake8
Dirk Mueller
b2b2663ff2
- Pin to upstream's ranges in dependendcies in order to not break downstream packages all the time https://flake8.pycqa.org/en/latest/faq.html#why-does-flake8-use-ranges-for-its-dependencies - Remove obsolete python2 packaging directives OBS-URL: https://build.opensuse.org/request/show/999541 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flake8?expand=0&rev=82
105 lines
3.4 KiB
RPMSpec
105 lines
3.4 KiB
RPMSpec
#
|
|
# spec file for package python-flake8
|
|
#
|
|
# Copyright (c) 2022 SUSE LLC
|
|
#
|
|
# 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-%{**}}
|
|
%define skip_python2 1
|
|
Name: python-flake8
|
|
Version: 5.0.4
|
|
Release: 0
|
|
Summary: Modular source code checker: pep8, pyflakes and co
|
|
License: MIT
|
|
URL: https://flake8.pycqa.org
|
|
Source: https://files.pythonhosted.org/packages/source/f/flake8/flake8-%{version}.tar.gz
|
|
# workaround for https://github.com/PyCQA/flake8/pull/1669
|
|
Source2: https://raw.githubusercontent.com/PyCQA/flake8/5.0.4/bin/gen-pycodestyle-plugin
|
|
BuildRequires: %{python_module setuptools}
|
|
BuildRequires: fdupes
|
|
BuildRequires: python-rpm-macros
|
|
# SECTION test requirements
|
|
BuildRequires: %{python_module importlib-metadata >= 1.1.0 if %python-version < 3.8}
|
|
BuildRequires: %{python_module mccabe >= 0.7.0 with %python-mccabe < 0.8.0}
|
|
BuildRequires: %{python_module pycodestyle >= 2.9.0 with %python-pycodestyle < 2.10.0}
|
|
BuildRequires: %{python_module pyflakes >= 2.5.0 with %python-pyflakes < 2.6.0}
|
|
BuildRequires: %{python_module pytest}
|
|
# /SECTION
|
|
BuildArch: noarch
|
|
# https://flake8.pycqa.org/en/latest/faq.html#why-does-flake8-use-ranges-for-its-dependencies
|
|
Requires: (python-mccabe >= 0.7.0 with python-mccabe < 0.8.0)
|
|
Requires: (python-pycodestyle >= 2.9.0 with python-pycodestyle < 2.10.0)
|
|
Requires: (python-pyflakes >= 2.5.0 with python-pyflakes < 2.6.0)
|
|
%if 0%{?python_version_nodots} < 38
|
|
Requires: python-importlib-metadata >= 1.1.0
|
|
%endif
|
|
Requires(post): update-alternatives
|
|
Requires(postun):update-alternatives
|
|
%python_subpackages
|
|
|
|
%description
|
|
Flake8 is a modular extensible source code checker including wrappers
|
|
around these tools:
|
|
|
|
- PyFlakes
|
|
- pep8
|
|
- Ned Batchelder's McCabe script
|
|
|
|
Flake8 runs all the tools by launching the single ``flake8`` script.
|
|
|
|
%package -n %{name}-doc
|
|
Summary: Documentation files for %{name}
|
|
Recommends: %{name} = %{version}
|
|
|
|
%description -n %{name}-doc
|
|
Flake8 is a modular extensible source code checker.
|
|
|
|
This package provides documentation for %{name}.
|
|
|
|
%prep
|
|
%autosetup -p1 -n flake8-%{version}
|
|
install -m 0755 -D %{SOURCE2} bin/gen-pycodestyle-plugin
|
|
|
|
%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
|
|
%pytest tests
|
|
|
|
%files %{python_files}
|
|
%license LICENSE
|
|
%python_alternative %{_bindir}/flake8
|
|
%{python_sitelib}/flake8
|
|
%{python_sitelib}/flake8-%{version}*-info
|
|
|
|
%files -n %{name}-doc
|
|
%doc README.rst
|
|
%doc docs/source/index.rst docs/source/faq.rst docs/source/glossary.rst
|
|
%doc docs/source/internal/ docs/source/user docs/source/plugin-development
|
|
%license LICENSE
|
|
|
|
%changelog
|