-
Notifications
You must be signed in to change notification settings - Fork 10
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
Embed typing_extensions package to support Python < 3.8 #10
base: main
Are you sure you want to change the base?
Conversation
536b6fb
to
c39a10d
Compare
Well I was really eager to explore Bazel. I've updated the PR to download the dependency packages rather than embedding them. BTW I've taken the latest versions, which may not be what you want, all I can say is it's working on my machine (TM).
|
Hi, thanks for the PR. I'm not opposed to the change in spirit. I don't recall why I went with the vendoring approach but I'm guessing it was to avoid requiring a A couple of suggestions though:
|
Hi. I continued a bit practicing Bazel and am coming up with some new commits. Regarding your first point, I'm wondering, my WORKSPACE reads exactly like that: http_archive(name = "rules_python", ...)
load("@rules_python//python:pip.bzl", "pip_parse")
pip_parse(name = "pip_deps", ...)
load("@pip_deps//:requirements.bzl", "install_deps")
install_deps() So it seems to me that the standard practice is to pass a name ( I understand you had to suggest that if your boss was looking over your shoulder, or if you are this person :) For the second point, I've never tried before, will do. |
I ran into this as well, trying to exercise the examples at HEAD |
When running
bazel run //:venv env
whereby Python 3.7 is invoked:Occurs here:
rules_pyvenv/vendor/importlib_metadata/importlib_metadata/_compat.py
Line 8 in 115dcaf
typing_extensions
is imported, but this is not a built-in package: https://pypi.org/project/typing-extensions/This patch adds that lib to the vendor directory. I believe its license allows it.
While this patch makes it work, I find a bit sad to always depend on a new lib only to support old Python versions. I've also tried not to embed any third-party lib but to fetch them with
http_archive
, which then could have been combined withselect
to only fetchtyping_extensions
if needed. However this would require changing theWORKSPACE
system to aMODULE.bazel
system to make a dependency chain, publishing the module to the registry... Apparently Bazel will push towards this change over time anyway.BTW, I tried to run the example as a test, and some packages were missing from requirements.txt so venv creation was blocked. Running
bazel run //requirements.update
would only addcolorama
(why was it missing anyway?), whereasimportlib-metadata
,typing-extensions
, andzipp
were also needed due toblack
, but because they are the three vendor libs some conflict may have occurred. I haven't committed that change, because you'd have a better sight on that.