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 1.1 and forward compatibility with pyproject.toml using groups #4628

Closed
3 tasks done
pmav99 opened this issue Oct 12, 2021 · 2 comments
Closed
3 tasks done

poetry 1.1 and forward compatibility with pyproject.toml using groups #4628

pmav99 opened this issue Oct 12, 2021 · 2 comments
Labels
kind/bug Something isn't working as expected

Comments

@pmav99
Copy link
Contributor

pmav99 commented Oct 12, 2021

  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: linux

  • Poetry version: 1.2.0a2

Issue

A pyproject.toml that is using "groups" is not parse-able by poetry<1.2 and results in a traceback. Displaying a message explaining that you should update poetry will probably improve the UX.

Not really sure if I should open this here on the poetry-core repo.

Reproducer

using poetry >=1.2:

poetry init -n
poetry add --group dev pytest

using poetry < 1.2:

poetry install

results in:

  RuntimeError

  The Poetry configuration is invalid:
    - Additional properties are not allowed ('group' was unexpected)
  
  at ~/.local/pipx/venvs/poetry/lib/python3.9/site-packages/poetry/core/factory.py:43 in create_poetry
       39│             message = ""
       40│             for error in check_result["errors"]:
       41│                 message += "  - {}\n".format(error)
       42│ 
    →  43│             raise RuntimeError("The Poetry configuration is invalid:\n" + message)
       44│ 
       45│         # Load package
       46│         name = local_config["name"]
       47│         version = local_config["version"]
@pmav99 pmav99 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 12, 2021
@ElPiloto
Copy link

Just adding in some info on how I also hit this issue. From a google search, it's easy to land on the dependency groups doc. From there I editted my pyproject.toml file to try to use groups. This gave me an error which I eventually realized was due to poetry < 1.2. Obviously this came about because I was on docs/master instead of docs, but I think the dependency groups doc should also mention that it requires poetry >= 1.2

Copy link

github-actions bot commented Mar 1, 2024

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 Mar 1, 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
Projects
None yet
Development

No branches or pull requests

4 participants