Skip to content

Pipfile shorthand markers: operator-less values become invalid marker text and extra is treated as a shorthand key #817

Description

@rowkav09

Follow-up to #815 (fixed in #816).

  1. The shorthand key list includes extra. pipenv's PipenvMarkers has 11 keys and no extra, so extra = "== 'x'" should be ignored.
  2. A shorthand value with no operator, for example python_version = "3.10", is emitted as the marker text python_version 3.10, which is not valid marker syntax. pipenv builds <key> <value>, and when the combined marker does not parse it drops the whole marker, so the requirement stays unconditional.

Source: https://github.com/pypa/pipenv/blob/c1739c9b/pipenv/utils/markers.py (PipenvMarkers.from_pipfile).

Fix: drop extra from the list and skip the marker when a shorthand value has no operator. One regression covers both.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions