[Distutils] wheels, metadata
Daniel Holth
dholth at gmail.com
Thu Jan 23 16:08:30 CET 2014
On Thu, Jan 23, 2014 at 9:23 AM, Thomas Heller <theller at ctypes.org> wrote:
> I'm reading up and done all those peps:
>
> 425 - compaibility tags
> 426 - metadata 2.0
> 427 - wheel binary format 1.0
> 440 - version identification and dependency specifications
>
> and trying to make sense from them. Well, they make sense to me,
> but to what do they apply?
>
> Example: I can now build, upload, and install a wheel for my distribution.
>
> I have imported setuptools in my setup.py script,
> and have run 'setup.py bdist_wheel'.
>
> The resulting file is named 'py2exe-0.9.0-py34-none-any.whl',
> which means:
>
> python tag 'py34', abi tag 'none', platform tag 'any'
>
> What this file really is: it is a library that only works on
> CPython 3.3 and 3.4, win32 and win_amd64. So I would have expected
> a filename like py2exe-0.9.0-py33.py34-none-win.whl or similar.
>
> Hoever, the only thing that I found which did change the filename
> is this section in the setup.cfg file (which is not appopriate for
> this distribution):
>
> [wheel]
> universal=1
>
> So, the question is:
>
> Are the specifications in the PEPs above implemented somewhere
> or are they only 'specifications'?
>
> There are very detailed descriptions how to specify requirements
> in the metadata (in pep426), something like
>
> "supports_environments": ["python_version >= '3.3'
> and 'win' in sys_platform"]
>
> Where can I specify this? Does distutils support it? Do
> I have to manually edit some pdist.json file, or do I have
> to rename the created .whl?
>
> Thomas
supports_environments is not implemented.
Currently you should be able to just rename the created .whl to change
the tags. In the future the wheel metadata will have to match the
filename so you would need a 'retag' command or just better setup.cfg
options.
bdist_wheel supports this syntax for replacing the requirements
metadata and including the full text of a license in the metadata, in
setup.cfg. One drawback to this approach is that the wheel can have
different dependencies than the non-wheel because vanilla setuptools
doesn't generate the .dist-info style metadata.
distutils sucks, but I haven't had the opportunity to write a replacement.
[metadata]
provides-extra =
tool
signatures
faster-signatures
requires-dist =
argparse; python_version == '2.6'
keyring; extra == 'signatures'
dirspec; sys.platform != 'win32' and extra == 'signatures'
ed25519ll; extra == 'faster-signatures'
license-file = LICENSE.txt
[wheel]
# use py2.py3 tag for pure-python dist:
universal=1
More information about the Distutils-SIG
mailing list