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

Dependency issues installing a third party example not based on poetry #7501

Closed
4 tasks done
kevinschaich opened this issue Feb 11, 2023 · 5 comments
Closed
4 tasks done
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@kevinschaich
Copy link

  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

I'm trying to follow a really simple example on the Flask docs and encountered multiple issues. After downloading, I navigated to the examples/celery folder and ran poetry install:

[tool.poetry] section not found in /Users/kevinschaich/repositories/flask/examples/celery/pyproject.toml

I searched around and couldn't find anyone else encountering this – it seems like Poetry should support projects using other tooling like pip/conda/mamba and "upgrade" those configs.

I gave up on trying to fix this and deleted the file since there were only two dependencies, and ran poetry init, then poetry add flask and poetry add celery[redis], and got this nonsensical error complaining about a circular dependency of celery itself:

poetry add 'celery[redis]'
Using version ^5.2.7 for celery

Updating dependencies
Resolving dependencies... (0.0s)

Because no versions of celery match >5.2.7,<6.0.0
 and celery (5.2.7) depends on celery (5.2.7), celery (>=5.2.7,<6.0.0) requires celery (5.2.7).
So, because celery depends on celery (^5.2.7)
 and celery is 0.1.0, version solving failed.```
@kevinschaich kevinschaich added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Feb 11, 2023
@kevinschaich
Copy link
Author

I tried also using just celery and redis independently with no success, this is the autogenerated pyproject.toml:

[tool.poetry]
name = "celery"
version = "0.1.0"
description = ""
authors = ["kevinschaich <schaich.kevin@gmail.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.11"
Flask = "^2.2.2"
celery = "^5.2.7"
redis = "^4.5.1"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

And when running poetry install:

poetry install
Updating dependencies
Resolving dependencies... (0.0s)

  AssertionError



  at ~/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/poetry/mixology/incompatibility.py:113 in __str__
      109│         )
      110│
      111│     def __str__(self) -> str:
      112│         if isinstance(self._cause, DependencyCause):
    → 113│             assert len(self._terms) == 2
      114│
      115│             depender = self._terms[0]
      116│             dependee = self._terms[1]
      117│             assert depender.is_positive()

@dimbleby
Copy link
Contributor

what poetry is trying to tell you is that you have created a project with name "celery" and version "0.1.0", and now you are trying to add to it a dependency on "celery" version "5.2.7".

Change the name of your project.

@kevinschaich
Copy link
Author

Thanks @dimbleby 🤦‍♂️

@MikeShi42
Copy link

Would love to see the assertion error be a bit more verbose on this issue - fwiw just ran into it myself for a new project but luckily this github issue existed :)

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

4 participants