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

Add an option to not include paths in annotations #1084

Closed
IRDonch opened this issue Mar 4, 2020 · 4 comments
Closed

Add an option to not include paths in annotations #1084

IRDonch opened this issue Mar 4, 2020 · 4 comments
Labels
annotations Related to packages annotations feature Request for a new feature

Comments

@IRDonch
Copy link

IRDonch commented Mar 4, 2020

What's the problem this feature will solve?

My workflow involves using pip-compile on a requirements file from a software package installed on the local computer. This means that the output file includes annotations like via -r /opt/foobar/requirements.txt. However:

  • different developers may have this requirements file installed in different locations;
  • the location of the file may change between versions of the software.

As a result of this, different people (or the same person at different times) may get different annotations in pip-compile's output, resulting in unnecessary diffs.

Describe the solution you'd like

An option like --no-paths-in-annotations that would replace the annotation with something like via -r [...]. Alternatively, pip-compile could automatically do it for any requirements file paths that are absolute.

Alternative Solutions

--no-annotations solves this, but it also removes annotations about package dependencies, which are nice to have.

@atugushev atugushev added the feature Request for a new feature label Mar 6, 2020
@AndydeCleyre
Copy link
Contributor

To be clear, you want the req-file's basename included in these annotations?

@IRDonch
Copy link
Author

IRDonch commented Mar 12, 2020

I don't really care about the basename either, although I wouldn't mind if it was included.

@atugushev atugushev added the annotations Related to packages annotations label Apr 21, 2020
@kshpytsya
Copy link

As a workaround for this I just have a wrapper script do a cd to the directory containing the requirements.in.

<repo>/scripts/make-requirements-txt

#!/bin/bash

REPO_DIR="$(realpath "$(dirname "$0")/..")"
cd "$REPO_DIR" || exit 1

CUSTOM_COMPILE_COMMAND="scripts/make-requirements-txt" \
    pip-compile \
    "requirements.in" \
    -v \
    --generate-hashes \
    "$@"

@IRDonch
Copy link
Author

IRDonch commented Jul 20, 2021

I think I'm going to cancel this request, because it's a very specific use case, and in the end I worked around it by just removing the paths from the resulting requirements.txt file by post-processing.

Instead, I'm giving my vote to #1377, which is a lot more general and, if implemented, would help resolve this issue as well.

@IRDonch IRDonch closed this as completed Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
annotations Related to packages annotations feature Request for a new feature
Projects
None yet
Development

No branches or pull requests

4 participants