1

I am working on a project (let's call it X) which depends on another public package. Let's call it A. Package A has the following dependencies in the requirements.txt file

package-a>=6.1.0<7.0.0
package-b>=10.2.0<11.0.0
package-c>=1.0.4<2.0.0
package-d>=1.1.0<2.0.0

The pyproject.toml of package X is given below

[tool.poetry]
name = "X"
version = "1.0.0"
description = "Project X"
packages = [{include = "X"}]

[tool.poetry.dependencies]
python = "^3.8"
A = "1.0.0"
B = "12.0.0"

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

When I do a poetry lock, I see that the pacakges with both upper and lower bounds are being skipped

Updating dependencies
Resolving dependencies... (0.4s)
Invalid constraint (package-a (>=6.1.0<7.0.0)) found in A-1.0.0 dependencies, skipping
Invalid constraint (package-b (>=10.2.0<11.0.0)) found in A-1.0.0 dependencies, skipping
Invalid constraint (package-c (>=1.0.4<2.0.0)) found in A-1.0.0 dependencies, skipping
Invalid constraint (package-d (>=1.1.0<2.0.0)) found in A-1.0.0 dependencies, skipping
Resolving dependencies... (0.8s)

The same packages are missing in the poetry.lock file and hence NOT being installed when I do poetry install. Any pointers on how to solve this issue ? I couldn't find any information in https://python-poetry.org/docs/dependency-specification/

sinoroc
  • 18,409
  • 2
  • 39
  • 70
Mohan
  • 61
  • 8
  • 3
    Shouldn't there be a comma `,` somewhere in there? Something like `>=6.1.0,<7.0.0`) maybe? – sinoroc Oct 13 '22 at 08:45
  • As @sinoroc pointed out, it looks like the constraints in package A are not correctly defined. I looked at the requirements.txt of a couple of other public libraries and they seem to have a `,` in the constraints. – confused_certainties Oct 13 '22 at 08:59
  • @sinoroc: Please move your comment to an answer :) – finswimmer Oct 13 '22 at 10:06

1 Answers1

4

Seems to me like a comma , is missing to delimit the parts of the version specifiers of A's dependencies. For example it should read something like >=6.1.0,<7.0.0 (instead of >=6.1.0<7.0.0).

A version specifier consists of a series of version clauses, separated by commas.

-- PEP 440 – Version Identification and Dependency Specification

sinoroc
  • 18,409
  • 2
  • 39
  • 70