From 4d2684848722cb2d469ad4fa60999bf81cf7056e Mon Sep 17 00:00:00 2001 From: Paride Legovini Date: Sat, 2 May 2020 02:57:24 +0200 Subject: Adapt the package building scripts to use Python 3 (#231) Since upstream cloud-init has dropped python2 support, adapt remaining package build scripts and tools to python3 only Changes: * Do not template debian/rules as python3 is the only supported version * Drop six from requirements.txt * Makefile: drop everything related to Python 2 * run-container: install the CI deps only on ubuntu|debian * read-version: update the shebang to use Python 3 * brpm: read_dependencies(): drop unused argument * read-dependencies: switch to Py3 and drop the --python-version option * pkg-deps.json: drop the Python version field and update the redhat deps * pkg-deps.json: drop the unittest2 and contextlib2 renames * Update RPM the spec file to use Python 3 when building the RPM * bddeb: drop support for Python 2 --- packages/redhat/cloud-init.spec.in | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'packages/redhat/cloud-init.spec.in') diff --git a/packages/redhat/cloud-init.spec.in b/packages/redhat/cloud-init.spec.in index 057a5784..4cff2c97 100644 --- a/packages/redhat/cloud-init.spec.in +++ b/packages/redhat/cloud-init.spec.in @@ -1,6 +1,4 @@ ## template: jinja -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} - %define use_systemd (0%{?fedora} && 0%{?fedora} >= 18) || (0%{?rhel} && 0%{?rhel} >= 7) %if %{use_systemd} @@ -94,11 +92,11 @@ ssh keys and to let the user run various scripts. {% endfor %} %build -%{__python} setup.py build +%{__python3} setup.py build %install -%{__python} setup.py install -O1 \ +%{__python3} setup.py install -O1 \ --skip-build --root $RPM_BUILD_ROOT \ --init-system=%{init_system} @@ -109,7 +107,7 @@ cp -p tools/21-cloudinit.conf \ $RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d/21-cloudinit.conf # Remove the tests -rm -rf $RPM_BUILD_ROOT%{python_sitelib}/tests +rm -rf $RPM_BUILD_ROOT%{python3_sitelib}/tests # Required dirs... mkdir -p $RPM_BUILD_ROOT/%{_sharedstatedir}/cloud @@ -213,4 +211,4 @@ fi %dir %{_sharedstatedir}/cloud # Python code is here... -%{python_sitelib}/* +%{python3_sitelib}/* -- cgit v1.2.3