question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrate legacy #egg= requirements to PEP 508 direct URL specifier

See original GitHub issue

Update by maintainer: See https://github.com/pypa/pip/issues/9429#issuecomment-756452705 for the plan to fix this.

Original issue report below:


Environment

  • pip version: pip 20.3.3
  • Python version: 3.7
  • OS: docker (python:3.7 image)

Description

Our Application uses a “requirements.txt” file that contains a reference to a public github repository-

git+ssh://git@github.com/radaisystems/awsscrubber.git

By itself this works fine.

We recently added another library to it-

git+ssh://git@github.com/radaisystems/awsscrubber.git
git+ssh://git@github.com/radaisystems/private.git

This library has a setup.py file in it that also references the “awsscrubber” library (truncated version)-

setup(
    install_requires = [
        'awsscrubber @ git+https://github.com/radaisystems/awsscrubber.git'
    ]
)

By itself both of these have no problem running. As of pip 2.3.3 (and possibly earlier) this results in an error-

Cannot install awsscrubber 0.0.1 (from git+ssh://****@github.com/radaisystems/awsscrubber.git#egg=awsscrubber) and threeproc because these package versions have conflicting dependencies.
ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

The conflict is caused by:
    The user requested awsscrubber 0.0.1 (from git+https://****@github.com/radaisystems/awsscrubber.git#egg=awsscrubber)
    amalthealib 0.1.0 depends on awsscrubber 0.0.1 (from git+https://github.com/radaisystems/awsscrubber.git)

Despite these both pointing at the same repository, and being recognized by pip as being part of the same project.

To resolve this I’ve tried a few things-

  1. Add “egg” query values to both repos.
  2. Made sure to use “https” or “git” in both places.

Expected behavior

I expect it to install the awsscrubber library.

How to Reproduce

Steps to reproduce are described above, as is the specific error.

Work Arounds

  • Downgrading pip to an older version resolved the problem without causing any conflicts.
  • Having pip use --use-deprecated=legacy-resolver also removed the problem, again without causing any conflicts.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (14 by maintainers)

github_iconTop GitHub Comments

3reactions
uranusjrcommented, Jan 7, 2021

Special handling of #egg= sounds to me like the most reasonable thing pip can do. The #egg= fragment has traditionally been treated as a special case by various tools (e.g. setuptools), so any reasonable existing source wouldn’t give it meanings that breaks these legacy tools. We can add appropriate deprecating warnings to signal people to drop it and/or switch to PEP 508 syntax.

  1. If a requirement’s does not contain an egg fragment, use it as it.
  2. If a requirement contains an egg fragment, and is not in PEP 508 format, convert it into PEP 508 with a warning.
  3. If a PEP 508 direct URL requirement’s URL part contains an egg fragment containing an identical package name, from the egg fragment with a warning.
  4. If a PEP 508 direct URL requirement’s URL part contains an egg fragment containing a different package name, fail with an error (requirement invalid).

Does this sound reasonable?

0reactions
uranusjrcommented, Jan 10, 2021

We actually came to the same conclusion in #1289. So I’ll use that to track instead since it contains a bit more cases to support the deprecation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PEP 508 – Dependency specification for Python Software ...
Version specifications limit the versions of a distribution that can be used. They only apply to distributions looked up by name, rather than...
Read more >
User Guide - pip documentation v22.3.1
pip supports installing from PyPI, version control, local projects, and directly from distribution files. The most common scenario is to install from PyPI...
Read more >
pipenv Documentation - Read the Docs
Generates and checks file hashes for locked dependencies when installing from Pipfile.lock. • Automatically install required Python version when pyenv is ...
Read more >
How to Publish an Open-Source Python Package to PyPI
PEP 508 describes how dependencies should be specified. ... Python Package to PyPI 1 The Real Python Podcast – Episode #110 2 Build...
Read more >
Source code for requirementslib.models.utils - Read the Docs
Link ` compatible URL, convert to a direct url as defined by *PEP 508* by ... :return: A string of specifiers in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found