Skip to content

ParseConstraintError: Could not parse version constraint: ~3.4.* #3619

@tueda

Description

@tueda
  • 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: Ubuntu 18.04.5 LTS (on WSL2 5.4.72)
  • Poetry version: 1.1.4 (from Linuxbrew)
  • Link of a Gist with the contents of your pyproject.toml file: see below.

Issue

poetry lock fails for the following pyproject.toml.

[tool.poetry]
name = "qleedback"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]

[tool.poetry.dependencies]
python = "^3.2"
importlib-metadata = [
   { version = "^0.23", python = "~3.4" },
]

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Updating dependencies
Resolving dependencies... (0.1s)

  ParseConstraintError

  Could not parse version constraint: ~3.4.*

  at /home/linuxbrew/.linuxbrew/Cellar/poetry/1.1.4/libexec/vendor/lib/python3.9/site-packages/poetry/core/semver/__init__.py:163 in parse_single_constraint
      159│             return VersionUnion(VersionRange(max=version), VersionRange(min=version))
      160│         else:
      161│             return version
      162│
    → 163│     raise ParseConstraintError(
      164│         "Could not parse version constraint: {}".format(constraint)
      165│     )
      166│

The full output of poetry lock -vvv is here.

This looks like #2645, which has already been fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/duplicateDuplicate issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions