Name:           pylint
Version:        4.0.5
Release:        1
Summary:        Analyzes Python code looking for bugs and signs of poor quality
License:        GPL-2.0-or-later
URL:            https://www.pylint.org/
Source0:        https://github.com/pylint-dev/pylint/releases/download/v%{version}/%{name}-%{version}.tar.gz
Patch1:         0001-Bump-astroid-from-4.0.2-to-4.1.2.patch
BuildArch:      noarch

BuildRequires:  graphviz
BuildRequires:  pyproject-rpm-macros
BuildRequires:  python3-GitPython
BuildRequires:  python3-devel
BuildRequires:  python3-pip
BuildRequires:  python3-pytest
BuildRequires:  python3-pytest-benchmark
BuildRequires:  python3-pytest-timeout
BuildRequires:  python3-pytest-xdist
BuildRequires:  python3-requests
BuildRequires:  python3-six
BuildRequires:  python3-typing-extensions
BuildRequires:  python3dist(astroid) <= 4.1.2
BuildRequires:  python3dist(astroid) >= 4.0.2
BuildRequires:  python3dist(dill) >= 0.3.7
BuildRequires:  python3dist(isort) < 9
BuildRequires:  python3dist(isort) > 5.13
BuildRequires:  python3dist(mccabe) < 0.8
BuildRequires:  python3dist(mccabe) >= 0.6
BuildRequires:  python3dist(platformdirs) >= 2.2
BuildRequires:  python3dist(setuptools) >= 77
BuildRequires:  python3dist(tomlkit) >= 0.10.1

# For the main pylint package
Requires:       python3-%{name} = %{version}-%{release}

%description
Pylint is a Python source code analyzer which looks for programming
errors, helps enforcing a coding standard and sniffs for some code
smells (as defined in Martin Fowler's Refactoring book).
Pylint can be seen as another PyChecker since nearly all tests you
can do with PyChecker can also be done with Pylint. However, Pylint
offers some more features, like checking length of lines of code,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented,
and much more.
Additionally, it is possible to write plugins to add your own checks.

%package -n python3-%{name}
Summary:        %{summary}
Obsoletes:      python3-pylint-gui
%{?python_provide:%python_provide python3-%{name}}

%description -n python3-%{name}
Pylint is a Python source code analyzer which looks for programming
errors, helps enforcing a coding standard and sniffs for some code
smells (as defined in Martin Fowler's Refactoring book).
Pylint can be seen as another PyChecker since nearly all tests you
can do with PyChecker can also be done with Pylint. However, Pylint
offers some more features, like checking length of lines of code,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented,
and much more.
Additionally, it is possible to write plugins to add your own checks.

%prep
%autosetup -p1 -n pylint-%{version}

%build
%pyproject_build

%install
%pyproject_install
rm -rf %{buildroot}%{python3_sitelib}/pylint/test

# Add -%%{python3_version} to the binaries and manpages for backwards compatibility
for NAME in pylint pyreverse symilar; do
    mv %{buildroot}%{_bindir}/{$NAME,${NAME}-%{python3_version}}
    ln -s ${NAME}-%{python3_version} %{buildroot}%{_bindir}/${NAME}-3
    ln -s ${NAME}-%{python3_version} %{buildroot}%{_bindir}/${NAME}
done

%files
%doc CONTRIBUTORS.txt
%license LICENSE
%{_bindir}/pylint
%{_bindir}/pylint-config
%{_bindir}/pyreverse
%{_bindir}/symilar

%files -n python3-%{name}
%license LICENSE
%{python3_sitelib}/pylint*
# backwards compatible versioned executables and manpages:
%{_bindir}/*-3
%{_bindir}/*-%{python3_version}

%changelog
* Tue Mar 24 2026 desert-sailor <dongxing.wang_a@thundersoft.com> - 4.0.5-1
- Update package with version 4.0.5
  Fix false positives for possibly-used-before-assignment with self.fail() in tests, logging-unsupported-format without args, invalid-name for Final dataclass fields and typing.Annotated
  Fix invalid-name for module-level constants vs class attributes, UPPER_CASED names in if branches, and related edge cases
  Add Enum dunder methods to good-dunder-names; fix f-string-without-interpolation with template format strings; fix unbalanced-tuple-unpacking
  Fix ignore option behavior; fix crashes in consider-using-assignment-expr and prefer-typing-namedtuple checks
  Skip unspecified-encoding (W1514) when py-version is 3.15+
  Fix --known_third_party config being ignored; fix dynamic color mapping for fail-on with multiple reporters
  Raise isort dependency bound to <9 so isort 8 is permitted

* Fri Oct 31 2025 Funda Wang <fundawang@yeah.net> - 4.0.2-1
- update to 4.0.2 for new astroid

* Wed Aug 27 2025 Funda Wang <fundawang@yeah.net> - 3.3.8-2
- cleanup buildrequires

* Wed Aug 20 2025 zhang_wenyu <zhang_wenyu@hoperun.com> - 3.3.8-1
- update pylint to 3.3.8
  * Fix false positives for possibly-used-before-assignment when variables are exhaustivelyassigned within a match block
  * Fix false positive for missing-raises-doc and missing-yield-doc when the method length is less than docstring-min-length
  * Fix a false positive for unused-variable when multiple except handlers bind the same name under a try block

* Thu Jul 10 2025  openeuler_bot <infra@openeuler.sh> - 3.3.2-1
- update pylint to 3.3.2 

* Sun Sep 29 2024 wangkai <13474090681@163.com> - 3.3.1-1
- Update to 3.3.1

* Mon Aug 5 2024 zhangxingrong <zhangxingrong@uniontech.cn> - 3.2.3-2
- Fix crashes for uninferrable 'start' value in 'enumerate'
- Fix a crash for undefined lineno in annotations

* Tue Jul 02 2024 jiangxinyu <jiangxinyu@kylinos.cn> - 3.2.3-1
- Update package to version 3.2.3
- Add compatibility with upload-artifact v4
- Fix false positive in use-yield-from when using yield return

* Wed Jan 03 2024 wangkai <13474090681@163.com> - 3.0.3-2
- Fix "similar -d args" not recognized

* Tue Sep 19 2023 xu_ping <707078654@qq.com> - 3.0.3-1
- update to 3.0.3

* Wed Aug 9 2023 shangjiwei <cyrus_shang@163.com> - 2.17.5-1
- update to 2.17.5

* Mon May 15 2023 Dongxing Wang <dxwangk@isoftstone.com> - 2.17.2-1
- update to 2.17.2

* Wed Apr 27 2022 caodongxia <caodongxia@h-partners.com> - 2.12.2-1
- update to 2.12.2

* Thu Oct 28 2021 xu_ping <xuping33@huawei.com> - 2.6.0-2
- add python3-six model to fix some testcase failed

* Mon Jul 19 2021 OpenStack_SIG <openstack@openeuler.org> - 2.6.0-1
- update to 2.6.0

* Wed Jun 24 2020 chengzihan <chengzihan2@huawei.com> - 2.4.4-0
- Package upgrade

* Fri Feb 28 2020 daiqianwen <daiqianwen@huawei.com> - 2.1.1-4
- modify spec

* Mon Feb 17 2020 daiqianwen <daiqianwen@huawei.com> - 2.1.1-3
- package init