-
Notifications
You must be signed in to change notification settings - Fork 439
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
Improve site package pathing #781
base: main
Are you sure you want to change the base?
Improve site package pathing #781
Conversation
de998fd
to
a1ddd8f
Compare
25b3ba8
to
eb713ca
Compare
3515d36
to
66edd67
Compare
bb2e017
to
660ac4c
Compare
512b3da
to
93863db
Compare
@inseokhwang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Hi! It seems like your issue is site packages are not being detected? Is this on windows? Would you be able to try on WSL since we currently do not support windows? |
If the `excepted_path` is not None, it will must be a exists path
e03afd8
to
7e6afcb
Compare
pyre-check/client/configuration/search_path.py Lines 76 to 77 in baad875
Pyre only treat a .py file as a site-package, and this PR improved the pathing of site-package. |
1ae4897
to
98dd4f7
Compare
98dd4f7
to
1608b6a
Compare
…wlist with set-comprehension
I'm not convinced yet that this is the right approach. I left some comments but I'll also bring it up with the team. General feedback:
|
@@ -35,11 +44,11 @@ def _expand_relative_root(path: str, relative_root: str) -> str: | |||
|
|||
class Element(abc.ABC): | |||
@abc.abstractmethod | |||
def path(self) -> str: | |||
def path(self) -> Union[str, None]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Optional[str]
could you explain the reasoning and semantic differences for making this optional in the summary?
dbb289a
to
6bedb96
Compare
Here is a tasklist for this PR:
|
@kinto0 For the second task, I guess this may because a |
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit install
pre-commit run
Summary
A top-level package could implement by many ways, like
.so
,.pyd
file, etc.However,
pyre
only treat a.py
file as a top-level package:pyre-check/client/configuration/search_path.py
Lines 76 to 77 in 689a8be
This PR improved the pathing by seeing the
RECORD
file in the package'sdist-info
e.g.This is the
RECORD
file in thedist-info
of theujson
(ujson-5.8.0.dist-info):As you see, We only need
ujson.cpython-310-x86_64-linux-gnu.so
but there are a lot of other unnessarry files in theRECORD
.For this, I filterd them out by matching if the file is inXXX-XXX.dist-info
or__pycache__
.Also see #773 (comment).
Issue fixed: #773
Test Plan
Before this PR:
After this PR: