diff --git a/Containerfile b/Containerfile index 8d3fc420f..8bdad9c6a 100644 --- a/Containerfile +++ b/Containerfile @@ -23,7 +23,7 @@ RUN microdnf -y --setopt=install_weak_deps=0 --setopt=tsflags=nodocs install \ rpm-build \ gcc gcc-c++ make cmake pkgconfig \ cyrus-sasl-devel openssl-devel libuuid-devel \ - python3-devel python3-setuptools python3-wheel python3-pip \ + python3.11-devel python3.11-setuptools python3.11-wheel python3.11-pip \ libnghttp2-devel \ wget tar patch findutils git \ libtool \ @@ -49,7 +49,7 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:latest RUN microdnf -y --setopt=install_weak_deps=0 --setopt=tsflags=nodocs install \ glibc \ cyrus-sasl-lib cyrus-sasl-plain cyrus-sasl-gssapi openssl \ - python3 \ + python3.11 \ libnghttp2 \ gettext hostname iputils \ shadow-utils \ diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 14b248218..2defd7bad 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -32,20 +32,15 @@ add_custom_target(NAME ALL configure_file(${CMAKE_SOURCE_DIR}/python/skupper_router/_skupper_router_site.py.in ${CMAKE_CURRENT_BINARY_DIR}/_skupper_router_site.py) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py ${CMAKE_CURRENT_BINARY_DIR}/setup.py COPYONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/setup.cfg) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pyproject.toml.in + ${CMAKE_CURRENT_BINARY_DIR}/pyproject.toml) # Use pip install to install the public python modules. # --compile option compiles Python source files to bytecode # --disable-pip-version-check is useful in offline scenarios to avoid a query to PyPI -# --no-use-pep517 is necessary for compatibility with older setuptools on centos stream 8 and 9 - -# --check-build-dependencies option cannot be used here since centos stream versions 8 and 9 don't support it -# --no-build-isolation by itself would also skip PyPI downloads, but centos stream 8 and 9 have older setuptools which is buggy -# see https://github.com/pypa/pip/issues/6264, https://github.com/pypa/setuptools/issues/3291 install(CODE "execute_process( \ - COMMAND ${Python_EXECUTABLE} -m pip install ${CMAKE_CURRENT_BINARY_DIR} --disable-pip-version-check --no-build-isolation --no-use-pep517 --ignore-installed --verbose --compile --prefix=\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX} \ + COMMAND ${Python_EXECUTABLE} -m pip install ${CMAKE_CURRENT_BINARY_DIR} --disable-pip-version-check --no-build-isolation --ignore-installed --verbose --compile --prefix=\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX} \ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} \ COMMAND_ECHO STDOUT \ COMMAND_ERROR_IS_FATAL ANY)") diff --git a/python/setup.py b/python/pyproject.toml.in similarity index 53% rename from python/setup.py rename to python/pyproject.toml.in index 9a2317654..aa328bfa3 100644 --- a/python/setup.py +++ b/python/pyproject.toml.in @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file @@ -18,6 +17,30 @@ # under the License. # -from setuptools import setup +[project] +name="skupper_router" +description = "Skupper Router tools and libraries" +version = '${QPID_DISPATCH_VERSION}' +authors = [ + { name = "Skupper Project", email = "skupper@googlegroups.com" } +] +requires-python = ">=3.9" -setup() +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + +[tool.skupper_router] +homepage = "https://skupper.io/" +repository = "https://github.com/skupperproject/skupper-router/" + +[tool.setuptools] +# By default, include-package-data is true in pyproject.toml, so you do +# NOT have to specify this line. +include-package-data = true + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.package-data] +"*" = ["*.json"]