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

Support installing scripts to custom location #9909

Open
thorntonryan opened this issue Apr 28, 2021 · 2 comments
Open

Support installing scripts to custom location #9909

thorntonryan opened this issue Apr 28, 2021 · 2 comments

Comments

@thorntonryan
Copy link

thorntonryan commented Apr 28, 2021

What's the problem this feature will solve?

My team has been leveraging some custom Conan packages to deliver and ship various Python scripts and utilities for use in our build process.

In order to achieve this, we package each utility in its own venv and use --install-option="--install-scripts=/custom/path/" to install the scripts to a custom folder that later gets added to PATH.

We do this because we want our scripts added to PATH (e.g. sphinx-build.exe), but we don't want to pollute path with different python.exe / pip.exe from each venv.

Lately, we've started seeing:

UserWarning: Disabling all use of wheels due to the use of --build-option / --global-option / --install-option.
cmdoptions.check_install_build_global(options)
DEPRECATION: Location-changing options found in --install-option: ['--install-scripts'] from command line. This configuration may cause unexpected behavior and is unsupported. pip 20.2 will remove support for this functionality. A possible replacement is using pip-level options like --user, --prefix, --root, and --target. You can find discussion regarding this at #7309.

What's the supported approach for achieving this behavior that's seemingly removed in pip 20.2+ ?

Describe the solution you'd like

Ideally, a new flag that restored the old --install-option="--install-scripts=/custom/path/" behavior and provided a way to modify the script installation location.

Then we can continue using that type of mechanism from within our Conan packages to install our scripts to a separate folder from the remainder of the venv.

Alternative Solutions

Without direct support from pip, we could explore other ideas:

Using the prefix command, installing to some folder w/in our package, and then creating a simlink at <package/bin> to point to the utility scripts we care about.

I'm pretty confident our tooling knows the location of each script / entry point, so I think we could just as easily copy the files to a separate folder too.

Additional context

@chrahunt I've been looking along this thread and haven't been able to find my answer, hopefuly you can give me an answer :)
I previously legeraged --install-option="--install-scripts=/custom/path/" to deploy only scripts to a specific location but this is > now rejected with the recents updates.
Is there still a way through pip to install scripts to a custom location without moving the whole package ?

Thank you

#7309 (comment)

Based on the discussion in #7309, I'm not sure if anyone ever formally created a feature request to explore restoring the --install-scripts install option that was removed or determine how to achieve similar behavior using supported means. So I'm opening this issue as a formal request : )

I tried searching, but couldn't find anything that looked directly related. Please feel free to close if this is a duplicate or if this is functionality you no longer wish to support.

Cheers!
Ryan

@ndevenish
Copy link

Just ran into this also. #7309 seems to have blanket deprecated all these flags without providing a replacement.

@ZigZagT
Copy link

ZigZagT commented Apr 15, 2024

Has anyone founda workaround with newer version of pip? I've been doing pip3 install --no-cache-dir -I 'pip<20.2' ever since #7309

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants