Skip to content

pip-compile annotations should be relative to file they are in #1107

@chaoflow

Description

@chaoflow

When pip-compile adds annotations for packages from files included with -r it uses a path relative to the current directory pip-compile is called from, instead of relative to the file it is writing to.

It should be -r base.in not -r requirements/base.in (see below).

This might be solved by #1067.

Environment Versions

  1. Linux
  2. Python version: 3.7.6
  3. pip version: 20.0.2
  4. pip-tools version: 4.5.1

Steps to replicate

requirements/base.in:

ujson

requirements/extra.in:

-r base.in
  1. pip-compile --annotate --no-header --generate-hashes requirements/extra.in

Expected result

extra.txt:

ujson==1.35 \
    --hash=sha256:f66073e5506e91d204ab0c614a148d5aa938bdbf104751be66f8ad7a222f5f86 \
    # via -r base.in

Actual result

extra.txt:

ujson==1.35 \
    --hash=sha256:f66073e5506e91d204ab0c614a148d5aa938bdbf104751be66f8ad7a222f5f86 \
    # via -r requirements/base.in

Metadata

Metadata

Assignees

No one assigned

    Labels

    annotationsRelated to packages annotationsenhancementImprovements to functionalityfeatureRequest for a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions