diff --git a/aa847eaa8a430ea6b3984295ff7869b6ca37b761.patch b/aa847eaa8a430ea6b3984295ff7869b6ca37b761.patch new file mode 100644 index 0000000000000000000000000000000000000000..0198238eb56eab429c688feac23074b2b133dc97 --- /dev/null +++ b/aa847eaa8a430ea6b3984295ff7869b6ca37b761.patch @@ -0,0 +1,93 @@ +diff --git a/news/9122.bugfix.rst b/news/9122.bugfix.rst +new file mode 100644 +index 0000000000..da2ae5e5f9 +--- /dev/null ++++ b/news/9122.bugfix.rst +@@ -0,0 +1,2 @@ ++Fix a regression that made ``pip wheel`` generate zip files of editable ++requirements in the wheel directory. +diff --git a/src/pip/_internal/commands/download.py b/src/pip/_internal/commands/download.py +index 9535ef3cbe..a2d3bf7d9b 100644 +--- a/src/pip/_internal/commands/download.py ++++ b/src/pip/_internal/commands/download.py +@@ -132,7 +132,7 @@ def run(self, options, args): + + downloaded = [] # type: List[str] + for req in requirement_set.requirements.values(): +- if not req.editable and req.satisfied_by is None: ++ if req.satisfied_by is None: + assert req.name is not None + preparer.save_linked_requirement(req) + downloaded.append(req.name) +diff --git a/src/pip/_internal/operations/prepare.py b/src/pip/_internal/operations/prepare.py +index de017504ab..13b2c0beee 100644 +--- a/src/pip/_internal/operations/prepare.py ++++ b/src/pip/_internal/operations/prepare.py +@@ -530,7 +530,7 @@ def save_linked_requirement(self, req): + assert self.download_dir is not None + assert req.link is not None + link = req.link +- if link.is_vcs: ++ if link.is_vcs or (link.is_existing_dir() and req.editable): + # Make a .zip of the source_dir we already created. + req.archive(self.download_dir) + return +@@ -576,7 +576,6 @@ def prepare_editable_requirement( + req, self.req_tracker, self.finder, self.build_isolation, + ) + +- req.archive(self.download_dir) + req.check_if_exists(self.use_user_site) + + return dist +diff --git a/tests/functional/test_download.py b/tests/functional/test_download.py +index 2eee51b086..8a816b63b4 100644 +--- a/tests/functional/test_download.py ++++ b/tests/functional/test_download.py +@@ -849,3 +849,19 @@ def test_download_http_url_bad_hash( + assert len(requests) == 1 + assert requests[0]['PATH_INFO'] == '/simple-1.0.tar.gz' + assert requests[0]['HTTP_ACCEPT_ENCODING'] == 'identity' ++ ++ ++def test_download_editable(script, data, tmpdir): ++ """ ++ Test 'pip download' of editables in requirement file. ++ """ ++ editable_path = str(data.src / 'simplewheel-1.0').replace(os.path.sep, "/") ++ requirements_path = tmpdir / "requirements.txt" ++ requirements_path.write_text("-e " + editable_path + "\n") ++ download_dir = tmpdir / "download_dir" ++ script.pip( ++ 'download', '--no-deps', '-r', str(requirements_path), '-d', str(download_dir) ++ ) ++ downloads = os.listdir(download_dir) ++ assert len(downloads) == 1 ++ assert downloads[0].endswith(".zip") +diff --git a/tests/functional/test_wheel.py b/tests/functional/test_wheel.py +index f75b009beb..286d694356 100644 +--- a/tests/functional/test_wheel.py ++++ b/tests/functional/test_wheel.py +@@ -169,6 +169,22 @@ def test_pip_wheel_builds_editable(script, data): + result.did_create(wheel_file_path) + + ++def test_pip_wheel_builds_editable_does_not_create_zip(script, data, tmpdir): ++ """ ++ Test 'pip wheel' of editables does not create zip files ++ (regression test for issue #9122) ++ """ ++ wheel_dir = tmpdir / "wheel_dir" ++ wheel_dir.mkdir() ++ editable_path = os.path.join(data.src, 'simplewheel-1.0') ++ script.pip( ++ 'wheel', '--no-deps', '-e', editable_path, '-w', wheel_dir ++ ) ++ wheels = os.listdir(wheel_dir) ++ assert len(wheels) == 1 ++ assert wheels[0].endswith(".whl") ++ ++ + def test_pip_wheel_fail(script, data): + """ + Test 'pip wheel' failure. diff --git a/python-pip.spec b/python-pip.spec index 3d035b59a33f24b5c58f6925acf4d9cb6a79f840..08b7f688fc1f4006bae14f4ba60754b7dc8b726a 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -6,7 +6,7 @@ pip is the package installer for Python. You can use pip to install packages fro %global bashcompdir %(b=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null); echo ${b:-%{_sysconfdir}/bash_completion.d}) Name: python-%{srcname} Version: 20.2.2 -Release: 3 +Release: 4 Summary: A tool for installing and managing Python packages License: MIT and Python and ASL 2.0 and BSD and ISC and LGPLv2 and MPLv2.0 and (ASL 2.0 or BSD) URL: http://www.pip-installer.org @@ -16,6 +16,7 @@ Patch1: allow-stripping-given-prefix-from-wheel-RECORD-files.patch Patch2: emit-a-warning-when-running-with-root-privileges.patch Patch3: remove-existing-dist-only-if-path-conflicts.patch Patch6000: dummy-certifi.patch +Patch6001: aa847eaa8a430ea6b3984295ff7869b6ca37b761.patch Source10: pip-allow-older-versions.patch %description %{_description} @@ -112,6 +113,9 @@ install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} %{python_wheeldir}/%{python_wheelname} %changelog +* 20201123063007638028 patch-tracking 20.2.2-4 +- append patch file of upstream repository from to + * Wed Nov 4 2020 wangjie -20.2.2-3 - Type:NA - ID:NA @@ -161,4 +165,4 @@ install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} - DESC: Synchronize a patch * Mon Sep 23 2019 openEuler Buildteam - 18.0-6 -- Package init +- Package init \ No newline at end of file