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

Files included relatively in requirements.in file gets converted to absolute paths #2131

Open
rosen-dash opened this issue Oct 28, 2024 · 5 comments

Comments

@rosen-dash
Copy link

Originally reported here - pypa/pip#13055

Environment Versions

  1. OS Type: MacOS 15.0.1, Ubuntu 24.04
  2. Python version: $ python -V Python 3.9.6
  3. pip version: $ pip --version pip 24.3.1
  4. pip-tools version: $ pip-compile --version 7.4.1

Steps to replicate

Sample repo in referred issue.

With pip 24.2

backoff==2.2.1
    # via -r requirements.in

With pip 24.3.1

backoff==2.2.1
    # via -r /Users/rosen/Personal/sample/requirements.in

Expected result

The relative references should be preserved

Actual result

Relative paths get replaced with absolute paths

@jmac105
Copy link

jmac105 commented Oct 29, 2024

Same happens if specifying a constraint file inside requirements.in, such as -c requirements.txt. However if the constraint file is set via command-line argument instead, like pip-compile -c requirements.txt then the annotation uses the relative path instead.

Can replicate with pip 24.3 too, suspect this is a consequence of this change? https://github.com/pypa/pip/pull/12877/files#diff-e9f0a8e3da86978e2042a5a8073078ae9e37ee041dbc943c066e0c622c52d0d4

rebkwok added a commit to opensafely-core/ehrql that referenced this issue Oct 29, 2024
If the --constraints path is included in a requirements.*.in file,
the absolute path is shown in the comments in the requirements.*.txt
output. This appears to be related to a pip upgrade. Specifying the
--constraints path as a command line arg instead results in the
expected relative paths.

We can likely change back when this issue is addressed:
jazzband/pip-tools#2131
gotmax23 added a commit to gotmax23/ansible-documentation that referenced this issue Oct 29, 2024
@waqas-saeed
Copy link

waqas-saeed commented Oct 29, 2024

like @jmac105 said I can confirm this is caused by pip 24.3.1. if I use a bit older pip version like 23.0.1 then pip-compile shows relative path.

felixfontein pushed a commit to ansible/ansible-documentation that referenced this issue Oct 29, 2024
patchback bot pushed a commit to ansible/ansible-documentation that referenced this issue Oct 29, 2024
patchback bot pushed a commit to ansible/ansible-documentation that referenced this issue Oct 29, 2024
patchback bot pushed a commit to ansible/ansible-documentation that referenced this issue Oct 29, 2024
felixfontein pushed a commit to ansible/ansible-documentation that referenced this issue Oct 29, 2024
Relates: #1950 (comment)
Relates: jazzband/pip-tools#2131
(cherry picked from commit ef750f6)

Co-authored-by: Maxwell G <maxwell@gtmx.me>
felixfontein pushed a commit to ansible/ansible-documentation that referenced this issue Oct 29, 2024
Relates: #1950 (comment)
Relates: jazzband/pip-tools#2131
(cherry picked from commit ef750f6)

Co-authored-by: Maxwell G <maxwell@gtmx.me>
samccann pushed a commit to ansible/ansible-documentation that referenced this issue Oct 29, 2024
Relates: #1950 (comment)
Relates: jazzband/pip-tools#2131
(cherry picked from commit ef750f6)

Co-authored-by: Maxwell G <maxwell@gtmx.me>
@AndydeCleyre
Copy link
Contributor

FWIW this is not an issue in my feature/relpaths-post-6.8.0 branch, but there are no plans to integrate those changes here.

@AndydeCleyre
Copy link
Contributor

Alternatively, it's not a problem with uv pip compile, either.

said-moj added a commit to ministryofjustice/laa-civil-case-api that referenced this issue Oct 31, 2024
This is due to a bug re-introduced into pip in the last release

jazzband/pip-tools#2131
said-moj added a commit to ministryofjustice/laa-civil-case-api that referenced this issue Oct 31, 2024
This is due to a bug re-introduced into pip in the last release

jazzband/pip-tools#2131
said-moj added a commit to ministryofjustice/laa-civil-case-api that referenced this issue Nov 1, 2024
This is due to a bug re-introduced into pip in the last release

jazzband/pip-tools#2131
said-moj added a commit to ministryofjustice/laa-civil-case-api that referenced this issue Nov 1, 2024
This is due to a bug re-introduced into pip in the last release

jazzband/pip-tools#2131
said-moj added a commit to ministryofjustice/laa-civil-case-api that referenced this issue Nov 1, 2024
This is due to a bug re-introduced into pip in the last release

jazzband/pip-tools#2131
patchback bot pushed a commit to ansible/ansible-documentation that referenced this issue Nov 6, 2024
gotmax23 added a commit to ansible/ansible-documentation that referenced this issue Nov 6, 2024
Relates: #1950 (comment)
Relates: jazzband/pip-tools#2131
(cherry picked from commit ef750f6)

Co-authored-by: Maxwell G <maxwell@gtmx.me>
This was referenced Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants