repo2docker icon indicating copy to clipboard operation
repo2docker copied to clipboard

Add Poetry buildpack

Open RobertRosca opened this issue 5 years ago • 4 comments

As suggested in the issue #835 this PR adds in a poetry buildpack.

This is heavily based on the implementation of the Pipenv buildpack, since they're pretty similar anyway. I've also implemented equivalent tests to what is done for pipenv.

The only large issue with this PR is how the python versioning is worked out in the buildpack. Poetry lets you specify dependency constraints using a variety of symbols (e.g. ^, *, ~), and it's likely that python was specified with these requirements.

To handle these constraints poetry-core has a semver module which is what I use to parse the versions constraints, however this means that poetry-core would then be a dependency requirement for repo2docker. I really don't like adding this dependency in, but the alternative is to either re-implement this constraint system, include a copy of the poetry.core.semver module in the poetry buildpack, or to ignore the constraints and parse them naively. Does anybody have a better way to deal with this?

RobertRosca avatar Oct 16 '20 11:10 RobertRosca

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly. welcome You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Oct 16 '20 11:10 welcome[bot]

Hi @betatim, just poking you in case the PR fell a bit too far down the todo list :stuck_out_tongue: no rush though! Oh and Happy New Year!

RobertRosca avatar Jan 06 '21 10:01 RobertRosca

Rebased onto main since there were some conflicts

RobertRosca avatar Aug 13 '21 05:08 RobertRosca

it's likely that python was specified with these requirements.

Not just likely; specifying the Python version is mandatory. From here:

Be aware that declaring the python version for which your package is compatible is mandatory

kylebarron avatar Sep 16 '21 17:09 kylebarron