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

v2.0.0: poetry check --lock has nonzero exit status when only warnings occurred #10009

Closed
thijsmie opened this issue Jan 10, 2025 · 1 comment
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@thijsmie
Copy link

Description

The behaviour of poetry check --lock with only warnings about deprecated metadata is unexpected: the command still exits with a 1 instead of 0. I expected a 1 only when there are errors.

Workarounds

Instead of checking the exit status I now scan the poetry check output for lines starting with Error:.

Poetry Installation Method

pip

Operating System

WSL

Poetry Version

2.0.0

Poetry Configuration

cache-dir = "/home/user/.cache/pypoetry"
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
installer.parallel = true
installer.re-resolve = true
keyring.enabled = true
requests.max-retries = 0
solver.lazy-wheel = true
system-git-client = false
virtualenvs.create = true
virtualenvs.in-project = true
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /home/user/.cache/pypoetry/virtualenvs
virtualenvs.prompt = "{project_name}-py{python_version}"
virtualenvs.use-poetry-python = false

Python Sysconfig

No response

Example pyproject.toml

No response

Poetry Runtime Logs

poetry-runtime.log
$ poetry check --lock
Warning: [tool.poetry.name] is deprecated. Use [project.name] instead.
Warning: [tool.poetry.version] is set but 'version' is not in [project.dynamic]. If it is static use [project.version]. If it is dynamic, add 'version' to [project.dynamic].
If you want to set the version dynamically via `poetry build --local-version` or you are using a plugin, which sets the version dynamically, you should define the version in [tool.poetry] and add 'version' to [project.dynamic].
Warning: [tool.poetry.description] is deprecated. Use [project.description] instead.
Warning: [tool.poetry.license] is deprecated. Use [project.license] instead.
Warning: [tool.poetry.authors] is deprecated. Use [project.authors] instead.
$ echo $?
1
@thijsmie thijsmie added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jan 10, 2025
@finswimmer
Copy link
Member

Duplicate of #9971

Fixed by #9983

@finswimmer finswimmer closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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

2 participants