[Python-Dev] PEP 561 rework

Nick Coghlan ncoghlan at gmail.com
Mon Nov 13 04:20:47 EST 2017


On 13 November 2017 at 17:33, Ethan Smith <ethan at ethanhs.me> wrote:
> On Sun, Nov 12, 2017 at 8:07 PM, Nathaniel Smith <njs at pobox.com> wrote:
>> PyPI doesn't distinguish between the names 'foo-stubs' and 'foo_stubs'
>> -- they get normalized together. So even if you use 'foo-stubs' as the
>> directory name on sys.path to avoid collisions at import time, it
>> still won't allow someone to distribute a separate 'foo_stubs' package
>> on PyPI.
>>
>> If you do go with a fixed naming convention like this, the PEP should
>> probably also instruct the PyPI maintainers that whoever owns 'foo'
>> automatically has the right to control the name 'foo-stubs' as well.
>> Or maybe some tweak to PEP 541 is needed.
>
> As I understand it however, the distribution name need not map to to the
> package name in any way. So regardless of if foo-stubs is seen as foo_stubs,
> I could name the distribution Albatross if I wished, and install the
> foo-stubs package into site/dist-packages, and it would work. Also I'm not
> sure if the PyPI change would require an edict from a PEP, but if so, I
> wouldn't be opposed to the idea, I think it would be nice to default the
> stub packages to the owners of the normal packages (people should, to my
> understanding, be able to make alternate distributions without hassle).

Questions like the following aren't new ones:

- If I am responsible for the name 'foo' on PyPI, how much influence,
if any, should I have over the use of 'foo' as a prefix in other
distribution package names?
- If I ship a distribution package through PyPI containing an import
package named 'bar', how much influence, if any, should I have over
the use of 'bar' as an import package or module name in other
distribution packages?

I expect that the PSF will need to address them directly some day, but
I don't think PEP 561 itself needs to address them (and the first
version of PEP 541 probably won't either).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list