python-wheel.cygclass

Cygport Reference Manual

### TABLE OF CONTENTS

- python-wheel.cygclass

- PYTHON_WHEEL_VERSIONS
- PKG_NAMES (python-wheel)
- python_wheel_compile
- python_wheel_install
- dowheel
- src_compile (python-wheel)
- src_install (python-wheel)

## python-wheel.cygclass

[ Top ] [ Cygclasses ] [ Cygclasses ]

DESCRIPTION

Wheels are the standard for installing Python libraries and programs. The build is defined by a PEP 518 conformant source tree, or by a top-level setup.cfg or setup.py file, which controls the installation of files and the building of C Python extensions. Many such packages are hosted on the Python Package Index (PyPI).

This cygclass handles the building of wheel-based Python module packages for multiple Python versions simultaneously.

EXAMPLE

        inherit python-wheel

        NAME="python-six"
        VERSION=1.10.0
        RELEASE=1
        CATEGORY="Python"
        SUMMARY="Python 2 and 3 compatibility library"
        DESCRIPTION="Six is a Python 2 and 3 compatibility library. It provides
        utility functions for smoothing over the differences between the Python
        versions with the goal of writing Python code that is compatible on both
        Python versions."

        ARCH=noarch

INHERITS

python.org.cygclass

REQUIRES

pythonXY, pythonXY-pip (for each X.Y version of Python being built)

## PYTHON_WHEEL_VERSIONS

[ Top ] [ python-wheel.cygclass ] [ Variables ]

SYNOPSIS

      PYTHON_WHEEL_VERSIONS="3.5:3.6" # e.g. added to stdlib in 3.7
      inherit python-wheel

DESCRIPTION

A colon-seperated list of version(s) for which this module should be built. Some aliases are also accepted:

- all: all available 3.y versions (currently: 3.8, 3.9, 3.12)
- default: the default set of 3.y version(s) (currently: 3.9, 3.12)
- future: the default and any upcoming 3.y versions (currently: 3.9, 3.12)
- 3: the default 3.x version (currently: 3.12)

If defined, this variable must be set before inheriting python-wheel.cygclass. If undefined, "default" is assumed.

NOTES

- Python 2.7 is no longer supported upstream, and all code should be moving to Python 3.y. A 2.x version appearing in PYTHON_WHEEL_VERSIONS is now an error.
- It is not generally expected for wheel packages to be built with "all". This option is primarily intended for the most basic modules used to build, install, and run other modules (e.g. setuptools, wheel, pip, and virtualenv). The "default" value is sufficient for most packages.
- The value "future" is intended to allow maintainers to get a head start on rebuilding for the new version, but the maintainer must first assure that the module works correctly on the new version and that either there are no module dependencies outside of the standard library, or that they too are already available.

## PKG_NAMES (python-wheel)

[ Top ] [ python-wheel.cygclass ] [ Overloads ]

DESCRIPTION

For a NAME of python-foo, pythonXY-foo binary packages are created automatically, corresponding to each X.Y version in PYTHON_WHEEL_VERSIONS.

Each package also includes its own independent copy of the automatically installed documentation (COPYING, README, etc.).

NOTES

For those packages which install scripts into /usr/bin, they should be added to the respective pythonXY_foo_CONTENTS, for example:

        declare python${PYTHON3_PKGVERSION}_foo_CONTENTS+=" usr/bin/foo"

or

        for v in ${PYTHON_WHEEL_VERSIONS//:/ }
          do
            declare python${v/./}_foo_CONTENTS+=" usr/bin/foo${v}"
          done

## python_wheel_compile

[ Top ] [ python-wheel.cygclass ] [ Compile Functions ]

SYNOPSIS

      python_wheel_compile [OPTIONS]

DESCRIPTION

Runs the 'pip wheel' command to build python wheel from a setup.py or a PEP 518 conformant source tree.

Any arguments provided will be passed as arguments to 'setup.py bdist_wheel', if that is invoked by the build.

## python_wheel_install

[ Top ] [ python-wheel.cygclass ] [ Install Functions ]

SYNOPSIS

      python_wheel_install

DESCRIPTION

Installs the previously built wheel into $D.

## dowheel

[ Top ] [ python-wheel.cygclass ] [ Install Functions ]

SYNOPSIS

      dowheel WHEEL [WHEEL] ...

DESCRIPTION

Installs the given Python wheel(s) into $D/usr/share/python-wheels, to allow offline installation in Python virtual environments.

## src_compile (python-wheel)

[ Top ] [ python-wheel.cygclass ] [ Overloads ]

DEFINITION

    src_compile() {
            lndirs
            cd ${B}
            python_wheel_compile
    }

## src_install (python-wheel)

[ Top ] [ python-wheel.cygclass ] [ Overloads ]

DEFINITION

    src_install() {
            cd ${B}
            python_wheel_install
    }