-
Notifications
You must be signed in to change notification settings - Fork 554
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
pip_import support for Piplock files #171
Comments
The best approach seems to be just doing We do basically this @ Canva |
Yea this seems like the only solution at the moment. I was wondering if piplock files can be officially supported so we can lose this extra step. |
It's possible that The missing key feature is transitive dependency resolving. If Supporting |
I've actually written a program that takes a declarative dependency graph, uses poetry to resolve the transitive compatible dependency versions, and then write out bazel targets which include the sha256 & https location of the wheels. It also binary compatibility mapping, for system & architecture matching. I'm not sure how to write the bazel rules that could consume this, but I'd be happy to collaborate. I think that we could end up with a solution like http://github.com/johnynek/bazel-deps, which is very pleasant. |
I also like Is yours open-sourced anywhere? |
It’s unfortunately not complete, because I didn’t have time to figure out what to do with the downloaded wheels to incorporate them into rules. I would be glad to share that code to combine it with the additional rules needed to make it a usable solution |
I'm in need of exactly this type of tool, and am in the planning stages of writing it myself as OSS. I'd be extremely happy to collaborate if you'd like to use your codebase as a starting point. |
@jondo2010 I am working on getting this together to share :) |
At our company we are using https://github.com/dillon-giacoppo/rules_python_external which can do the transitive dependency resolving. I'm not too familiar with it's locking behaviour. |
https://github.com/dillon-giacoppo/rules_python_external doesn't do anything special with locking. It uses pip to automatically download all the requirements and then parses the wheel metadata to recalculate dependencies. To lock the dependencies, you would need to make requirements.txt a transitive closure. A custom resolver was the only piece missing for allowing very efficient pinning like in rules_jvm_external. If @dgrnbrg has a resolver we could potentially add a lock solution like https://github.com/bazelbuild/rules_jvm_external#pinning-artifacts-and-integration-with-bazels-downloader. It has a lock file format like this:
This would also allow us to throw everything directly into the Bazel HTTP cache. |
Ah yep. We're doing |
I'll close this as wonfix. Given the state of the Pipenv project and a developing opinion that these Bazel rules shouldn't support consuming the lock files of alternative packaging system but instead focus on developing and maintaining it's own description of a locked transitive dependency list, the requested functionality is not worth adding. |
Is it possible to maintain a Piplock file and import it using pip_import instead of having to maintain a requirements.txt?
If the above is not currently possible, what would you say the best approach is for tackling this issue?
The text was updated successfully, but these errors were encountered: