Skip to content

Commit 002c7ed

Browse files
[AUTO-CHERRYPICK] [AUTOPATCHER-CORE] Upgrade python-virtualenv to 20.26.6 for CVE-2024-53899 [High] - branch main (#12924)
1 parent 044f598 commit 002c7ed

6 files changed

Lines changed: 88 additions & 67 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
From efa2c18a0c114f2d32e2c101401b716e4ac9e6f4 Mon Sep 17 00:00:00 2001
2+
From: Kanishk-Bansal <kbkanishk975@gmail.com>
3+
Date: Wed, 26 Feb 2025 06:31:14 +0000
4+
Subject: [PATCH] replace-to-flit
5+
6+
---
7+
pyproject.toml | 23 ++++-------------------
8+
1 file changed, 4 insertions(+), 19 deletions(-)
9+
10+
diff --git a/pyproject.toml b/pyproject.toml
11+
index fabf434..179525d 100644
12+
--- a/pyproject.toml
13+
+++ b/pyproject.toml
14+
@@ -1,9 +1,6 @@
15+
[build-system]
16+
-build-backend = "hatchling.build"
17+
-requires = [
18+
- "hatch-vcs>=0.3",
19+
- "hatchling>=1.17.1",
20+
-]
21+
+build-backend = "flit_core.buildapi"
22+
+requires = ["flit_core >=3.8.0,<4"]
23+
24+
[project]
25+
name = "virtualenv"
26+
@@ -14,7 +11,7 @@ keywords = [
27+
"isolated",
28+
"virtual",
29+
]
30+
-license = "MIT"
31+
+license = {text = "MIT"}
32+
maintainers = [
33+
{ name = "Bernat Gabor", email = "gaborjbernat@gmail.com" },
34+
]
35+
@@ -40,9 +37,7 @@ classifiers = [
36+
"Topic :: Software Development :: Testing",
37+
"Topic :: Utilities",
38+
]
39+
-dynamic = [
40+
- "version",
41+
-]
42+
+version = "3.10.0"
43+
dependencies = [
44+
"distlib<1,>=0.3.7",
45+
"filelock<4,>=3.12.2",
46+
@@ -95,16 +90,6 @@ entry-points."virtualenv.discovery".builtin = "virtualenv.discovery.builtin:Buil
47+
entry-points."virtualenv.seed".app-data = "virtualenv.seed.embed.via_app_data.via_app_data:FromAppData"
48+
entry-points."virtualenv.seed".pip = "virtualenv.seed.embed.pip_invoke:PipInvoke"
49+
50+
-[tool.hatch]
51+
-build.hooks.vcs.version-file = "src/virtualenv/version.py"
52+
-build.targets.sdist.include = [
53+
- "/src",
54+
- "/tests",
55+
- "/tasks",
56+
- "/tox.ini",
57+
-]
58+
-version.source = "vcs"
59+
-
60+
[tool.ruff]
61+
target-version = "py37"
62+
line-length = 120
63+
--
64+
2.45.2
65+

SPECS/python-virtualenv/fix-plugin-attribute-name.patch

Lines changed: 0 additions & 25 deletions
This file was deleted.

SPECS/python-virtualenv/pin-pytest-version.patch

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Signatures": {
3-
"python-virtualenv-20.14.0.tar.gz": "8e5b402037287126e81ccde9432b95a8be5b19d36584f64957060a3488c11ca8"
4-
}
5-
}
2+
"Signatures": {
3+
"python-virtualenv-20.26.6.tar.gz": "280aede09a2a5c317e409a00102e7077c6432c5a38f0ef938e643805a7ad2c48"
4+
}
5+
}

