-
Notifications
You must be signed in to change notification settings - Fork 22
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
Support for Poetry lock format 2.0 #23
base: master
Are you sure you want to change the base?
Conversation
Any chance we could get this merged? It's blocking adoption 🙂 |
@NathanHowell Can you please merge this PR - I also need it! |
I'd love to see this merged! |
I am not sure if the company Sonia still exists, and therefore we see no support here anymore. Should we clone the repo and move it to https://github.com/bazel-contrib and continue development there? |
@Vertexwahn Please, do. Our adoption of Bazel is blocked by this request as well |
@@ -105,7 +105,14 @@ def _impl(repository_ctx): | |||
|
|||
lockfile = json.decode(result.stdout) | |||
metadata = lockfile["metadata"] | |||
if "files" in metadata: # Poetry 1.x format | |||
package_files = [{"name": package["name"], "files": package["files"]} for package in lockfile["package"] if package.get("files")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would go for explicit version checking:
if metadata["lock-version"] in ["2.0"]:
etc. as far back as they had the lock-version
item in metadata
If anyone is interested, I dropped this package and made my own Bazel Poetry module which takes advantage of some of the more recent rules_python advancements to significantly simplify the implementation: https://github.com/AndrewGuenther/rules_python_poetry |
This PR adds support for new lock format 2.0.
Fixes issue #22