-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
pip-sync uninstalls main project from virtualenv #1158
Comments
Thanks for the response. I've done some digging and actually the significant change was pip not pip-tools. With pip-tools=5.2.0 and pip==19.3.1, I get the behaviour I am expecting however it comes with a message
With pip-tools=5.2.0 and pip==20.0.2, I get similar behaviour with a more verbose message although the point about MyProject being outside the environment doesn't seem correct as that is where it's installed (although some scripts are installed outside the
With pip-tools=5.2.0 and pip==21.1.1, it uninstalls my project:
So perhaps the behaviour I was accustomed to was an error and not intended but in any case it still seems like the sensible behaviour to me (unless there's a correct way to do what I want with pip-tools). |
Given the error message the change may be a result of pypa/pip#7856 |
Thanks for the analysis! I've also found a couple of related links: |
Does it help to generate the |
Have you had a chance to try the above method, to explicitly define the local package as the/a top level dependency in the |
@AndydeCleyre Not yet, sorry. I'll do it in the next couple of days. |
I don't know which is the intended behavior when using a setup file as I would personally expect the setup-file package itself to be omitted from the requirements files, to be in line with projects that use both setup and requirements files, without necessarily using pip-tools in any capacity. And if I want it included in this case, I'll make a simple |
I'm now running Using a
resulting in a
When I run
This result is what I'm after, although for it to be properly useful I need the path to the current project to be a relative one. I agree with @AndydeCleyre's comments regarding whether If the top package is not in I'm happy to close this ticket |
I'm sorry I don't have a proper solution for you there, but FWIW I am trying to keep my rejected feature branch for relative path support updated, which you can try for example using $ pipx run --spec 'git+https://github.com/AndydeCleyre/pip-tools@feature/relpaths-post-6.8.0' pip-compile or similarly with my zpy function $ pipz runpkg 'pip-tools @ git+https://github.com/AndydeCleyre/pip-tools@feature/relpaths-post-6.8.0' pip-compile |
In my project I have a requirements.txt produced by
pip-compile
fromsetup.py
. requirements.txt does not include the packages in project. Since upgrading to pip-tools to 5.2.0 (not sure what the last version before change was sorry) runningpip-sync requirements.txt
causes my main project to be uninstalled from the virtual environment.Environment Versions
Steps to replicate
Expected result
I expect the requirements in requirements.txt to be synced but my main project, whose requirements I am trying to install, to be left alone.
Actual result
Requirements in requirements.txt are synced but the main project is uninstalled
The text was updated successfully, but these errors were encountered: