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.

Pip upgrades dependency installed as `flit install --symlink` editable install.

See original GitHub issue

pip version

20.3.1

Python version

3.9.1

OS

Arch Linux

Additional information

No response

Description

Installing a project B that depends on a project A will modify A’s installation without need.

This is specifically problematic when A is installed in editable/develop mode using flit install --symlink.

I assume pip treats editable installs in a magic special way, but doesn’t identify symlinked installs as editable.

Expected behavior

Pip should not downgrade dependencies, especially not development dependencies

How to Reproduce

$ conda create -yn flit-deps python=3.8 flit
$ conda activate flit-deps
$ git clone https://github.com/theislab/scanpy.git && cd scanpy
$ git switch flit || true  # go to the flit branch if it hasn’t been merged int master yet
$ flit install -s --dep=develop  # Make development install of scanpy
$ pip install scvelo  # Install project that depends on scanpy

Output

...
  Attempting uninstall: scanpy
    Found existing installation: scanpy 1.8.0.dev49-ge715cd98
    Uninstalling scanpy-1.8.0.dev49-ge715cd98:
      Successfully uninstalled scanpy-1.8.0.dev49-ge715cd98
...
Successfully installed loompy-3.0.6 numpy-groupies-0.9.13 scanpy-1.7.0 ...
...
# Development version of scanpy has now been uninstalled in favor of an older stable version

Code of Conduct

  • I agree to follow the PSF Code of Conduct

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
uranusjrcommented, Mar 1, 2021

Sounds like we have figured out the problem here and the fix to it. Thanks for everyone involved here! I’ll close this and continue the work at Flit’s side. Feel free to open further issues if more is needed from the pip side to make this work.

1reaction
sbidoulcommented, Feb 28, 2021

Actually flit install with --symlink and --pth generate proper dist-info metadata (and a direct_url.json like this {"url": "file:///tmp/foobar", "dir_info": {"editable": true}}, /tmp/foobar being the project location).

I’ve not tried this example, but with a sample flit project, both pip freeze and pip list generate something meaningful in such a situation.

So at first sight I’d think all the necessary standard-based information is present for pip to work properly.

I’m not too sure what’s happening here. It looks like pip is downgrading scanpy ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

22.1: Editable installs for packages with extras & flit causes ...
Our dependencies are entirely managed within a pyproject.toml , with a small stub setup.py to help pip do an editable install.
Read more >
When would the -e, --editable option be useful with pip ...
As the man page says it: -e,--editable <path/url> Install a project in editable mode (i.e. setuptools "develop mode") from a local project ...
Read more >
Flit Documentation
INSTALL. $ python3 -m pip install flit. Flit requires Python 3 and therefore needs to be installed using the Python 3 version of...
Read more >
Flit command line interface — Flit 3.8.0 documentation
Generate a setup.py file in the sdist, so it can be installed by older ... you use the --symlink or --pth-file options, pip...
Read more >
Pip 19.1 and installing in editable mode with pyproject.toml
Get all necessary build dependencies (PEP 518); Install any new dependencies; Run any necessary build or compilation steps. And it stopped all ...
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