#63 Add explicit error when embed version of wheels is requested
Merged 2 years ago by lbalhar. Opened 2 years ago by lbalhar.
rpms/ lbalhar/python-virtualenv rawhide  into  rawhide

file modified
+5 -1
@@ -1,6 +1,6 @@ 

  Name:           python-virtualenv

  Version:        20.13.3

- Release:        1%{?dist}

+ Release:        2%{?dist}

  Summary:        Tool to create isolated Python environments

  

  License:        MIT
@@ -157,6 +157,10 @@ 

  

  

  %changelog

+ * Mon Mar 14 2022 Lumír Balhar <lbalhar@redhat.com> - 20.13.3-2

+ - Add explicit error when embed version of wheels is requested

+ Resolves: rhbz#2053948

+ 

  * Tue Mar 08 2022 Lumír Balhar <lbalhar@redhat.com> - 20.13.3-1

  - Update to 20.13.3

  Resolves: rhbz#2061449

file modified
+25 -9
@@ -1,16 +1,16 @@ 

- From 9b8653289e84c6d24b5da1ffc8c21e8c204fc48c Mon Sep 17 00:00:00 2001

+ From e32327e4e06eef42a631e3f21674b4577b40ce77 Mon Sep 17 00:00:00 2001

  From: Lumir Balhar <lbalhar@redhat.com>

- Date: Mon, 3 Jan 2022 11:50:56 +0100

- Subject: [PATCH] rpm wheels

+ Date: Tue, 15 Mar 2022 08:07:24 +0100

+ Subject: [PATCH] RPM wheels

  

  ---

   src/virtualenv/run/__init__.py                |  5 +++--

-  src/virtualenv/seed/embed/base_embed.py       |  7 +++++-

+  src/virtualenv/seed/embed/base_embed.py       | 16 +++++++++++++-

   src/virtualenv/seed/embed/pip_invoke.py       |  1 +

   .../seed/embed/via_app_data/via_app_data.py   |  1 +

   src/virtualenv/seed/wheels/embed/__init__.py  |  3 +++

   src/virtualenv/util/path/_system_wheels.py    | 22 +++++++++++++++++++

-  6 files changed, 36 insertions(+), 3 deletions(-)

+  6 files changed, 45 insertions(+), 3 deletions(-)

   create mode 100644 src/virtualenv/util/path/_system_wheels.py

  

  diff --git a/src/virtualenv/run/__init__.py b/src/virtualenv/run/__init__.py
@@ -30,7 +30,7 @@ 

   

   def load_app_data(args, parser, options):

  diff --git a/src/virtualenv/seed/embed/base_embed.py b/src/virtualenv/seed/embed/base_embed.py

- index c794e83..0867e9c 100644

+ index c794e83..43c636d 100644

  --- a/src/virtualenv/seed/embed/base_embed.py

  +++ b/src/virtualenv/seed/embed/base_embed.py

  @@ -6,11 +6,12 @@ from six import add_metaclass
@@ -47,7 +47,23 @@ 

   

   

   @add_metaclass(ABCMeta)

- @@ -116,3 +117,7 @@ class BaseEmbed(Seeder):

+ @@ -34,6 +35,15 @@ class BaseEmbed(Seeder):

+          if not self.distribution_to_versions():

+              self.enabled = False

+  

+ +        if "embed" in (self.pip_version, self.setuptools_version, self.wheel_version):

+ +            raise RuntimeError(

+ +                "Embedded wheels are not available if virtualenv "

+ +                "is installed from the RPM package.\nEither install "

+ +                "virtualenv from PyPI (via pip) or use 'bundle' "

+ +                "version which uses the system-wide pip, setuptools "

+ +                "and wheel wheels provided also by RPM packages."

+ +            )

+ +

+      @classmethod

+      def distributions(cls):

+          return {

+ @@ -116,3 +126,7 @@ class BaseEmbed(Seeder):

   

       def __repr__(self):

           return ensure_str(self.__unicode__())
@@ -80,7 +96,7 @@ 

               pip_version = name_to_whl["pip"].version_tuple if "pip" in name_to_whl else None

               installer_class = self.installer_class(pip_version)

  diff --git a/src/virtualenv/seed/wheels/embed/__init__.py b/src/virtualenv/seed/wheels/embed/__init__.py

- index d38ccf8..4b80d98 100644

+ index ba15be9..3b488cf 100644

  --- a/src/virtualenv/seed/wheels/embed/__init__.py

  +++ b/src/virtualenv/seed/wheels/embed/__init__.py

  @@ -48,8 +48,11 @@ BUNDLE_SUPPORT = {
@@ -124,5 +140,5 @@ 

  +    if wheels_dir.exists():

  +        yield wheels_dir

  -- 

- 2.33.1

+ 2.35.1

  

Fixes a strange error for cases when "embed" version of pip/setuptools/wheel is requested. See the bugzilla for more details: https://bugzilla.redhat.com/show_bug.cgi?id=2053948

This seems like a reasonable message to me.

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Could you avoid the word Fedora here, so I can reuse this in EPEL?

This seems like a reasonable message to me.

Thanks for the review!

Could you avoid the word Fedora here, so I can reuse this in EPEL?

Done.

rebased onto b7713a7

2 years ago

Build succeeded.

Pull-Request has been merged by lbalhar

2 years ago