question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

install_with_constraints fails with the new poetry 1.1.0

See original GitHub issue

First of all big thanks for an excellent example for Python project tooling!

Have you also noticed this problem with latest poetry update? poetry 1.1.0 nox 2020.8.22

❯ nox -rs black
nox > Running session black
nox > Re-using existing virtual environment at .nox/black.
nox > poetry export --dev --format=requirements.txt --output=/var/folders/qj/sjb9y3s56sj1s60cwhmhln3cy765d7/T/tmp57tr87b4

  IndexError

  list index out of range

  at ~/.pyenv/versions/3.8.1/lib/python3.8/site-packages/poetry/utils/exporter.py:76 in _export_requirements_txt
       72│             if not dev
       73│             else self._poetry.package.all_requires,
       74│             with_nested=True,
       75│         ):
    →  76│             package = repository.find_packages(dependency=dependency)[0]
       77│
       78│             # If a package is optional and we haven't opted in to it, continue
       79│             if package.optional and package.name not in extra_package_names:
       80│                 continue
nox > Command poetry export --dev --format=requirements.txt --output=/var/folders/qj/sjb9y3s56sj1s60cwhmhln3cy765d7/T/tmp57tr87b4 failed with exit code 1
nox > Session black failed.

It works fine if downgrading poetry to 1.0.5. Strangely running below command directly i.e. not in nox session works with poetry 1.1.0.

❯ poetry export --dev --format=requirements.txt --output=/var/folders/qj/sjb9y3s56sj1s60cwhmhln3cy765d7/T/tmp57tr87b4

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
villekrcommented, Oct 3, 2020

https://github.com/python-poetry/poetry/issues/3063. Not an issue with this repository code. Just to be aware of this if following atm.

0reactions
darth-veitchercommented, Nov 5, 2022

I think this is still a problem. See https://github.com/python-poetry/poetry-plugin-export/issues/126

When you have dependencies such as pylama[lint] or coverage[toml] it will fail with the following error message:

DEPRECATION: Constraints are only allowed to take the form of a package name and a version specifier. Other forms were originally permitted as an accident of the implementation, but were undocumented. The new implementation of the resolver no longer supports these forms. A possible replacement is replacing the constraint with a requirement. Discussion can be found at https://github.com/pypa/pip/issues/8210 ERROR: Constraints cannot have extras

Read more comments on GitHub >

github_iconTop Results From Across the Web

Export fails after upgrading poetry to version 1.1.0 · Issue #3023
I am on the latest Poetry version. I have searched the issues of this repo and believe that this is not a duplicate....
Read more >
Announcing Poetry 1.1.0 | Blog
This release brings a lot of new features and improvements. If you have a previous version of Poetry installed via the official installer, ......
Read more >
poetry-core - PyPI
Prior to the release of version 1.1.0 , Poetry was a project management tool that included a PEP 517 build backend. This was...
Read more >
poetry can't find version of dependency even though it exists
According to finswimmer, the upgrade should create a new virtual env for the new python version, however this process can fail when poetry...
Read more >
Why you should use Poetry instead of Pip or Conda for Python ...
This file is also updated automatically whenever we run poetry add to install new dependencies, poetry update to update dependency versions, or ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found