-1

Based on this answer, I can fully understand the use of:

pip install -e /path/to/locations/repo

However, I am yet to see the use of:

pip install -e .

I can understand it from the perspective of doing pip install -e /path/to/locations/repo, but from the working directory of the project dependency. But that's the only use case I can see.

In what use case would I want to install locally the same package I am now working on?

YFl
  • 845
  • 7
  • 22
  • 3
    When you are working on a Python library that is already installed in your Python env, you would want to use `pip install -e . `. That way, any of your existing scripts which depends on the library you are currently modifying can access the latest version of the library without you having to pollute either of your workspaces by bringing in code from the other workspace. – whiplash Nov 24 '22 at 13:22
  • ***1.*** I guess, in your case, the current working directory always stays the same, it seems like you never navigate to other directories. ***2.*** The so-called "_`src`-layout_" which is very often recommended (and can be argued to be superior), would not allow to import without installing before-hand. – sinoroc Nov 24 '22 at 15:26

1 Answers1

0
pip install -e

will just create a projekt_name.egg-info file in the venv\Lib\site-packages folder with a link to the repo location. Nothing is copied.

You can continue developing and you can access your project packages as if the repo was properly installed. No dirty sys.path.append-hacks needed.

Peter
  • 10,959
  • 2
  • 30
  • 47
  • It feels like I never felt the real pain of working with pip+venv, since I primarily work with poetry+pyenv or conda/mamba. Maybe for these two setups, there is no actual use case, except for the answer I already linked in the question. Is it? – YFl Nov 24 '22 at 15:47