virtualenv icon indicating copy to clipboard operation
virtualenv copied to clipboard

Extract discovery to it's own package

Open gaborbernat opened this issue 3 years ago • 15 comments

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 avatar Mar 01 '21 09:03 gaborbernat

@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?

gaborbernat avatar Mar 01 '21 09:03 gaborbernat

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.

pfmoore avatar Mar 01 '21 09:03 pfmoore

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.

gaborbernat avatar Mar 01 '21 09:03 gaborbernat

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.

pfmoore avatar Mar 01 '21 09:03 pfmoore

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

uranusjr avatar Mar 01 '21 11:03 uranusjr

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 avatar Mar 01 '21 11:03 gaborbernat

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

gaborbernat avatar Jun 27 '23 03:06 gaborbernat

@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.

dukecat0 avatar Dec 07 '23 14:12 dukecat0

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

gaborbernat avatar Dec 07 '23 15:12 gaborbernat

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

dukecat0 avatar Dec 07 '23 15:12 dukecat0

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.

gaborbernat avatar Dec 07 '23 15:12 gaborbernat

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

dukecat0 avatar Dec 09 '23 10:12 dukecat0

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 avatar Dec 09 '23 17:12 gaborbernat

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

gaborbernat avatar Dec 10 '23 01:12 gaborbernat

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.

gaborbernat avatar Dec 10 '23 18:12 gaborbernat