Giter VIP home page Giter VIP logo

Comments (3)

dillon-giacoppo avatar dillon-giacoppo commented on July 23, 2024

There are a few things happening here. The first is that the bazel label should be specified without the extras. In your case it would be:

deps = [requirement("apache_beam")] ## equivalent to deps = ["pypi__apache_beam"]

There is, however, an underlying bug. We pass the requirements.txt file directly into pip wheel and then create BUILD files for all the output *.whl. This approach is convenient as wheels have an easy to parse metadata format.

Unfortunately, we cannot determine the extras a user has requested without parsing the requirements.txt file directly. There are a lot of edge cases when parsing this file which makes it quite difficult and I was unable to find a good library.

The end result is we install the right dependencies, but we don't specify them transitively.

A solution to this is that we do naive parsing of the file and try a best-effort approach. A more comprehensive idea is to do a custom metadata format that makes the information easy to fetch. This is what is suggested by #15.

A workaround that will get it up and running right now is to use all_requirements:

load("@pip//:requirements.bzl", "all_requirements")

py_binary(
   name = "main",
   srcs = ["main.py"],
   deps = all_requirements +  [
       # Other deps here
   ],
)

This lists everything specified in the requirements.txt as a dependency.

from rules_python_external.

thundergolfer avatar thundergolfer commented on July 23, 2024

@dillon-giacoppo has this been fixed by #28?

from rules_python_external.

dillon-giacoppo avatar dillon-giacoppo commented on July 23, 2024

Yep, just cut the release for it. Fixed in v0.1.4

from rules_python_external.

Related Issues (17)

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.