Python 3.2a1 in rawhide

Orcan Ogetbil oget.fedora at gmail.com
Mon Aug 23 05:19:53 UTC 2010


On Mon, Aug 23, 2010 at 12:40 AM, Kalev Lember wrote:
> On 08/23/2010 03:34 AM, Orcan Ogetbil wrote:
>> On Sat, Aug 21, 2010 at 6:48 PM, David Malcolm wrote:
>>> I just built Python 3.2a1 into rawhide:
>>>   http://koji.fedoraproject.org/koji/buildinfo?buildID=191382
>>> so the meaning of "python3" in rawhide just jumped from Python 3.1 to
>>> Python 3.2
>> [cut]
>>> with Python 3.2 onwards you now have a __pycache__ directory:
>> [cut]
>>> The idea is to permit sharing of modules between multiple
>>> parallel-installable versions of Python.
>>>
>>
>> I am not sure that I understood this correctly. There will be a
>> __pycache__ directory in the following structure:
>>
>> /usr/lib/python3.2/site-packages/foo/foo.py
>> /usr/lib/python3.2/site-packages/foo/__pycache__/foo.cpython-32.pyc
>> /usr/lib/python3.2/site-packages/foo/__pycache__/foo.cpython-32.pyo
>>
>> But now when the user installs python-3.3, he will have
>>
>> /usr/lib/python3.3/site-packages/foo/foo.py
>> /usr/lib/python3.3/site-packages/foo/__pycache__/foo.cpython-33.pyc
>> /usr/lib/python3.3/site-packages/foo/__pycache__/foo.cpython-33.pyo
>>
>> The two directories have different roots /usr/lib/python3.*/ and the
>> module foo.py is not shared.
>>
>> Where is the catch?
>
> /usr/lib/python*/ isn't the only place where Python bytecode files are
> installed. I'd imagine that the new structure is far more useful in
> other places where Python version isn't already encoded in the directory
> name. For example, currently the RabbitVCS nautilus extension installs
> the following files:
> /usr/lib64/nautilus/extensions-2.0/python/RabbitVCS.py
> /usr/lib64/nautilus/extensions-2.0/python/RabbitVCS.pyc
> /usr/lib64/nautilus/extensions-2.0/python/RabbitVCS.pyo
>
> With the new directory structure the bytecompiled files would end up
> named differently for each Python parallel-installable version:
> /usr/lib64/nautilus/extensions-2.0/python/RabbitVCS.py
> /usr/lib64/nautilus/extensions-2.0/python/__pycache__/RabbitVCS.cpython-33.pyc
> /usr/lib64/nautilus/extensions-2.0/python/__pycache__/RabbitVCS.cpython-33.pyo
>

That sounds like the only place where this convention is useful.

How about .py files in /usr/bin/ ? We currently don't byte-compile the
.py files in standard PATH, but maybe since they will go into a
__pycache__ subdirectory, we can byte-compile them now.

Is there any "law" in FHS that forbids having a /usr/bin/__pycache__/ directory?

Orcan


More information about the devel mailing list