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

Tarball URL erased when compiled #1518

Open
AstraLuma opened this issue Oct 27, 2021 · 8 comments
Open

Tarball URL erased when compiled #1518

AstraLuma opened this issue Oct 27, 2021 · 8 comments
Labels
resolver Related to dependency resolver writer Related to results output writer component

Comments

@AstraLuma
Copy link

AstraLuma commented Oct 27, 2021

# requirements.in
#dramatiq[rabbitmq,watch]~=1.11
https://github.com/AstraLuma/dramatiq/archive/refs/heads/injectables.tar.gz#egg=dramatiq[rabbitmq,watch]
flask-melodramatiq

becomes a few different wrong things.

(This is a modified fork because I've been waiting for the PR to be reviewed for several months.)

Environment Versions

  1. OS Type: Mac
  2. Python version: 3.9.7
  3. pip version: None (installed with pipx, not using pip-sync)
  4. pip-tools version: 6.4.0

Steps to replicate

  1. Use the above requirements.in snippet
  2. Compile

Expected result

Both extras and URL are preserved.

Actual result

One or the other has been dropped.

@AstraLuma
Copy link
Author

AstraLuma commented Oct 27, 2021

Ok, I'm seeing inconsistent behavior.

In my full actual requirements file, it's dropping the URL.

But then copying it to a test file, I got it to drop the extras.

@AstraLuma
Copy link
Author

AstraLuma commented Oct 27, 2021

So what I can easily replicate in tests is dropping the extras:

#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
#
#    pip-compile test.in
#
--index-url https://pypi-cache.corp/path/to/repo/

click==7.1.2
    # via flask
dramatiq @ https://github.com/AstraLuma/dramatiq/archive/refs/heads/injectables.tar.gz
    # via
    #   -r test.in
    #   flask-melodramatiq
flask==1.1.4
    # via flask-melodramatiq
flask-melodramatiq==0.3.9
    # via -r test.in
itsdangerous==1.1.0
    # via flask
jinja2==2.11.3
    # via flask
markupsafe==2.0.1
    # via jinja2
werkzeug==1.0.1
    # via flask

But what I'm struggling to replicate is the original behavior where it drops the URL and keeps the extras.

@richafrank
Copy link
Contributor

Hi @AstraLuma ,

I think #1519 fixes this, but would you check too?

@AstraLuma
Copy link
Author

@richafrank, no, it still drops the extras (like in the first comment).

It stopped dropping the URL when I reduced the dependencies (legacy project I'm doing some clean up on).

@AstraLuma
Copy link
Author

I have some hints:

  • The tarball had a lower version number than the pip package
  • I removed one of dramatiq's dependencies from the top-level dependency list.

@richafrank
Copy link
Contributor

richafrank commented Oct 29, 2021

Let me know if you disagree, but I think there are a two separate things going on here:

#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
#    pip-compile
#
click==8.0.3
    # via flask
dramatiq @ https://github.com/AstraLuma/dramatiq/archive/refs/heads/injectables.tar.gz
    # via
    #   -r requirements.in
    #   flask-melodramatiq
flask==2.0.2
    # via flask-melodramatiq
flask-melodramatiq==0.3.9
    # via -r requirements.in
gevent==21.8.0
    # via watchdog-gevent
greenlet==1.1.2
    # via gevent
itsdangerous==2.0.1
    # via flask
jinja2==3.0.2
    # via flask
markupsafe==2.0.1
    # via jinja2
pika==1.2.0
    # via dramatiq
prometheus-client==0.12.0
    # via dramatiq
watchdog==2.1.6
    # via
    #   dramatiq
    #   watchdog-gevent
watchdog-gevent==0.1.1
    # via dramatiq
werkzeug==2.0.2
    # via flask
zope.event==4.5.0
    # via gevent
zope.interface==5.4.0
    # via gevent

# The following packages are considered to be unsafe in a requirements file:
# setuptools

Notice that pika et al are here, even though the extras are not mentioned in the dramatiq requirement. Only the output formatting is missing the extras.

Regarding the URL requirement's formatting, it looks like the grammar in https://www.python.org/dev/peps/pep-0508/ supports extras, if we want to add them. The test in https://github.com/jazzband/pip-tools/pull/1453/files#r671595549 fails with that change, so we should decide what behavior is preferred. @atugushev ?

#1520 changes the behavior and the test, if we want it.

@AstraLuma
Copy link
Author

Yeah, those seem to be the reproducible issues.

I should probably start from the un-reduced requirements.in file and see where it stopped doing the "drop the url" thing.

@atugushev
Copy link
Member

atugushev commented Apr 6, 2022

References with #1608 and #1613.

@atugushev atugushev added resolver Related to dependency resolver writer Related to results output writer component labels Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolver Related to dependency resolver writer Related to results output writer component
Projects
None yet
Development

No branches or pull requests

3 participants