PEP 427: Make it clear that supported != recommended

This commit is contained in:
Nick Coghlan 2014-01-29 23:06:29 +10:00
parent 26d5c79fb9
commit dc696d75e9
1 changed files with 16 additions and 4 deletions

View File

@ -383,10 +383,22 @@ What's the deal with "purelib" vs. "platlib"?
Is it possible to import Python code directly from a wheel file?
Yes, the wheel format is deliberately designed to be compatible with
Python's support for importing from zip files. While not all wheels
will support being used that way (for example, if they include C
extensions), most pure Python wheels can be used that way just by
placing their name on ``sys.path``.
Python's support for importing from zip files, ensuring that it
provides a superset of the functionality provided by the preceding
egg format.
However, this is generally not a *recommended* approach to using wheel
files, as importing from a zip file rather than an ordinary filesystem
directory imposes a number of additional constraints that will often
break the assumptions of Python developers (for example, C extensions
cannot be imported directly from a zip archive, and the ``__file__``
attribute no longer refers to an ordinary filesystem path, but to
a combination path that includes both the location of the zip archive
on the filesystem and the relative path to the module inside the
archive).
Like metaclasses and metapath importers, if you're not sure if you need
to take advantage of this feature, you almost certainly don't need it.
References