Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
8ccc1ea20e
!61 Add new Pytest cache directory to gitignore (#244)
From: @lb1107039128 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-12-25 07:45:14 +00:00
lb1107039128
585069b5ad Add new Pytest cache directory to gitignore (#244)
Signed-off-by: lb1107039128 <liubo1@xfusion.com>
2023-12-22 17:15:01 +08:00
openeuler-ci-bot
65277f5edd
!56 [sync] PR-49: Fixed parsing of wheel file names with multiple platform tags
From: @openeuler-sync-bot 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2023-12-19 08:53:24 +00:00
shixuantong
dd76fcddd8 Fixed parsing of wheel file names with multiple platform tags
(cherry picked from commit 8902f390e7fa2f3bc7e31fc772fd8298ba806570)
2023-12-19 14:35:47 +08:00
openeuler-ci-bot
f58eeff415
!41 Fix CVE-2022-40898
From: @wk333 
Reviewed-by: @lyn1001 
Signed-off-by: @lyn1001
2023-12-08 06:49:13 +00:00
wk333
c576c8ddb0 Fix CVE-2022-40898 2023-12-08 11:06:32 +08:00
openeuler-ci-bot
7129643b53
!32 Enabled Intersphinx linking to Python documentation
From: @lb1107039128 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-11-28 03:37:07 +00:00
openeuler-ci-bot
227ce44834 chore: add github actions
Signed-off-by: liubo <liubo1@xfusion.com>
2023-11-28 09:53:15 +08:00
openeuler-ci-bot
1f3133b7dd !2 Enable bootstrap by default
Merge pull request !2 from 窃格瓦拉/master
2019-12-17 15:04:43 +08:00
qiegewala
38b2d0b68f Enable bootstrap by default
Signed-off-by: qiegewala <1169471515@qq.com>
2019-12-17 14:56:17 +08:00
5 changed files with 172 additions and 2 deletions

View File

@ -0,0 +1,27 @@
From 56022bcd023b10de355349dc68c8f5357826c1b8 Mon Sep 17 00:00:00 2001
From: Jon Dufresne <jon.dufresne@gmail.com>
Date: Mon, 16 Jul 2018 14:01:38 -0700
Subject: [PATCH] Add new Pytest cache directory to gitignore (#244)
Starting with Pytest 3.4.0 (2018-01-30), Pytest's cache directory was
renamed to .pytest_cache.
https://docs.pytest.org/en/latest/changelog.html#pytest-3-4-0-2018-01-30
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 9a49a38..4a94d64 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,5 +6,6 @@ dist
docs/_build
__pycache__
.coverage
+.pytest_cache/
.tox
.idea
--
2.42.0.windows.2

View File

@ -0,0 +1,36 @@
From 178d576c1819faf47802f66460a0cd3d568916ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= <alex.gronholm@nextday.fi>
Date: Sat, 7 Oct 2017 19:53:38 +0300
Subject: [PATCH] Enabled Intersphinx linking to Python documentation
---
docs/conf.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/docs/conf.py b/docs/conf.py
index 1db319d..e9a5b35 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -25,7 +25,7 @@ import pkg_resources
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = []
+extensions = ['sphinx.ext.intersphinx']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -87,6 +87,10 @@ highlight_language = 'bash'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
+intersphinx_mapping = {
+ 'python': ('https://docs.python.org/', None)
+}
+
# -- Options for HTML output ---------------------------------------------------
--
2.42.0.windows.2

25
CVE-2022-40898.patch Normal file
View File

@ -0,0 +1,25 @@
From 88f02bc335d5404991e532e7f3b0fc80437bf4e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= <alex.gronholm@nextday.fi>
Date: Thu, 20 Oct 2022 17:13:23 +0300
Subject: [PATCH] Fixed potential DoS attack via WHEEL_INFO_RE
Refer: https://github.com/pypa/wheel/issues/498
---
wheel/install.py | 4 ++--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/wheel/install.py b/wheel/install.py
index a0c9d2a5..b985774e 100644
--- a/wheel/install.py
+++ b/wheel/install.py
@@ -16,8 +16,8 @@
# Non-greedy matching of an optional build number may be too clever (more
# invalid wheel filenames will match). Separate regex for .dist-info?
WHEEL_INFO_RE = re.compile(
- r"""^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))(-(?P<build>\d.*?))?
- -(?P<pyver>[a-z].+?)-(?P<abi>.+?)-(?P<plat>.+?)(\.whl|\.dist-info)$""",
+ r"""^(?P<namever>(?P<name>[^-]+?)-(?P<ver>\d[^-]*?))(-(?P<build>\d[^-]*?))?
+ -(?P<pyver>[a-z][^-]+?)-(?P<abi>[^-]+?)-(?P<plat>[^.]+?)(\.whl|\.dist-info)$""",
re.VERBOSE).match

View File

@ -0,0 +1,66 @@
From 44193907eb308930de05deed863fb4d157c5c866 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= <alex.gronholm@nextday.fi>
Date: Sat, 5 Nov 2022 01:17:22 +0200
Subject: [PATCH] Fixed parsing of wheel file names with multiple platform tags
Reference:https://github.com/pypa/wheel/commit/44193907eb308930de05deed863fb4d157c5c866
Conflict:src/wheel/install.py src/tests/test_install.py
---
tests/test_install.py | 16 ++++++++++++++--
wheel/install.py | 4 ++--
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/tests/test_install.py b/tests/test_install.py
index 42db4f0..847bb31 100644
--- a/tests/test_install.py
+++ b/tests/test_install.py
@@ -20,6 +20,8 @@ import wheel.pep425tags
import wheel.tool
from wheel.install import WheelFile
+import pytest
+
THISDIR = os.path.dirname(__file__)
TESTWHEEL = os.path.join(THISDIR, 'test-1.0-py2.py3-none-win32.whl')
@@ -101,8 +103,18 @@ def test_install_tool():
"""Slightly improve coverage of wheel.install"""
wheel.tool.install([TESTWHEEL], force=True, dry_run=True)
-
-def test_wheelfile_re():
+@pytest.mark.parametrize(
+ "filename",
+ [
+ "foo-2-py3-none-any.whl",
+ "foo-2-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
+ ],
+)
+def test_wheelfile_re(filename, tmpdir):
# Regression test for #208
wf = WheelFile('foo-2-py3-none-any.whl')
assert wf.distinfo_name == 'foo-2.dist-info'
+
+ path = tmpdir.join(filename)
+ wf = WheelFile(str(path), "w")
+ assert wf.parsed_filename.group("namever") == "foo-2"
diff --git a/wheel/install.py b/wheel/install.py
index 792b707..26359da 100644
--- a/wheel/install.py
+++ b/wheel/install.py
@@ -32,8 +32,8 @@ VERSION_TOO_HIGH = (1, 0)
# Non-greedy matching of an optional build number may be too clever (more
# invalid wheel filenames will match). Separate regex for .dist-info?
WHEEL_INFO_RE = re.compile(
- r"""^(?P<namever>(?P<name>[^-]+?)-(?P<ver>\d[^-]*?))(-(?P<build>\d[^-]*?))?
- -(?P<pyver>[a-z][^-]+?)-(?P<abi>[^-]+?)-(?P<plat>[^.]+?)(\.whl|\.dist-info)$""",
+ r"""^(?P<namever>(?P<name>[^\s-]+?)-(?P<ver>[^\s-]*?))(-(?P<build>\d[^\s-]*?))?
+ -(?P<pyver>[^\s-]+?)-(?P<abi>[^\s-]+?)-(?P<plat>\S+?)(\.whl|\.dist-info)$""",
re.VERBOSE).match
--
2.27.0

View File

@ -1,7 +1,7 @@
%bcond_without bootstrap
%bcond_with bootstrap
Name: python-wheel
Version: 0.31.1
Release: 4
Release: 8
Epoch: 1
Summary: Built-package format for Python
License: MIT
@ -10,6 +10,10 @@ Source0: %{url}/archive/%{version}/wheel-%{version}.tar.gz
BuildArch: noarch
Patch0000: remove-keyrings.alt-dependency.patch
Patch0001: 0001-Enabled-Intersphinx-linking-to-Python-documentation.patch
Patch0002: CVE-2022-40898.patch
Patch0003: backport-Fixed-parsing-of-wheel-file-names-with-multiple-platform-tags.patch
Patch0004: 0001-Add-new-Pytest-cache-directory-to-gitignore-244.patch
%description
A built-package format for Python.
@ -116,5 +120,17 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-3 -v --ignore build
%endif
%changelog
* Fri Dec 22 2023 liubo <liubo1@xfusion.com> - 1:0.31.1-8
- Add new Pytest cache directory to gitignore (#244)
* Tue Dec 19 2023 shixuantong <shixuantong1@huawei.com> - 1:0.31.1-7
- Fixed parsing of wheel file names with multiple platform tags
* Fri Dec 08 2023 wangkai <13474090681@163.com> - 1:0.31.1-6
- Fix CVE-2022-40898
* Mon Nov 27 2023 liubo <liubo1@xfusion.com> - 1:0.31.1-5
- Enabled Intersphinx linking to Python documentation
* Mon Dec 2 2019 yangjian<yangjian79@huawei.com> - 1:0.31.1-4
- Package init