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

Allow non-editable install #130

Open
JP-Ellis opened this issue Dec 20, 2023 · 1 comment
Open

Allow non-editable install #130

JP-Ellis opened this issue Dec 20, 2023 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@JP-Ellis
Copy link

It would appear that pip-deepfreeze tries to install the local package in editable mode:

pip install -e .

Unfortunately, I have a case where this does not work reliably. The reason being that I have multiple local packages which pip does not resolve well. The reason being that pip believes packages to be conflicting if one package is installed in editable mode, and the other is installed in non-editable mode from a path. There are also issues where pip believes there is a conflict if the paths are not identical (e.g. /src/pkg-b/../pkg-a and /src/pkg-a are the same, but pip will see a conflict).

I could not see an option with pip-deepfreeze to allow a non-editable installation. Could this be added behind a flag?

@sbidoul
Copy link
Owner

sbidoul commented Dec 29, 2023

Hi,

Thanks for trying pip-deepfreeze.

Given the issues you mention I'm not quite sure installing in non-editable mode would help much.

If I understand your use case you are in some sort of monorepo setup.

I'm interested in making pip-df work better in such situations.

The first thing I would try, if possible for you, is to declare "abstract" dependencies in the pyproject.toml of each package, i.e. only the package name (pkg-a, pkg-b). Then in requirements.txt.in, constrain each of it to a concrete path.

So, if pkg-b is your main project where you want to freeze, and it depends on pkg-a, add dependencies = ["pkg-a"] to pkg-b's pyproject.toml, and -e file://${PWD}/../pkg-a#egg=pkg-a to requirements.txt.in.

Then you will probably need to filter out pkg-a from the resulting requirements.txt with a post-sync command.

This is somewhat hacky but should work. One thing we could do is add some support for "local" dependencies to pip-deepfreeze that would do the hacking for you.

Let me know if did understand your use case correctly.

@sbidoul sbidoul added enhancement New feature or request question Further information is requested labels Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants