Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

carlo-aromando
Copy link

This PR adds support for new lock format 2.0.

Fixes issue #22

@carlo-aromando carlo-aromando changed the title Support for Poetry 1.3 lock format Support for Poetry lock format 2.0 Jan 26, 2023
@bbstilson
Copy link

Any chance we could get this merged? It's blocking adoption 🙂

@Vertexwahn
Copy link

@NathanHowell Can you please merge this PR - I also need it!

@davidjlongo
Copy link

I'd love to see this merged!

@Vertexwahn
Copy link

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?

@ibolit
Copy link

ibolit commented Apr 11, 2023

@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")]
Copy link

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

@AndrewGuenther
Copy link
Collaborator

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

@ibolit
@Vertexwahn
@davidjlongo
@bbstilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants