-
-
Notifications
You must be signed in to change notification settings - Fork 594
feat: data and pyi files in the venv #2936
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
base: main
Are you sure you want to change the base?
Changes from all commits
9dd7589
1381bf8
42e5059
d59f85a
714b245
31e16ee
e0affec
c844aa0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
load("@rules_python//python:py_library.bzl", "py_library") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
py_library( | ||
name = "simple_v1", | ||
srcs = glob(["site-packages/**/*.py"]), | ||
data = glob( | ||
["**/*"], | ||
exclude = ["site-packages/**/*.py"], | ||
), | ||
experimental_venvs_site_packages = "@rules_python//python/config_settings:venvs_site_packages", | ||
imports = [package_name() + "/site-packages"], | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
inside is v1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "1.0.0" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Intentionally empty |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
load("@rules_python//python:py_library.bzl", "py_library") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
py_library( | ||
name = "simple_v2", | ||
srcs = glob(["site-packages/**/*.py"]), | ||
data = glob( | ||
["**/*"], | ||
exclude = ["site-packages/**/*.py"], | ||
), | ||
experimental_venvs_site_packages = "@rules_python//python/config_settings:venvs_site_packages", | ||
imports = [package_name() + "/site-packages"], | ||
pyi_srcs = glob(["**/*.pyi"]), | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
inside is v1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Intentionally empty | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The dirname here is "simple.libs" -- is that a convention I'm unaware? The part that confuses me is it has "libs" in its name (implying it should have loadable code), but its just data files. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is usually libs, but I was not sure how to have a minimal loadable extension for the unit test. The convention is present on latest wheels published on PyPI, but I haven't seen it in previous wheels, so it is a function of the publisher and not the installer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. by libs you mean e.g. TBH, I'm surprised this would be a convention -- why bother putting files in a separate directory outside the package's directory? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've found it only on the linux wheel, the mac wheel did not have it, so could be OS specific. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The installation paths for python that are relevant come from sysconfig. They're called installation schemes. The only ones relevant are purelib, platlib, data, scripts iirc. https://docs.python.org/3/library/sysconfig.html#installation-paths This is partially why we use pypa/installer today instead of trying to sniff conventions. These new conventions we see with numpy are not a standard. They're just co-operative packages in the pydata community that drop files in well-known locations for others. From the perspective of a standards compliant installer, they're just files we should unzip into site-packages. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the The tool will ensure that all of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good find! I think you're right. The point really is that outside a few standard folders and the destination schemes, the rest of the files in RECORD are just arbitrary files that are unpacked. We found this out with typing.py. Actually, are we using the RECORD file anywhere as an index of the files in the archive and for creation of symlinks or validation of file hashes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now we are not using the In the future, instead of using EDIT: To be honest, I don't see what else needs to be done here before we can mark it as stable. I'd love people to test this more and tell me what is breaking. Once the |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "2.0.0" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Intentionally empty |
Uh oh!
There was an error while loading. Please reload this page.