-
Notifications
You must be signed in to change notification settings - Fork 297
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
[BUG] Consider each site_package #2920
base: master
Are you sure you want to change the base?
Conversation
Thank you for opening this pull request! 🙌 These tips will help get your PR across the finish line:
|
Signed-off-by: Bennett <[email protected]>
a6b6894
to
e48f56c
Compare
any chance you can think of a simple unit test for this? |
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.
@BennettRand I think the simplest unit test is to monkeypatch site.getsitepackages
and check that list_imported_modules_as_files
does the right thing.
Signed-off-by: Bennett <[email protected]>
@thomasjpfan @wild-endeavor Just added it. |
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.
Thank you for the test! LGTM
Signed-off-by: Bennett <[email protected]>
0e09c79
|
||
def test_list_imported_modules_as_files(): | ||
|
||
source_path = "/home/username/project" |
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.
For windows CI to pass, I think we'll either need to use os.path.join
or pathlib.Path
to define the paths.
(Windows uses \
instead of /
)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2920 +/- ##
==========================================
+ Coverage 46.91% 51.42% +4.51%
==========================================
Files 199 199
Lines 20840 20840
Branches 2681 2681
==========================================
+ Hits 9778 10718 +940
+ Misses 10582 9517 -1065
- Partials 480 605 +125 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Bennett <[email protected]>
20538ea
to
ecea07d
Compare
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.
@BennettRand The failing windows test looks related to this PR.
Why are the changes needed?
site.getsitepackages()
was returningwhich when run through
os.path.commonpath
isThis makes it so that any
mod_file
compared to the site packages set, will never be a string in the site packages set, thus being included in the list of filed to be packaged for fast serialization.What changes were proposed in this pull request?
Compare the common path of the module file to each site package in the site package set to see if the mosule file should be skipped.
How was this patch tested?
No tests added, all tests passed in Python 3.12.7
Manually inspected the file tree generated by a
pyflyte -v run --remote ...
command and the contents of the resulting.tar.gz
file.Setup process
Screenshots
Check all the applicable boxes
Related PRs
Docs link