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

Straighten out Poetry dependency chaos #235

Closed
maresb opened this issue Sep 3, 2022 · 11 comments · Fixed by #240
Closed

Straighten out Poetry dependency chaos #235

maresb opened this issue Sep 3, 2022 · 11 comments · Fixed by #240

Comments

@maresb
Copy link
Contributor

maresb commented Sep 3, 2022

I wonder if we need to depend on Poetry as a required dependency, since it shouldn't be necessary unless there's a pip: [...] section, right?

Poetry finally released a "stable" v1.2 a few days ago, but unfortunately not all is well. There are two blockers which currently make a conda-forge release impossible: 1. it contains a circular dependency with poetry-plugin-export which makes conda balk, and 2. there is no stable release of its dependency cleo v1.0.

In terms of testing, it's possible to install Poetry v1.2 / Cleo from conda-forge via dev labels.

In the meantime I've gotten fed up with Poetry, and discovered Hatch, which I like much better. (But it seems we are only using Poetry for its PyPI dependency solver, which Hatch doesn't have.) Currently I can't simultaneously install Poetry 1.1 and Hatch since they have incompatible pins for the packaging dependency, and this means that I cannot simultaneously use recent versions of conda-lock with Hatch. 😞

So I have two questions:

  1. Can we turn Poetry into an optional dependency?
  2. How much must be changed here in conda-lock in order to accommodate Poetry v1.2?
@maresb
Copy link
Contributor Author

maresb commented Sep 7, 2022

I was thinking that a good solution may be to cut out and vendor just the solver portion of Poetry which is needed by conda-lock. That would hopefully make things much more lightweight.

@mariusvniekerk
Copy link
Collaborator

The other approach would be to make another pip resolver using the one from pip-tools (invocation here https://github.com/jazzband/pip-tools/blob/master/piptools/scripts/compile.py#L488-L499)

@maresb
Copy link
Contributor Author

maresb commented Sep 9, 2022

Thanks for the tip!

I have not yet in the slightest understood these abstractions. I'll have a look and try to understand what's involved.

@mariusvniekerk
Copy link
Collaborator

mariusvniekerk commented Sep 9, 2022

  • Can we turn Poetry into an optional dependency?

It already IS an optional dependency. https://github.com/conda-incubator/conda-lock/blob/main/setup.cfg#L54-L55

@maresb
Copy link
Contributor Author

maresb commented Sep 9, 2022

@mariusvniekerk
Copy link
Collaborator

mariusvniekerk commented Sep 9, 2022

If you want to rework the setup stuff to use hatch + build that would be fantastic and probably a good first step towards ensuring that we can straighten out things

@maresb
Copy link
Contributor Author

maresb commented Sep 9, 2022

Yes, great idea! How do you feel about tiangolo's Typer for CLI? (It's like Click the style of FastAPI with runtime type checking and Pydantic.)

@mariusvniekerk
Copy link
Collaborator

mariusvniekerk commented Sep 9, 2022

Given that we already depend on both click and pydantic, all for that. Just not entirely sure if the default subcommand hack that we are using to avoid needing to type

conda-lock lock

works with it.

@maresb
Copy link
Contributor Author

maresb commented Sep 9, 2022

I feel like I successfully set up a default subcommand in Typer sometime in the past. But I'll verify that before I sink too much time. Thanks!

@maresb
Copy link
Contributor Author

maresb commented Sep 9, 2022

I've been really annoyed lately when I get some unexpected result and type conda-lock --version and get an unrecognized command error. 😄

@maresb
Copy link
Contributor Author

maresb commented Sep 15, 2022

Perhaps this deserves its own issue, but Poetry 1.1 depends on clikit which we left as an implicit dependency even though we use it explicitly. But now that Poetry 1.2 has been released, clikit is no longer a dependency of Poetry, so it causes a missing import.

The clikit dependency is added as part of #239

This was referenced Sep 15, 2022
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 a pull request may close this issue.

2 participants