Skip to content

Commit 7c23d09

Browse files
Upgrade: pylint to 4.0.2 and python-astroid to 4.0.1 (microsoft#15051)
1 parent 21e42ec commit 7c23d09

File tree

6 files changed

+135
-82
lines changed

6 files changed

+135
-82
lines changed

SPECS-EXTENDED/pylint/pep639.patch

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- pylint-3.3.6/pyproject.toml~ 2025-03-20 10:21:05.597486341 -0500
2+
+++ pylint-3.3.6/pyproject.toml 2025-03-20 10:23:55.768622830 -0500
3+
@@ -8,8 +8,6 @@
4+
description = "python code static checker"
5+
readme = "README.rst"
6+
keywords = [ "lint", "linter", "python", "static code analysis" ]
7+
-license = "GPL-2.0-or-later"
8+
-license-files = [ "LICENSE", "CONTRIBUTORS.txt" ]
9+
authors = [
10+
{ name = "Python Code Quality Authority", email = "[email protected]" },
11+
]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"Signatures": {
3-
"pylint-2.4.4.tar.gz": "3db5468ad013380e987410a8d6956226963aed94ecb5f9d3a28acca6d9ac36cd"
3+
"pylint-4.0.2.tar.gz": "854093b5044593b040f9db1e7577edc5c2a72542bdb7ecaa50a4b4e5e4e0fa6b"
44
}
5-
}
5+
}

SPECS-EXTENDED/pylint/pylint.spec

Lines changed: 104 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,152 @@
1-
Vendor: Microsoft Corporation
2-
Distribution: Azure Linux
1+
# Remove -s from Python shebang - ensure that extensions installed with pip
2+
# to user locations are seen and properly loaded
3+
%undefine _py3_shebang_s
4+
5+
%global forgeurl https://github.com/PyCQA/pylint
6+
%global basever 4.0.2
7+
#%%global prever b0
8+
Version: 4.0.2
9+
310
Name: pylint
4-
Version: 2.4.4
5-
Release: 4%{?dist}
11+
Release: 2%{?dist}
612
Summary: Analyzes Python code looking for bugs and signs of poor quality
7-
License: GPLv2+
8-
URL: http://www.pylint.org/
9-
Source0: %{pypi_source}
10-
13+
License: GPL-2.0-or-later
14+
Vendor: Microsoft Corporation
15+
Distribution: Azure Linux
16+
URL: https://github.com/pylint-dev/pylint
17+
Source0: %{forgeurl}/archive/v%{basever}/pylint-%{basever}.tar.gz
18+
#Patch0: 7829.patch apply when rebased then re-enable tests
19+
Patch1: pep639.patch
1120
BuildArch: noarch
1221

22+
BuildRequires: pyproject-rpm-macros
1323
BuildRequires: python3-devel
24+
BuildRequires: python3-pip
25+
BuildRequires: python3-wheel
1426
BuildRequires: python3-setuptools
1527
# For tests
16-
BuildRequires: python3-astroid >= 2.0.2
28+
BuildRequires: python3-pytest-benchmark
29+
BuildRequires: python3-pytest-xdist
30+
BuildRequires: python3-typing-extensions
31+
BuildRequires: graphviz
32+
BuildRequires: python3-execnet
33+
BuildRequires: python3-astroid
34+
BuildRequires: python3-platformdirs
1735
BuildRequires: python3-isort
36+
BuildRequires: git
1837
BuildRequires: python3-mccabe
19-
BuildRequires: python3-pytest
20-
BuildRequires: python3-pytest-runner
2138

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

