1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-20 07:38:40 +02:00
openwrt-packages/lang/python/setup.py.shim
Alexandru Ardelean 61f202c017 python-build: add support for pyproject.toml files
A new PEP 517 (https://www.python.org/dev/peps/pep-0517/) has defined that
Python packages can be shipped without any `setup.py` file, and that a
`pyproject.toml` file is sufficient.

A `setup.py` shim layer is suggested as a method for running the build.

For these cases, we will add a support in the OpenWrt build-system to
provide the default `setup.py` shim layer in case this file does not exist,
but there is a `pyproject.toml` file.

We also seem to need to tweak the shim layer with the PKG_VERSION,
otherwise the detected version is 0.0.0.
We will need to see if this will be fixed later in setuptools{-scm}.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2023-01-22 15:58:59 +01:00

7 lines
208 B
Plaintext

import os
import setuptools
# FIXME: see about getting rid of PY_PKG_VERSION asap when setuptools handles this correctly
if __name__ == "__main__":
setuptools.setup(version=os.environ['PY_PKG_VERSION'])