Comments (16)
We need something like a py_toolchain
target in Bazel so that it actually knows what version of Python it's invoking. See py_toolchain draft proposal
from rules_python.
Also, I'd love to see @joshclimacell's patch in this repo.
from rules_python.
It looks like PyYAML selects which tree to install based upon the version of Python that is currently running: https://github.com/yaml/pyyaml/blob/master/setup.py#L287 . Is is possible that Bazel isn't running setup.py
under the same version of python specified in --python_path
?
from rules_python.
Yes, that's exactly right. Unfortunately this will be hard to fix, since Bazel is in a "transition" state right now regarding how it handles multiple Python interpreters, but we can take a look to see if there is a workaround.
from rules_python.
One workaround that immediately comes to mind is:
- Use
ruamel
instead ofPyYaml
, it's a drop-in replacement (PyYaml was abandoned, ruamel was forked, then PyYaml came back to life, not sure of the current status).
from rules_python.
Ignore my previous workaround # 1, reading comprehension fail.
We have this same issue internally in Blaze, but the specifics and the fix are different.
from rules_python.
@duggelz It sounds like there's a dependency on some Bazel work, then. Is there a Bazel issue one could follow for that work? Any ETA, or is it just "this should get done sometime, we don't know when"?
from rules_python.
@duggelz I've worked around my local issue by just using ruamel
(thanks for the pointer!), so this isn't a pressing problem for me right now.
However, it still feels like we'd want to solve this in the general case, for times when there isn't going to be a workaround.
from rules_python.
@duggelz @mattmoor It looks like this might also be related to bazelbuild/bazel#3871 ?
from rules_python.
Ping. I'm still interested in helping get this fixed, but need a few pointers.
from rules_python.
Ping...
from rules_python.
For reference, I implemented a (not-super-awesome, but functioning) workaround for loading Python 3 PyPi packages: joshclimacell@90a70d5
from rules_python.
This affects tornado
as well. Its setup.py
selectively adds dependencies depending on the runtime version of Python detected. The concurrent
library is not Python 3 compatible, and breaks the runtime.
from rules_python.
So, I noticed that there's not only a duplicate issue for this (#62), but there's also a duplicate PR for this one (#82). Can one of the project maintainers (@mattmoor ? @duggelz ?) help get this reconciled?
from rules_python.
Any update on this?
from rules_python.
Using this as repro to merge (a rebase of) #85; work toward #249.
from rules_python.
Related Issues (20)
- `pip_parse()` does not correctly read `*.pth` files? HOT 7
- Document how to create a python container image HOT 5
- Cannot set repo_prefix in pip_parse as the docs describe
- Allow root module to customize toolchains HOT 1
- runtime env toolchain is missing executable bit
- `whl_filegroup` fails when no python3 installed on host HOT 2
- Support importing across repos with bzlmod HOT 16
- wheelinstaller does not use the archive when installing sdist HOT 2
- //external:pypi: no such attribute 'requirements' in 'pip_repository' rule
- Support a default hub repo concept in bzlmod HOT 5
- gazelle_python.yaml will always be generated whether integrity matches or not.
- Allow `pip_compile` to accept a set of constraint files HOT 1
- Silence download 404 errors when using bazel downloader (`experimental_index_url` and `experimental_extra_index_urls`) HOT 2
- ciruclar dep with markdown-it-py[linkify, plugins]==3.0.0 HOT 1
- Exec py_test targets in a way that would work with --run_under=lldb HOT 7
- Bazel@Head fails because bzlmod example test relies on tilde in repo names HOT 4
- Gazelle incorrectly ignores files called `setup.py`. HOT 5
- Unable to use whl dependency which is compiled from source due (arch not provided in pypi)
- Missing `@@_builtins` providers when using pinned toolchains HOT 2
- bzlmod example fails to build on pip install error when building whls from sdists HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_python.