25-
%description
26-
Pylint is a Python source code analyzer which looks for programming
27-
errors, helps enforcing a coding standard and sniffs for some code
28-
smells (as defined in Martin Fowler's Refactoring book).
29-
Pylint can be seen as another PyChecker since nearly all tests you
30-
can do with PyChecker can also be done with Pylint. However, Pylint
31-
offers some more features, like checking length of lines of code,
32-
checking if variable names are well-formed according to your coding
33-
standard, or checking if declared interfaces are truly implemented,
34-
and much more.
35-
Additionally, it is possible to write plugins to add your own checks.
42+
%global _description %{expand:
43+
Pylint is a Python source code analyzer which looks for programming errors,
44+
helps enforcing a coding standard and sniffs for some code smells (as defined in
45+
Martin Fowler's Refactoring book). Pylint can be seen as another PyChecker since
46+
nearly all tests you can do with PyChecker can also be done with Pylint.
47+
However, Pylint offers some more features, like checking length of lines of
48+
code, checking if variable names are well-formed according to your coding
49+
standard, or checking if declared interfaces are truly implemented, and much
50+
more.
51+
52+
Additionally, it is possible to write plugins to add your own checks.}
53+
54+
%description %_description
3655

3756
%package -n python3-%{name}
3857
Summary: %{summary}
39-
Requires: python3-astroid >= 2.3.0
40-
Requires: python3-setuptools
41-
Requires: python3-mccabe
42-
Requires: python3-isort
43-
Obsoletes: python3-pylint-gui < 1.7
44-
%{?python_provide:%python_provide python3-%{name}}
45-
46-
%description -n python3-%{name}
47-
Pylint is a Python source code analyzer which looks for programming
48-
errors, helps enforcing a coding standard and sniffs for some code
49-
smells (as defined in Martin Fowler's Refactoring book).
50-
Pylint can be seen as another PyChecker since nearly all tests you
51-
can do with PyChecker can also be done with Pylint. However, Pylint
52-
offers some more features, like checking length of lines of code,
53-
checking if variable names are well-formed according to your coding
54-
standard, or checking if declared interfaces are truly implemented,
55-
and much more.
56-
Additionally, it is possible to write plugins to add your own checks.
58+
59+
%description -n python3-%{name} %_description
5760

5861
%prep
59-
%autosetup -p1
62+
%autosetup -p1 -n %{name}-%{basever}
63+
# Relax version requirements
64+
sed -i -e 's/"setuptools>=[^"]*"/"setuptools"/' pyproject.toml
6065

61-
# Convert DOS line endings to Unix
62-
sed -i 's/\r//g' README.rst
6366

6467
%build
65-
%py3_build
68+
%pyproject_wheel
6669

6770
%install
68-
%py3_install
71+
%pyproject_install
6972
rm -rf %{buildroot}%{python3_sitelib}/pylint/test
7073

71-
mkdir -pm 755 %{buildroot}%{_mandir}/man1
72-
install -pm 644 man/*.1 %{buildroot}%{_mandir}/man1/
73-
7474
# Add -%%{python3_version} to the binaries and manpages for backwards compatibility
75-
for NAME in epylint pylint pyreverse symilar; do
75+
for NAME in pylint pyreverse symilar; do
7676
mv %{buildroot}%{_bindir}/{$NAME,${NAME}-%{python3_version}}
7777
ln -s ${NAME}-%{python3_version} %{buildroot}%{_bindir}/${NAME}-3
78-
mv %{buildroot}%{_mandir}/man1/{${NAME}.1,${NAME}-%{python3_version}.1}
79-
ln -s ${NAME}-%{python3_version}.1 %{buildroot}%{_mandir}/man1/${NAME}-3.1
8078
ln -s ${NAME}-%{python3_version} %{buildroot}%{_bindir}/${NAME}
81-
ln -s ${NAME}-%{python3_version}.1 %{buildroot}%{_mandir}/man1/${NAME}.1
8279
done
8380

8481
%check
85-
export PYTHONPATH=%{buildroot}%{python3_sitelib}
86-
%{__python3} bin/pylint -rn --rcfile=pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe pylint || :
87-
# Skip failing tests.
88-
%{__python3} -m pytest -v -k "not (test_by_module_statement_value or import_outside_toplevel or deprecated_methods_py38 or member_checks_py37)"
82+
pip3 install tomlkit==0.12.5 \
83+
dill \
84+
GitPython
85+
# Skip benchmarks
86+
# Deselect all tests failing with Python 3.14
87+
%pytest -v --ignore=benchmark \
88+
-n auto \
89+
--deselect=tests/test_functional.py::test_functional[missing_timeout] \
90+
--deselect=tests/config/pylint_config/test_pylint_config_help.py::test_pylint_config_main_messages \
91+
--deselect=tests/pyreverse/test_writer.py::test_dot_files[packages_No_Name.dot] \
92+
--deselect=tests/pyreverse/test_writer.py::test_dot_files[classes_No_Name.dot] \
93+
--deselect=tests/pyreverse/test_writer.py::test_colorized_dot_files[packages_colorized.dot] \
94+
--deselect=tests/pyreverse/test_writer.py::test_colorized_dot_files[classes_colorized.dot] \
95+
--deselect=tests/pyreverse/test_writer.py::test_no_standalone_dot_files[classes_no_standalone.dot] \
96+
--deselect=tests/pyreverse/test_writer.py::test_no_standalone_dot_files[packages_no_standalone.dot] \
97+
--deselect=tests/pyreverse/test_writer.py::test_type_check_imports_dot_files[packages_type_check_imports.dot] \
98+
--deselect=tests/pyreverse/test_writer.py::test_type_check_imports_dot_files[classes_type_check_imports.dot] \
99+
--deselect=tests/pyreverse/test_writer.py::test_puml_files[packages_No_Name.puml] \
100+
--deselect=tests/pyreverse/test_writer.py::test_puml_files[classes_No_Name.puml] \
101+
--deselect=tests/pyreverse/test_writer.py::test_mmd_files[packages_No_Name.mmd] \
102+
--deselect=tests/pyreverse/test_writer.py::test_mmd_files[classes_No_Name.mmd] \
103+
--deselect=tests/pyreverse/test_writer.py::test_html_files[packages_No_Name.html] \
104+
--deselect=tests/pyreverse/test_writer.py::test_html_files[classes_No_Name.html] \
105+
--deselect=tests/pyreverse/test_writer.py::test_colorized_puml_files[packages_colorized.puml] \
106+
--deselect=tests/pyreverse/test_writer.py::test_colorized_puml_files[classes_colorized.puml] \
107+
--deselect=tests/test_functional.py::test_functional[continue_in_finally] \
108+
--deselect=tests/test_functional.py::test_functional[consider_using_with] \
109+
--deselect=tests/test_functional.py::test_functional[typing_broken_callable] \
110+
--deselect=tests/test_functional.py::test_functional[typing_broken_callable_future_import] \
111+
--deselect=tests/test_functional.py::test_functional[typing_consider_using_union] \
112+
--deselect=tests/test_functional.py::test_functional[typing_consider_using_union_py310] \
113+
--deselect=tests/test_functional.py::test_functional[typing_consider_using_union_without_future] \
114+
--deselect=tests/test_functional.py::test_functional[function_redefined_2540] \
115+
--deselect=tests/test_functional.py::test_functional[generic_alias_collections] \
116+
--deselect=tests/test_functional.py::test_functional[generic_alias_mixed_py39] \
117+
--deselect=tests/test_functional.py::test_functional[generic_alias_typing] \
118+
--deselect=tests/test_functional.py::test_functional[lost_exception] \
119+
--deselect=tests/test_functional.py::test_functional[return_in_finally] \
120+
--deselect=tests/test_functional.py::test_functional[wrong_import_order] \
121+
--deselect=tests/test_import_graph.py::test_dependencies_graph[foo.dot] \
122+
--deselect=tests/test_import_graph.py::test_dependencies_graph[foo.gv] \
123+
--deselect=tests/test_import_graph.py::test_dependencies_graph[tests/regrtest_data/foo.dot] \
124+
--deselect=tests/test_import_graph.py::test_checker_dep_graphs \
125+
--deselect=tests/test_self.py::TestRunTC::test_do_not_import_files_from_local_directory[args0] \
126+
--deselect=tests/test_self.py::TestRunTC::test_do_not_import_files_from_local_directory[args1] \
127+
--deselect=tests/test_self.py::TestRunTC::test_progress_reporting \
128+
--deselect=tests/pyreverse/test_diadefs.py::TestDefaultDiadefGenerator::test_functional_relation_extraction
89129

90130
%files
91-
%doc README.rst ChangeLog examples elisp
92-
%license COPYING
93-
%{_bindir}/epylint
131+
%doc CONTRIBUTORS.txt
132+
%license LICENSE
94133
%{_bindir}/pylint
134+
%{_bindir}/pylint-config
95135
%{_bindir}/pyreverse
96136
%{_bindir}/symilar
97-
%{_mandir}/man1/epylint.1*
98-
%{_mandir}/man1/pylint.1*
99-
%{_mandir}/man1/pyreverse.1*
100-
%{_mandir}/man1/symilar.1*
101137

102138
%files -n python3-%{name}
103-
%license COPYING
139+
%license LICENSE
104140
%{python3_sitelib}/pylint*
105141
# backwards compatible versioned executables and manpages:
106142
%{_bindir}/*-3
107143
%{_bindir}/*-%{python3_version}
108-
%{_mandir}/man1/*-3.1*
109-
%{_mandir}/man1/*-%{python3_version}.1*
110144

111145
%changelog
146+
* Tue Nov 11 2025 Akhila Guruju <[email protected]> - 4.0.2-2
147+
- Upgrade to 4.0.2 by taking reference from Fedora 43 (license: MIT).
148+
- License verified
149+
112150
* Fri Oct 15 2021 Pawel Winogrodzki <[email protected]> - 2.4.4-4
113151
- Initial CBL-Mariner import from Fedora 32 (license: MIT).
114152

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"Signatures": {
3-
"python-astroid-3.3.8.tar.gz": "4fd092083a3cbb72a8e0ddbcb9f9dcd6b2ae068f745cd1c0a6844a6a143ab297"
3+
"python-astroid-4.0.1.tar.gz": "d013ca4869b4affb8e763a44abf1bbbcaa9d2476cb3de43e121e7d6520d400b8"
44
}
55
}

SPECS-EXTENDED/python-astroid/python-astroid.spec

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
Name: python-astroid
55
# Note: please check that this doesn't break pylint before committing and building! -GC
6-
Version: 3.3.8
7-
Release: 2%{?dist}
6+
Version: 4.0.1
7+
Release: 1%{?dist}
88
Summary: Common base representation of python source code for pylint and other projects
99
License: LGPL-2.1-or-later
1010
Vendor: Microsoft Corporation
@@ -16,8 +16,8 @@ BuildArch: noarch
1616
BuildRequires: python3-devel
1717
BuildRequires: python3-pytest
1818
BuildRequires: python3-setuptools
19-
BuildRequires: python3-pip
20-
BuildRequires: python3-wheel
19+
BuildRequires: python3-pip
20+
BuildRequires: python3-wheel
2121

2222
%global _description %{expand:
2323
The aim of this module is to provide a common base representation of python
@@ -39,9 +39,8 @@ Summary: %{summary}
3939

4040
%prep
4141
%autosetup -n %{srcname}-%{version} -p1
42-
43-
%generate_buildrequires
44-
%pyproject_buildrequires
42+
sed -i 's/^license = "LGPL-2.1-or-later"/license = { file = "LGPL-2.1-or-later" }/' pyproject.toml
43+
sed -i '/^license-files/d' pyproject.toml
4544

4645
%build
4746
%pyproject_wheel
@@ -52,18 +51,23 @@ Summary: %{summary}
5251
rm -rf %{buildroot}%{python3_sitelib}/tests
5352

5453
%check
55-
%{pytest} -v
54+
# Skipping mypy tests as we don't ship mypy module
55+
56+
%{pytest} -v --ignore=tests/test_raw_building.py
5657

5758
%files -n python3-%{srcname}
5859
%license LICENSE
5960
%{python3_sitelib}/astroid
6061
%{python3_sitelib}/astroid*.dist-info/
6162

6263
%changelog
64+
* Tue Nov 11 2025 Akhila Guruju <[email protected]> - 4.0.1-1
65+
- Upgrade to 4.0.1
66+
6367
* Tue Feb 11 2025 Akhila Guruju <[email protected]> - 3.3.8-2
6468
- Initial Azure Linux import from Fedora 41 (license: MIT).
6569
- License verified.
66-
- Added 'BuildRequires: python3-pip python3-wheel'
70+
- Added BR on pip & wheel.
6771

6872
* Mon Dec 30 2024 Gwyn Ciesla <[email protected]> - 3.3.8-1
6973
- 3.3.8

cgmanifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21933,8 +21933,8 @@
2193321933
"type": "other",
2193421934
"other": {
2193521935
"name": "pylint",
21936-
"version": "2.4.4",
21937-
"downloadUrl": "https://files.pythonhosted.org/packages/source/p/pylint/pylint-2.4.4.tar.gz"
21936+
"version": "4.0.2",
21937+
"downloadUrl": "https://github.com/PyCQA/pylint/archive/v4.0.2/pylint-4.0.2.tar.gz"
2193821938
}
2193921939
}
2194021940
},
@@ -22083,8 +22083,8 @@
2208322083
"type": "other",
2208422084
"other": {
2208522085
"name": "python-astroid",
22086-
"version": "3.3.8",
22087-
"downloadUrl": "https://github.com/pylint-dev/astroid/archive/v3.3.8/astroid-3.3.8.tar.gz"
22086+
"version": "4.0.1",
22087+
"downloadUrl": "https://github.com/pylint-dev/astroid/archive/v4.0.1/astroid-4.0.1.tar.gz"
2208822088
}
2208922089
}
2209022090
},

0 commit comments

Comments
 (0)