Open jaraco opened 8 years ago
I'm not sure I want a blanket option to to exclude scripts on install, but we do generally need to figure out something here.
random thought: perhaps the same logic as the --binary/--no-binary options can be used to opt out of scripts,
I usually handle this by creating a virtual environment, installing the application, and then creating a symlink in ~/bin
that points to the generated script.
pipx could be another option, if pipxproject/pipx#86 gets addressed.
Related: prevent pip from clobbering and overwriting files -- #4625
This seems like a very convenient knob. Today, either the package gets split or the user needs to live with an unneeded/conflicting script.
This would also be valuable for me. I maintain a program called folderify
that was implemented in Python for a few years and therefore published to PyPI — but it's now deprecated. I currently have instructions for using an older version when needed:
pip3 install folderify
python3 -m folderify --macOS 10.5 path/to/icon.png
However, this is irresponsible because it will install a folderify
binary that can (and does) clobber an installation of the latest implementation on any shared binary path. The latter installation will remain broken even if the user runs pip3 uninstall folderify
immediately after.
I could resolve this by removing or renaming the folderify
binary while keeping python3 -m folderify
working (and I probably will[^1]). But for people that would like to keep using the old version using the same binary name as before (e.g. because they use it in other scripts and programs), this is a breaking change. By far the best compromise would be something like this:
pip3 install folderify --skip-install-scripts # or anything else that doesn't install the binary
python3 -m folderify --macOS 10.5 path/to/icon.png
Then the provided snippet doesn't clobber any binary, while allowing pip3 install folderify
to work exactly like before for anybody who wants.
[^1]: EDIT: I did.
I'll pitch in with another user story here. I am maintaining binref/refinery, which is primarily a set of command-line utilities. It installs a lot of command-line scripts, because (duh) that's the default use case. However, there are also situations (mostly for automated malware analysis pipelines) where the ability to install it in a "library mode" without creating any scripts would be extremely useful.
This option would also reduce noise in --quiet
logs, which wil show a warning for each and every executable that is installed through a Python packaged in a directory not in the PATH
environment variable. A warning which is irrelevant in e.g., CI use cases.
Another use case, I have the same package installed in different versions of Python. I want to install the scripts only in one python version. Until now I was using
pythonx.y setup.py install --install-script=./trash
but I would like to use pip to follow the recommendations.
Description:
I'm trying to install a package but not install its scripts. The reason is I'd like to make the
keyring
package available in my Python 2 installation (for Mercurial) but continue to usekeyring
in my Python 3 installation as the default. If Ipython2 -m pip install keyring
, it will overwrite thekeyring
script that links to the Python 3 installation.Best I can tell, the two installs of this package will continue to fight over who owns
keyring
in /usr/local/bin.I'd like to be able to exclude the script creation when installing on Python 2 to avoid conflicts.
As documented in the python-packaging-users-guide, easy_install allows excluding scripts from install, but pip does not.
I tried passing
--install-options='--install-scripts=/dev/null'
but that failed.How do other people handle this situation?
What I've run:
Here's where I tried using install-scripts: