pypa / virtualenv

Virtual Python Environment builder
https://virtualenv.pypa.io
MIT License
4.81k stars 1.03k forks source link

Extract discovery to it's own package #2074

Open gaborbernat opened 3 years ago

gaborbernat commented 3 years ago

From https://github.com/pipxproject/pipx/issues/638 @uranusjr

I love virtualenv.discovery, but virtualenv is a big thing to pull in. I would reach for it every time if the functionality could be extracted into its own distribution.

gaborbernat commented 3 years ago

@pfmoore may we get the py-discovery package under PyPa? If so can you create a repo for it and make me admin of it?

pfmoore commented 3 years ago

The usual process is that you create a separate package under your own name, then propose it for PyPA inclusion on Discourse, and then it gets moved to the PyPA namespace. See the process here.

I don't see any reason why this shouldn't be straightforward - it sounds like a good idea to me.

gaborbernat commented 3 years ago

That's usually the case with new projects, but in the case of splitting the existing ones, I've thought we don't need the intermediate step.

pfmoore commented 3 years ago

Honestly, I don't know - the process in PEP 609 was decided by the PyPA with @di as the PEP author (the discussion was here). I don't think I have the authority to modify it - my role is as PEP delegate for interoperability PEPs, not PyPA BDFL.

I agree that splitting out part of an existing project should be straightforward - the process should be just a formality.

uranusjr commented 3 years ago

Bringing this to the technical side of things, what dependencies are needed for the discovery logic?

gaborbernat commented 3 years ago

Can be made no dependency at all :-) Depends on how much we extract, and how much we leave behind. (if we keep everything I think appdris, filelock).

gaborbernat commented 1 year ago

Seemns there's wasn't much request for this, so closing as not planned.

dukecat0 commented 10 months ago

@gaborbernat Is there any chance to get this reopen? Recently I am implementing pipx install-all and it will be helpful if it can locate a suitable python interpreter for installing the package.

gaborbernat commented 10 months ago

We can do this... Not sure when I will have time for it, however, definitely doable.

dukecat0 commented 10 months ago

Maybe I can try to extract the logic into a separate package first?

gaborbernat commented 10 months ago

Sure 👍 feel free to add me as a reviewer. You can likely copy all the files from this project, remove the non discovery part, and rename it. That way should be fairly straightforward the review and moving it under PyPA.

dukecat0 commented 10 months ago

Should the cache part be removed? I personally think that it can be implemented in virtualenv.

gaborbernat commented 10 months ago

Removed, not, but doesn't need to be part of the extracted package 👍 Though the cache is very useful could be an extra at a future time.

gaborbernat commented 10 months ago

Started at https://github.com/tox-dev/py-discovery, will try to get something working by Monday 😊

gaborbernat commented 10 months ago

I have a first version that passes the CI and all that. However, removing the cache layer is very destructive, so I'll need to re-architecture it a bit more to integrate it back to virtualenv with caching, so it's not ready for a release just yet.