Skip to content

Commit

Permalink
Updates following review comments (docs, setup.cfg)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfmoore committed Mar 27, 2014
1 parent b101589 commit 4a1b292
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
37 changes: 37 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,43 @@ contain the setuptools script wrappers. The wheel tool `python -m wheel
install-scripts packagename` calls setuptools to write the appropriate
scripts wrappers after an install.

Defining the Python version
---------------------------

The `bdist_wheel` command automatically determines the correct tags to use for
the generated wheel. These are based on the Python interpreter used to
generate the wheel and whether the project contains C extension code or not.
While this is usually correct for C code, it can be too conservative for pure
Python code. The bdist_wheel command therefore supports two flags that can be
used to specify the Python version tag to use more precisely::

--universal Specifies that a pure-python wheel is "universal"
(i.e., it works on any version of Python). This
equates to the tag "py2.py3".
--python-tag XXX Specifies the precide python version tag to use for
a pure-python wheel.

Neither of these two flags have any effect when used on a project that includes
C extension code.

A reasonable use of the `--python-tag` argument would be for a project that
uses Python syntax only introduced in a particular Python version. There are
no current examples of this, but if wheels had been available when Python 2.5
was released (the first version containing the `with` statement), wheels for a
project that used the `with` statement would typically use `--python-tag py25`.

Typically, projects would not specify python tags on the command line, but
would use `setup.cfg` to set them as a project default::

[bdist_wheel]
universal=1

or::

[bdist_wheel]
python-tag = py32


Automatically sign wheel files
------------------------------

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ requires-dist =
ed25519ll; extra == 'faster-signatures'
license-file = LICENSE.txt

[wheel]
[bdist_wheel]
# use py2.py3 tag for pure-python dist:
universal=1
2 changes: 1 addition & 1 deletion wheel/test/test_tagopt.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Tests for the bdist_wheel --python-tag option
Tests for the bdist_wheel tag options (--python-tag and --universal)
"""

import os
Expand Down

0 comments on commit 4a1b292

Please sign in to comment.