ali5h / rules_pip

pip package rules for bazel that are fast (incremental fetch), support different python versions and work with all kinds of packages (i.e. packages with namespaces)
MIT License
60 stars 24 forks source link

always use dash in pkg name #31

Closed ali5h closed 4 years ago

ali5h commented 4 years ago

fore example, poetry does not seem to use dash in the final setup.py


This change is Reviewable

aaliddell commented 4 years ago

This appears to have broken packages that legitimately use an underscore in their published name, such as prometheus_client:

Could not find pip-provided dependency: 'prometheus-client'
ali5h commented 4 years ago

i added prometheus_client to list of tested packages, tests are passing. how are you generating the requirements.txt? do you have a sample repository?

aaliddell commented 4 years ago

Ok, figured it out, this was related to a change in behaviour from v2 to v3: In v2.x.x, a requirement of 'prometheus_client' in requirements.txt would get converted to 'prometheus-client' internally. This meant you had to use requirement('prometheus-client') in your BUILD files. After updating to v3.0.0, these existing requirements in the BUILD files were then incorrect, as the name is no longer getting altered. After updating these lines to requirement('prometheus_client') they now behave correctly.

So the new behaviour is correct, just might require updates to existing BUILD files that relied on the old behaviour :+1: