Re: [RFC PATCH 1/3] python: add mkvenv.py

2023-04-13 Thread John Snow
On Wed, Mar 29, 2023 at 8:56 AM Paolo Bonzini wrote: > > BTW, another way to repair Debian 10's pip is to create a symbolic link > to sys.base_prefix + '/share/python-wheels' in sys.prefix + > '/share/python-wheels'. Since this is much faster, perhaps it can be > done unconditionally and checkpip

Re: [RFC PATCH 1/3] python: add mkvenv.py

2023-04-13 Thread John Snow
On Wed, Mar 29, 2023 at 8:56 AM Paolo Bonzini wrote: > > On 3/28/23 23:11, John Snow wrote: > > +for entry_point in entry_points: > > +# Python 3.8 doesn't have 'module' or 'attr' attributes > > +if not (hasattr(entry_point, 'module') and > > +

Re: [RFC PATCH 1/3] python: add mkvenv.py

2023-03-31 Thread Paolo Bonzini
On 3/31/23 10:44, Paolo Bonzini wrote:     What about using a dataclass or namedtuple instead of a dictionary? Sure. Once 3.8 is our minimum there's no point, though. Well, that's why I also mentioned namedtuples.  But no big deal. Sorry, I misunderstood this (I read "until 3.8 is our mini

Re: [RFC PATCH 1/3] python: add mkvenv.py

2023-03-31 Thread Paolo Bonzini
On 3/30/23 16:00, John Snow wrote: > +                yield { > +                    'name': entry_point.name , > +                    'module': module, > +                    'import_name': attr, > +                    'func': attr, What

Re: [RFC PATCH 1/3] python: add mkvenv.py

2023-03-30 Thread John Snow
On Wed, Mar 29, 2023, 8:56 AM Paolo Bonzini wrote: > On 3/28/23 23:11, John Snow wrote: > > +# venv class is cute and toggles this off before post_setup, > > +# but we need it to decide if we want to generate shims or not. > > Ha, yeah that's a bug in the venv package. post_setup

Re: [RFC PATCH 1/3] python: add mkvenv.py

2023-03-29 Thread Paolo Bonzini
On 3/28/23 23:11, John Snow wrote: +# venv class is cute and toggles this off before post_setup, +# but we need it to decide if we want to generate shims or not. Ha, yeah that's a bug in the venv package. post_setup() can already run with system_site_packages reverted to True.

[RFC PATCH 1/3] python: add mkvenv.py

2023-03-28 Thread John Snow
This script will be responsible for building a Python virtual environment at configure time. As such, it exists outside of the installable python packages and *must* be runnable with minimal dependencies. Signed-off-by: John Snow --- python/scripts/mkvenv.py | 445 +++