Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…perproject#1270 Use Python 3.11 in RHEL/CentOS RPM build
  • Loading branch information
jiridanek committed Dec 6, 2023
1 parent 4d58286 commit 209eb8b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
11 changes: 3 additions & 8 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
Expand Down
29 changes: 26 additions & 3 deletions python/setup.py → python/pyproject.toml.in
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"]

0 comments on commit 209eb8b

Please sign in to comment.