[Python-ideas] Changing the default install location, script versioning (Packages and PEP 370)

Jesse Noller jnoller at gmail.com
Mon Jul 20 23:18:33 CEST 2009


On Mon, Jul 20, 2009 at 4:29 PM, Nick Coghlan<ncoghlan at gmail.com> wrote:
> Antoine Pitrou wrote:
>> Jesse Noller <jnoller at ...> writes:
>>> I think the "best" fix for this is to make the bin/ directory mirror
>>> the lib layout - each version would get it's own bin directory:
>>>
>>> .local/
>>>     bin/
>>>         python2.6/
>>>         python3.1/
>>
>> -1. The point of .local/bin is that it's (supposedly) standard, so that you have
>> only one path to add to $PATH. Putting scripts in versioned subdirectories
>> totally defeats its purpose.
>
> Also -1 because the -m switch was added to address exactly this problem
> of interpreter version specific copies of scripts without needing a
> proliferation of script files in the system bin directories.
>
> That said, does distutils have the equivalent of Python's "make
> altinstall" command to tell the distribution to install versioned
> scripts (e.g. easy-install-2.6) without altering non-versioned symlinks
> (e.g. easy-install)?
>
> Cheers,
> Nick.

So python -m "setuptools.commands.easy_install" <args> or python
`which easy_install` is a-ok for people? I find it much easier to tell
someone "run easy_install" or "run pylint" rather than either one of
the previous examples.

I mean, if I have two versions of python (say I'm developing for 2.6
and 3.1) and I want my tool chain (pip, virtualenv, pylint, fabric,
and so on) to be installed into both, I have two choices:

1: as soon as I install into --user remove the unversioned binary name
(for example, pylint) and stick to pylint-2.6. This breaks down if the
upstream package doesn't add the versioned name of the script, which
mean I need to move it after install.

2. Skip scripts entirely, and execute the module by hand.

python -m may have been added to stop the proliferation of script
files - but from a pure usability standpoint, as someone who writes
libraries which contain executables standpoint, running "myfoo" is
much simpler to explain to noobs and easier to remember overall.

jesse



More information about the Python-ideas mailing list