Drop pip-pippone

This commit is contained in:
Alessandro Di Federico
2022-02-23 09:38:34 +01:00
parent b209e09374
commit e67ef146df
-28
View File
@@ -2,34 +2,6 @@
# This file is distributed under the MIT License. See LICENSE.md for details.
#
#[[
Note re: why don't we use standard python packaging tools?
We have the following requirements at development time:
- rev.ng we want to use orchestra or cmake/ninja directly, without ever using pip manually
- we don't want pip to run every time ninja runs, for sure not if it means the modules are always copied again
- we want to source python modules from the build directory (*not* the source directory)
- part of some modules is autogenerated, we don't want to place generated files in the source directory
We have the following requirements for shipping python modules to our users:
- we want to ship the python modules in a directory (under orchestra root) and add it to PYTHONPATH
We would very much like to use pip to install the packages in the build directory, but there are issues.
By default python packages are installed in a path like /usr/lib/python/python<version>/<libname>. This does not work
for us, we don't ship python with orchestra and rely on the system interpreter, which might have any version.
Technically we can add a path like that to PYTHONPATH, but it would be ugly and confusing.
In theory we could combine pip --target and --root options: the former specifies in which directory modules should be
installed, and bypass the default naming scheme which includes the python version. The latter is required to stop pip
from polluting the global list of installed packages.
We can't do this because of this issue: https://github.com/pypa/pip/issues/7829#issuecomment-780309520
TL;DR: when specifying both --target and --root, pip does not move the installed files from the temporary directory it
uses while building the package to the target directory, and copies the temporary directory to the root instead,
resulting in a hierarchy like <root>/tmp/pip-target-<randomstring>/<targetdir>
]]
# Declares a python module as a target
# Named arguments:
# - TARGET_NAME: the name of the CMake target to be created