SPECS/python-virtualenv/python-virtualenv.spec

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
Summary: Virtual Python Environment builder
22
Name: python-virtualenv
3-
Version: 20.14.0
4-
Release: 6%{?dist}
3+
Version: 20.26.6
4+
Release: 1%{?dist}
55
License: MIT
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
88
Group: Development/Languages/Python
99
URL: https://pypi.python.org/pypi/virtualenv
10-
Source0: https://files.pythonhosted.org/packages/4a/c3/04f361a90ed4e6b3f3f696d61db5c786eaa741d2a6c125bc905b8a1c0200/virtualenv-%{version}.tar.gz#/%{name}-%{version}.tar.gz
11-
# Derived from upstream patch https://github.com/pypa/virtualenv/commit/9f9dc6250fc88e92b1ca6206429966788846d696
12-
Patch0: fix-plugin-attribute-name.patch
13-
Patch1: pin-pytest-version.patch
10+
Source0: https://files.pythonhosted.org/packages/3f/40/abc5a766da6b0b2457f819feab8e9203cbeae29327bd241359f866a3da9d/virtualenv-20.26.6.tar.gz#/%{name}-%{version}.tar.gz
11+
Patch0: 0001-replace-to-flit.patch
1412
BuildArch: noarch
1513

1614
%description
@@ -26,6 +24,8 @@ BuildRequires: python3-wheel
2624
%if 0%{?with_check}
2725
BuildRequires: python3-pip
2826
%endif
27+
BuildRequires: python3-flit
28+
BuildRequires: python3-flit-core >= 3.8.0
2929

3030
Requires: python3
3131
Requires: python3-filelock
@@ -40,14 +40,18 @@ virtualenv is a tool to create isolated Python environment.
4040
%prep
4141
%autosetup -p1 -n virtualenv-%{version}
4242

43+
%generate_buildrequires
44+
4345
%build
44-
%py3_build
46+
%pyproject_wheel
4547

4648
%install
47-
%py3_install
49+
%pyproject_install
4850

4951
%check
5052
pip3 install 'tox>=3.27.1,<4.0.0'
53+
# skip "test_can_build_c_extensions" tests since they fail on python3_version >= 3.12. See https://src.fedoraproject.org/rpms/python-virtualenv/blob/rawhide/f/python-virtualenv.spec#_153
54+
sed -i 's/coverage run -m pytest {posargs:--junitxml {toxworkdir}\/junit\.{envname}\.xml tests --int}/coverage run -m pytest {posargs:--junitxml {toxworkdir}\/junit\.{envname}\.xml tests -k "not test_can_build_c_extensions" --int}/g' tox.ini
5155
tox -e py
5256

5357
%files -n python3-virtualenv
@@ -57,6 +61,11 @@ tox -e py
5761
%{_bindir}/virtualenv
5862

5963
%changelog
64+
* Wed Feb 26 2025 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 20.26.6-1
65+
- Auto-upgrade to 20.26.6 - for CVE-2024-53899 [High]
66+
- Remove previously applied patches
67+
- Added patch to use python3-flit-core as build-backend rather than hatchling (which is not yet supported on Azure Linux)
68+
6069
* Wed Feb 07 2024 corvus-callidus <108946721+corvus-callidus@users.noreply.github.com> - 20.14.0-6
6170
- Fix pytest version to <8 for compatibility
6271

cgmanifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24924,8 +24924,8 @@
2492424924
"type": "other",
2492524925
"other": {
2492624926
"name": "python-virtualenv",
24927-
"version": "20.14.0",
24928-
"downloadUrl": "https://files.pythonhosted.org/packages/4a/c3/04f361a90ed4e6b3f3f696d61db5c786eaa741d2a6c125bc905b8a1c0200/virtualenv-20.14.0.tar.gz"
24927+
"version": "20.26.6",
24928+
"downloadUrl": "https://files.pythonhosted.org/packages/3f/40/abc5a766da6b0b2457f819feab8e9203cbeae29327bd241359f866a3da9d/virtualenv-20.26.6.tar.gz"
2492924929
}
2493024930
}
2493124931
},

0 commit comments

Comments
 (0)