115 Python.cmake

Issue with renanimg the debug version of the generated pyceda wheel

At one stage we renamed the debug version of the pyceda wheel file. For example the release version might be named pyceda-<version>-cp27-cp27m-win_amd64.whl and the debug version might be named pyceda-<version>-cp27-cp27m-win_amd64-debug.whl.

However this lead to issues when trying to install it using pip:

You cannot directly install the debug version using


python -m pip install --upgrade --no-deps --force-reinstall pyceda-<version>-cp27-cp27m-win_amd64-debug.whl

This produces the error:


ERROR: pyceda-<version>-cp27-cp27m-win_amd64-debug.whl is not a supported wheel on this platform.

This happens because pip parses the filename and rejects it unless it matches one of the compatible tags. The compatible tags can be seen using the command


python -m pip debug --verbose

This produces a list such as:

Compatible tags: 21
  cp27-cp27m-win_amd64
  cp27-none-win_amd64
  py27-none-win_amd64
  py2-none-win_amd64
  py26-none-win_amd64
  py25-none-win_amd64
  py24-none-win_amd64
  py23-none-win_amd64
  py22-none-win_amd64
  py21-none-win_amd64
  py20-none-win_amd64
  cp27-none-any
  py27-none-any
  py2-none-any
  py26-none-any
  py25-none-any
  py24-none-any
  py23-none-any
  py22-none-any
  py21-none-any
  py20-none-any

todo: it seems that our file naming policy is poor. It would be better to put the debug version in a debug folder rather than add '-debug' to the filename.

Selecting between Python2 and Python3

The variable CEDA_USE_PYTHON3 determines whether Python2 or Python3 will be used.

On Windows, when using Python2 we typically have:

    Python2_EXECUTABLE = C:/python27x64/python
    Python2_INCLUDE_DIRS = C:/python27x64/include
    Python2_LIBRARIES = C:/python27x64/libs/python27.lib

cedaAddPythonPackage

cedaAddPythonPackage is used to add a ceda based python package such as pyceda, pypizza or pyvoter. Here is an example of its usage:


    cedaAddPythonPackage(
        NAME pypizza
        SOURCEDIR ${CMAKE_CURRENT_SOURCE_DIR}/pypizza_package
        SOURCEFILES LICENSE README.md setup.py pypizza/__init__.py
        LIBS DateTime Shapes Pizza)

Python.cmake

See [CEDACORE]/cmake/Python.cmake in the ceda-core repository.