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

Poetry SolverProblemError #1148

Closed
rvanruitenbeek opened this issue Feb 14, 2022 · 3 comments · Fixed by cjolowicz/cookiecutter-hypermodern-python-instance#832
Closed

Poetry SolverProblemError #1148

rvanruitenbeek opened this issue Feb 14, 2022 · 3 comments · Fixed by cjolowicz/cookiecutter-hypermodern-python-instance#832

Comments

@rvanruitenbeek
Copy link

First of all, thanks for writing this amazing template!

I tried to use the template for the creation of a new Python 3.8.5 project.

Steps I have taken to create the project:

  1. cookiecutter cookiecutter-hypoermodern-python
  2. poetry lock

The resulting output I received is:

[SolverProblemError]
The current project's Python requirement (>=3.7) is not compatible with some of the required packages Python requirement:
  - isort requires Python >=3.6.1,<4.0

Because isort (5.10.1) requires Python >=3.6.1,<4.0
 and no versions of isort match >5.10.1, isort is forbidden.
So, because some-sample depends on isort (>=5.10.1), version solving failed.

Things I tried so far:

  • Removing the isort package from the toml --> shifts the problem to other packages
  • Removing the lock file before creating the template
@eyllanesc
Copy link
Contributor

@cjolowicz

I think the solution is to change:

to python = ">=3.7,<4.0" since this template only checks for python3 and python4 doesn't exist yet.

nilsdebruin added a commit to nilsdebruin/cookiecutter-hypermodern-python-1 that referenced this issue Feb 15, 2022
@cjolowicz
Copy link
Owner

Hi,

The upper bound on the Python constraint was removed intentionally. See the rationale linked from here: cjolowicz/cookiecutter-hypermodern-python-instance#743

It is possible to add dependencies that cap the Python version by adding an environment marker on the requirement. In Poetry this is done using the --python option of the add subcommand. See here for an example:
cjolowicz/cookiecutter-hypermodern-python-instance#815

@eyllanesc
Copy link
Contributor

@cjolowicz I understand what you indicate. I have created #1152 to solve that problem.

On the other hand, the tool that imports the changes from https://github.com/cjolowicz/cookiecutter-hypermodern-python-instance to this repository has some problems since it is modifying files that it should not modify, so I recommend creating a blacklist that copies but does not deduce templates. In the case of poetry.lock I observe:

typing-extensions = {version = ">=3.1{{cookiecutter.version}}", markers = "python_version < \"3.10\""}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment