-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Python 3.12 via manylinux_x_y (#739)
# Description The current versions of manylinux (manylinux1, manylinux2010, manylinux2014) are outdated and do not support Python 3.11+. [PEP 600](https://www.python.org/dev/peps/pep-0600/) defines a new future-proof versioning scheme tagged manylinux_x_y. This PR adds support for manylinux_x_y. The [weekly builds of containers](https://github.com/SINTEF/dlite/actions/workflows/container_builds_weekly.yml) has failed for a while without being noticed (since the weekly build is not run at push time, for good reasons - it takes about two hour to rebuild the musllinux docker image). The reason for this is that the old manylinux2010 and manylinux2014 does not support Python 3.11+ as well as several packages that has been added to `requirements_full.txt`. These issues are also addressed by this PR. See also https://github.com/mayeut/pep600_compliance ## Type of change - [x] Bug fix & code cleanup - [x] New feature - [ ] Documentation update - [ ] Test update ## Checklist for the reviewer This checklist should be used as a help for the reviewer. - [ ] Is the change limited to one issue? - [ ] Does this PR close the issue? - [ ] Is the code easy to read and understand? - [ ] Do all new feature have an accompanying new test? - [ ] Has the documentation been updated as necessary?
- Loading branch information
Showing
6 changed files
with
118 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# -*- Mode: Dockerfile -*- | ||
# Dockerfile for building Python pypi package with manylinux_x_y based on | ||
# glibc>=x.y. See https://github.com/mayeut/pep600_compliance | ||
# | ||
# Usage: | ||
# | ||
# Copy this template file and replace: | ||
# - `{{ TYPE }}` major glibc version, ex: 2_28, 2_35, 2_38 | ||
# - `{{ ARCH }}` with a valid arch, ex: x86_64, i686 | ||
# Remove the `.template` suffix from the copy. | ||
# | ||
# Build: | ||
# | ||
# docker build -t dlite-manylinux -f .github/docker/Dockerfile-manylinux_x_y . | ||
# | ||
# Run (for debugging): | ||
# | ||
# docker run --rm -it \ | ||
# --volume $PWD:/io \ | ||
# --user $(id -u):$(id -g) \ | ||
# dlite-manylinux \ | ||
# /bin/bash | ||
# | ||
|
||
# Reference: https://github.com/pypa/manylinux | ||
FROM quay.io/pypa/manylinux{{ TYPE }}_{{ ARCH }} | ||
|
||
ARG PY_MINORS="7 8 9 10 11 12" | ||
|
||
#COPY requirements.txt /tmp/requirements.txt | ||
COPY requirements_full.txt requirements_dev.txt /tmp/ | ||
|
||
{{ EXTRA_PRE }} | ||
|
||
# Enable rpmfusion for additional packages | ||
# Rust and cargo are needed by pydantic2 | ||
RUN dnf update -y | ||
RUN dnf localinstall -y --skip-broken \ | ||
https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm --eval %{centos_ver}).noarch.rpm \ | ||
https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm --eval %{centos_ver}).noarch.rpm && \ | ||
dnf install -y \ | ||
redland-devel \ | ||
rasqal-devel \ | ||
swig \ | ||
libcurl-devel \ | ||
libxslt-devel \ | ||
libxml2-devel \ | ||
hdf5-devel \ | ||
rust \ | ||
cargo | ||
|
||
# Unpack static libraries | ||
# It's necessary to be in /opt/_internal because the internal libraries | ||
# exist here. | ||
RUN cd /opt/_internal && \ | ||
tar -Jxvf static-libs-for-embedding-only.tar.xz | ||
|
||
# Change required version of pydantic to be <2 | ||
#RUN sed 's/^\(pydantic>.*<\).*$/\12/' -i /tmp/requirements_full.txt | ||
|
||
# Remove psycopg from requirements | ||
RUN sed '/^psycopg/d' -i /tmp/requirements_full.txt | ||
|
||
# Install required Python packages | ||
RUN mkdir -p /ci/pip_cache && \ | ||
if [ -f "/etc/yum.repos.d/pgdg-91.repo" ]; then export PATH="$PATH:/usr/pgsql-9.1/bin"; fi | ||
|
||
RUN for minor in ${PY_MINORS}; do \ | ||
python3.${minor} -m pip install -U pip && \ | ||
python3.${minor} -m pip install -U setuptools wheel && \ | ||
python3.${minor} -m pip install -U --cache-dir /ci/pip_cache cmake oldest-supported-numpy && \ | ||
python3.${minor} -m pip install --cache-dir /ci/pip_cache --prefer-binary -r /tmp/requirements_full.txt -r /tmp/requirements_dev.txt; \ | ||
done | ||
|
||
{{ EXTRA_POST }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters