Giter Club home page Giter Club logo

Comments (16)

duggelz avatar duggelz commented on August 25, 2024 6

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.

jkinkead avatar jkinkead commented on August 25, 2024 3

Also, I'd love to see @joshclimacell's patch in this repo.

from rules_python.

hwright avatar hwright commented on August 25, 2024

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.

duggelz avatar duggelz commented on August 25, 2024

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.

duggelz avatar duggelz commented on August 25, 2024

One workaround that immediately comes to mind is:

  1. Use ruamel instead of PyYaml, 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.

duggelz avatar duggelz commented on August 25, 2024

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.

hwright avatar hwright commented on August 25, 2024

@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.

hwright avatar hwright commented on August 25, 2024

@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.

hwright avatar hwright commented on August 25, 2024

@duggelz @mattmoor It looks like this might also be related to bazelbuild/bazel#3871 ?

from rules_python.

hwright avatar hwright commented on August 25, 2024

Ping. I'm still interested in helping get this fixed, but need a few pointers.

from rules_python.

joshclimacell avatar joshclimacell commented on August 25, 2024

Ping...

from rules_python.

joshclimacell avatar joshclimacell commented on August 25, 2024

For reference, I implemented a (not-super-awesome, but functioning) workaround for loading Python 3 PyPi packages: joshclimacell@90a70d5

from rules_python.

jkinkead avatar jkinkead commented on August 25, 2024

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.

jkinkead avatar jkinkead commented on August 25, 2024

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.

limdor avatar limdor commented on August 25, 2024

Any update on this?

from rules_python.

brandjon avatar brandjon commented on August 25, 2024

Using this as repro to merge (a rebase of) #85; work toward #249.

from rules_python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.