Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Support PEP 582 (__pypackages__) #1441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
NoelJacob opened this issue Jun 13, 2021 · 6 comments
Closed

Support PEP 582 (__pypackages__) #1441

NoelJacob opened this issue Jun 13, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@NoelJacob
Copy link

Tools like Pyflow and PDM are package managers using Pep582 specification to install packages. It'd be good if Pylance supported it.

@erictraut
Copy link
Contributor

Thanks for the feature request.

Just a side note that mypy doesn't support PEP 582 currently either. See python/mypy#10633.

@judej judej added the enhancement New feature or request label Jun 14, 2021
@github-actions github-actions bot removed the triage label Jun 14, 2021
@jakebailey
Copy link
Member

This feels like a pretty unfortunate spec for analyzers... We already have issues resolving imports from scripts, and it seems like this PEP goes and makes it so that every script can have its own separate site-packages folder. It won't be as simple as asking python what the search paths are, because now there's a slew of paths that depend on which file is going to be read.

@jakebailey jakebailey changed the title Support Pep582 Support PEP 582 (__pypackages__) Aug 23, 2021
@frostming
Copy link

frostming commented Aug 26, 2021

Note that PEP 582 doesn't mention the layout of __pypackages__ directory, i.e. where should the scripts and libraries go, except for an example layout which only contains lib folder. If I read the PEP correctly, the libraries can reside in arbitrary deep sub-directories inside __pypackages__.

Kushal Das, the author of PEP 582, used a layout of __pypackages__/lib/pythonX.Y/site-packages in his implementation, which is different from the example included in the PEP.

Therefore, I don't recommend starting the work to support PEP 582 in IDE before that point is clarified.

@DanLipsitt
Copy link

@kushaldas @zooba @dstufft @ncoghlan can any of you comment on the PEP 582 spec ambiguity above regarding directory layout?

Apologies if I have the handles of any of the PEP authors wrong.

@zooba
Copy link
Member

zooba commented Jan 20, 2022

The ambiguity is because the PEP is unfinished and has never been reviewed by anyone in a position to accept/approve it.

The intent is that the "root" of a project (i.e. the directory that contains the script that is run directly) has a subdirectory that is added to sys.path. So it's one extra location relative to the main file, much like an explicitly configured PYTHONPATH value.

The feature creep led to people demanding separate directories based on Python version/tags, and then more directories for scripts and PATH entries. That's the point where I gave up on it, deciding that people couldn't possibly envision new tools and approaches for solving those issues and I couldn't be bothered trying to explain it. I have no idea what anyone else has done with the idea, but I'm not aware of any approved PEPs about it.

@judej judej removed the in backlog label Mar 22, 2022
@judej
Copy link
Contributor

judej commented Apr 18, 2022

Moving this issue to discussion as an enhancement request for comments and upvotes.

@microsoft microsoft locked and limited conversation to collaborators Apr 18, 2022
@judej judej converted this issue into discussion #2584 Apr 18, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants