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

Malformed "@" dependencies in project.dependencies get silently ignored #10068

Open
ludgerheide opened this issue Jan 17, 2025 · 0 comments · May be fixed by python-poetry/poetry-core#817
Open
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@ludgerheide
Copy link

Description

State where the problem happens

The pyproject.toml contains a project.depencies with a malformed urlspec dependency (in this case, a github repository).

What we wrote

…
dependencies = [
    "eflips-depot @ [email protected]:mpm-tu-berlin/eflips-depot.git@feature/allow-only-oppo-charging",
]
…

Expected behavior

poetry lock should refure to create a poetry.lock file and complain about the nonsensical URL

What actually happens

Poetry behaves as if not URL were specified at all, e. g. as if the dependency specification was just

…
dependencies = [
    "eflips-depot",
]
…

and grabs the latest version from PyPI.

While this is clearly a mistake of the user specifying the wrong dependency URL, I feel like it would be preferable to loudly complain about an unparseable URL in the dependencies, rather than just ignoring it.

Workarounds

If you just specify your depencies correctly in the first place, it doesn't happen

Poetry Installation Method

system package manager (eg: dnf, apt etc.)

Operating System

macOS Sonoma

Poetry Version

2.0.1

Poetry Configuration

cache-dir = "/Users/arbeit/Library/Caches/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 = true
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /Users/arbeit/Library/Caches/pypoetry/virtualenvs
virtualenvs.prompt = "{project_name}-py{python_version}"
virtualenvs.use-poetry-python = false

Python Sysconfig

See file

python-sysconfig.txt

Example pyproject.toml

[project]
name = "eflips-kyoto"
version = "0.1.0"
description = "Applying eFLIPS to a Kyoto dataset"
authors = [
    {name = "Ludger Heide",email = "[email protected]"}
]
license = {text = "AGPL-3.0-or-later"}
readme = "README.md"
requires-python = ">=3.12,<3.13"
dependencies = [
    "eflips-depot @ [email protected]:mpm-tu-berlin/eflips-depot.git@feature/allow-only-oppo-charging",
    "eflips-opt (>=0.1.5,<1.0.0)",
    "eflips-model (>=6.0.2,<7.0.0)",
    "eflips-eval (>=1.7.1,<2.0.0)",
]

[tool.poetry]
package-mode = false

[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.group.dev.dependencies]
black = "^24.10.0"

[tool.black]
line-length = 120

Poetry Runtime Logs

See file

poetry.log

@ludgerheide ludgerheide added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jan 17, 2025
abn added a commit to abn/poetry that referenced this issue Jan 17, 2025
We should not pass in front-end specific `@latest` descriptor to the
core requirement parser.

Relates-to: python-poetry#10068
abn added a commit to abn/poetry that referenced this issue Jan 17, 2025
We should not pass in front-end specific `@latest` descriptor to the
core requirement parser.

Relates-to: python-poetry#10068
abn added a commit to abn/poetry that referenced this issue Jan 17, 2025
We should not pass in front-end specific `@latest` descriptor to the
core requirement parser.

Relates-to: python-poetry#10068
abn added a commit to abn/poetry-core that referenced this issue Jan 17, 2025
Prior to this change, when parsing PEP 508 requirement strings,
the `Dependency` class silently discarded any URI tokens that cannot
be validated as existing files.

Resolves: python-poetry/poetry#10068
abn added a commit to abn/poetry-core that referenced this issue Jan 17, 2025
Prior to this change, when parsing PEP 508 requirement strings,
the `Dependency` class silently discarded any URI tokens that cannot
be validated as existing files.

Resolves: python-poetry/poetry#10068
abn added a commit to abn/poetry-core that referenced this issue Jan 17, 2025
Prior to this change, when parsing PEP 508 requirement strings,
the `Dependency` class silently discarded any URI tokens that cannot
be validated as existing files.

Resolves: python-poetry/poetry#10068
abn added a commit to abn/poetry-core that referenced this issue Jan 17, 2025
Prior to this change, when parsing PEP 508 requirement strings,
the `Dependency` class silently discarded any URI tokens that cannot
be validated as existing files.

Resolves: python-poetry/poetry#10068
abn added a commit to abn/poetry that referenced this issue Jan 18, 2025
We should not pass in front-end specific `@latest` descriptor to the
core requirement parser.

Relates-to: python-poetry#10068
abn added a commit that referenced this issue Jan 18, 2025
We should not pass in front-end specific `@latest` descriptor to the
core requirement parser.

Relates-to: #10068
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

Successfully merging a pull request may close this issue.

1 participant