Skip to content

Commit 1840bc3

Browse files
authored
[Packaging] Bump Python to 3.12 on RHEL and CentOS Stream (#31264)
1 parent 2a185bd commit 1840bc3

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

azure-pipelines.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -816,13 +816,13 @@ jobs:
816816
dockerfile: ubi
817817
image: registry.access.redhat.com/ubi8/ubi:8.4
818818
artifact: rpm-ubi8-${{ arch.value }}
819-
python_package: python39
819+
python_package: python3.12
820820
pool: ${{ arch.pool }}
821821
Red Hat Universal Base Image 9 ${{ arch.name }}:
822822
dockerfile: ubi
823823
image: registry.access.redhat.com/ubi9/ubi:9.0.0
824824
artifact: rpm-ubi9-${{ arch.value }}
825-
python_package: python3.9
825+
python_package: python3.12
826826
pool: ${{ arch.pool }}
827827
steps:
828828
- bash: ./scripts/ci/install_docker.sh
@@ -864,17 +864,17 @@ jobs:
864864
artifact: rpm-ubi8-${{ arch.value }}
865865
distro: el8
866866
image: registry.access.redhat.com/ubi8/ubi:8.4
867-
python_package: python39
868-
python_cmd: python3.9
869-
pip_cmd: pip3.9
867+
python_package: python3.12
868+
python_cmd: python3.12
869+
pip_cmd: pip3.12
870870
pool: ${{ arch.pool }}
871871
Red Hat Universal Base Image 9 ${{ arch.name }}:
872872
artifact: rpm-ubi9-${{ arch.value }}
873873
distro: el9
874874
image: registry.access.redhat.com/ubi9/ubi:9.0.0
875-
python_package: python3.9
876-
python_cmd: python3.9
877-
pip_cmd: pip3.9
875+
python_package: python3.12
876+
python_cmd: python3.12
877+
pip_cmd: pip3.12
878878
pool: ${{ arch.pool }}
879879
steps:
880880
- task: DownloadPipelineArtifact@1

scripts/release/rpm/azure-cli.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ deactivate
5858

5959
# Fix up %{buildroot} appearing in some files...
6060
for d in %{buildroot}%{cli_lib_dir}/bin/*; do perl -p -i -e "s#%{buildroot}##g" $d; done;
61+
rm %{buildroot}%{cli_lib_dir}/pyvenv.cfg
6162

6263
# Create executable (entry script)
6364

scripts/release/rpm/test_rpm_in_docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export USERNAME=azureuser
77

88
dnf --nogpgcheck install /mnt/rpm/$RPM_NAME -y
99

10-
dnf install git gcc $PYTHON_PACKAGE-devel findutils -y
10+
dnf install git findutils $PYTHON_PACKAGE-pip -y
1111

1212
ln -s -f /usr/bin/$PYTHON_CMD /usr/bin/python
1313
ln -s -f /usr/bin/$PIP_CMD /usr/bin/pip

scripts/release/rpm/ubi.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ARG image=registry.access.redhat.com/ubi8/ubi:8.4
55

66
FROM ${image} AS build-env
77
ARG cli_version=dev
8-
ARG python_package=python39
8+
ARG python_package=python3.12
99

1010
RUN yum update -y
1111
RUN yum install -y wget rpm-build gcc libffi-devel ${python_package}-devel openssl-devel make bash diffutils patch dos2unix perl
@@ -18,7 +18,7 @@ COPY . .
1818
# We have to explicitly specify 'python39' to install Python 3.9.
1919
RUN --mount=type=secret,id=PIP_INDEX_URL export PIP_INDEX_URL=$(cat /run/secrets/PIP_INDEX_URL) && \
2020
dos2unix ./scripts/release/rpm/azure-cli.spec && \
21-
REPO_PATH=$(pwd) CLI_VERSION=$cli_version PYTHON_PACKAGE=$python_package PYTHON_CMD=python3.9 \
21+
REPO_PATH=$(pwd) CLI_VERSION=$cli_version PYTHON_PACKAGE=$python_package PYTHON_CMD=$python_package \
2222
rpmbuild -v -bb --clean scripts/release/rpm/azure-cli.spec && \
2323
cp /root/rpmbuild/RPMS/*/azure-cli-${cli_version}-1.*.rpm /azure-cli-dev.rpm && \
2424
mkdir /out && cp /root/rpmbuild/RPMS/*/azure-cli-${cli_version}-1.*.rpm /out/

0 commit comments

Comments
 (0)