[Python-ideas] Moving typing out of the stdlib in Python 3.7?
Nick Coghlan
ncoghlan at gmail.com
Mon Nov 6 03:28:10 EST 2017
On 6 November 2017 at 16:42, Lukasz Langa <lukasz at langa.pl> wrote:
>
>> On 5 Nov, 2017, at 10:30 PM, Michel Desmoulin <desmoulinmichel at gmail.com> wrote:
>>
>> Le 06/11/2017 à 07:07, Nick Coghlan a écrit :
>>
>>> It's the default on Unix as well - you have to do "make install
>>> ENSUREPIP=no" to avoid getting it. (And some distros also modify their
>>> Python installations so that pip is missing by default)
>>
>> On debian and derivatives (so Ubuntu) you need to install python-pip to
>> be able to use pip.
>>
>> Now it's annoying already. Because you have to write every tutorial to
>> include a special case for them. But at least it's not a required step
>> to run your program.
>>
>> However, if you do code using type hints and typing is not installed,
>> you can't even run the program without installing something. So we
>> finally have Python 3 by default on most Linux system, but still would
>> not be able to assume we can run a modern script on it.
>
> This is a valid concern. Although this particular problem is self-inflicted by Debian, I can understand their rationale behind explicit packaging. They need to have control over the entire package graph. I wonder if there's a way in .deb to specify a required installed package. I'm not calling it a "dependency" since obviously it would rather be "python3-typing" that depends on "python3".
Fedora just lives with the circular dependency between python3 and
python3-pip, which ensures both are installed by default (this
arrangement allows "python3 -m venv" to still install pip, without
actually needing a second copy of pip inside the python3 package)
A bundled typing module that "python -m venv" installed by default
would probably require similar treatment.
> But even if Debian installs python3-typing by default, will "pip install -U typing" be possible in this scenario? I guess it wouldn't be terrible if that only worked in virtualenvs, although ideally it would work also for the raw host installation.
"sudo pip install <anything>" remains a terrible idea on any distro,
because it leads to pip and the system package manager getting into a
fight over which tool is responsible for managing the affected files.
"pip install --user --upgrade typing" should work OK, though.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-ideas
mailing list