forked from pool/python-flake8-pyi
environment, running the flake8 process with shell=True and forcing
the PYTHONPATH.
- Update to 23.1.2:
* Y011/Y014/Y015: Increase the maximum character length of literal
numbers in default values from 7 to 10, allowing hexadecimal
representation of 32-bit integers. Contributed by Avasam.
- 23.1.1
New error codes:
* Y052: Disallow default values in global or class namespaces where
the assignment does not have a type annotation. Stubs should be
explicit about the type of all variables in the stub; without type
annotations, the type checker is forced to make inferences, which
may have unpredictable consequences. Enum members are excluded
from this check, as are various special assignments such as
__all__ and __match_args__.
Other changes:
* Disallow numeric default values where len(str(default)) > 7. If a
function has a default value where the string representation is
greater than 7 characters, it is likely to be an implementation
detail or a constant that varies depending on the system you're
running on, such as sys.maxsize.
* Disallow str or bytes defaults where the default is >50 characters
long, for similar reasons.
* Allow ast.Attribute nodes as default values for a small number of
special cases, such as sys.maxsize and sys.executable.
* Fewer Y020 false positives are now emitted when encountering
default values in stub files.
- 23.1.0
Bugfixes:
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flake8-pyi?expand=0&rev=17
83 lines
2.6 KiB
RPMSpec
83 lines
2.6 KiB
RPMSpec
#
|
|
# spec file for package python-flake8-pyi
|
|
#
|
|
# Copyright (c) 2023 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/
|
|
#
|
|
|
|
|
|
%define skip_python2 1
|
|
Name: python-flake8-pyi
|
|
Version: 23.1.2
|
|
Release: 0
|
|
Summary: A plugin for flake8 to enable linting .pyi files
|
|
License: MIT
|
|
Group: Development/Languages/Python
|
|
URL: https://github.com/ambv/flake8-pyi
|
|
Source: https://files.pythonhosted.org/packages/source/f/flake8-pyi/flake8_pyi-%{version}.tar.gz
|
|
# PATCH-FIX-OPENSUSE set-tests-python-path.patch, patch to fix
|
|
# PYTHONPATH resolution for tests running inside osc
|
|
Patch0: set-tests-python-path.patch
|
|
BuildRequires: %{python_module ast-decompiler}
|
|
BuildRequires: %{python_module base >= 3.6.0}
|
|
BuildRequires: %{python_module hatchling}
|
|
BuildRequires: %{python_module pip}
|
|
BuildRequires: %{python_module wheel}
|
|
BuildRequires: python-rpm-macros
|
|
# SECTION test requirements
|
|
BuildRequires: %{python_module attrs}
|
|
BuildRequires: %{python_module flake8 >= 3.2.1}
|
|
BuildRequires: %{python_module pyflakes >= 2.1.1}
|
|
# Use pytest directly to bypass setup.py test dependencies
|
|
BuildRequires: %{python_module pytest}
|
|
BuildRequires: %{python_module black}
|
|
BuildRequires: %{python_module flake8-bugbear}
|
|
BuildRequires: %{python_module typing}
|
|
# /SECTION
|
|
BuildRequires: fdupes
|
|
Requires: python-attrs
|
|
Requires: python-base >= 3.6.0
|
|
Requires: python-flake8 >= 3.2.1
|
|
Requires: python-pyflakes >= 2.1.1
|
|
Requires: python-typing
|
|
BuildArch: noarch
|
|
|
|
%python_subpackages
|
|
|
|
%description
|
|
A plugin for Flake8 that provides specializations for type hinting stub
|
|
files. Especially interesting for linting typeshed.
|
|
|
|
%prep
|
|
%autosetup -p1 -n flake8_pyi-%{version}
|
|
sed -i '1{\,^#!%{_bindir}/env python,d}' pyi.py
|
|
|
|
%build
|
|
%pyproject_wheel
|
|
|
|
%install
|
|
%pyproject_install
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
%check
|
|
%pytest -v tests
|
|
|
|
%files %{python_files}
|
|
%license LICENSE
|
|
%doc README.md
|
|
%{python_sitelib}/pyi.py*
|
|
%{pycache_only %{python_sitelib}/__pycache__/pyi.*.py*}
|
|
%{python_sitelib}/flake8_pyi-%{version}*-info
|
|
|
|
%changelog
|