Python: Bump to python 3.8

This commit is contained in:
Yanis Guenane 2020-12-07 13:00:49 +01:00
parent 23d72a9b6c
commit e04e4e8c85
6 changed files with 23 additions and 23 deletions

View File

@ -1,4 +1,4 @@
PYTHON ?= python3
PYTHON ?= python3.8
PYTHON_VERSION = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_version; print(get_python_version())")
SITELIB=$(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
OFFICIAL ?= no
@ -125,7 +125,7 @@ virtualenv_awx:
mkdir $(VENV_BASE); \
fi; \
if [ ! -d "$(VENV_BASE)/awx" ]; then \
virtualenv -p $(PYTHON) $(VENV_BASE)/awx; \
$(PYTHON) -m venv $(VENV_BASE)/awx; \
$(VENV_BASE)/awx/bin/pip install $(PIP_OPTIONS) $(VENV_BOOTSTRAP); \
fi; \
fi
@ -164,7 +164,7 @@ version_file:
if [ "$(VENV_BASE)" ]; then \
. $(VENV_BASE)/awx/bin/activate; \
fi; \
python -c "import awx; print(awx.__version__)" > /var/lib/awx/.awx_version; \
$(PYTHON) -c "import awx; print(awx.__version__)" > /var/lib/awx/.awx_version; \
# Do any one-time init tasks.
comma := ,
@ -292,7 +292,7 @@ swagger: reports
check: black
awx-link:
[ -d "/awx_devel/awx.egg-info" ] || python3 /awx_devel/setup.py egg_info_dev
[ -d "/awx_devel/awx.egg-info" ] || $(PYTHON) /awx_devel/setup.py egg_info_dev
cp -f /tmp/awx.egg-link /var/lib/awx/venv/awx/lib/python$(PYTHON_VERSION)/site-packages/awx.egg-link
TEST_DIRS ?= awx/main/tests/unit awx/main/tests/functional awx/conf/tests awx/sso/tests

View File

@ -67,7 +67,7 @@ setup(
'PyYAML',
'requests',
],
python_requires=">=3.6",
python_requires=">=3.8",
extras_require={'formatting': ['jq'], 'websockets': ['websocket-client==0.57.0'], 'crypto': ['cryptography']},
license='Apache 2.0',
classifiers=[
@ -79,7 +79,7 @@ setup(
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.8',
'Topic :: System :: Software Distribution',
'Topic :: System :: Systems Administration',
],

View File

@ -8,7 +8,7 @@ skip_missing_interpreters = true
# skipsdist = true
[testenv]
basepython = python3.6
basepython = python3.8
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
setenv =
PYTHONPATH = {toxinidir}:{env:PYTHONPATH:}:.

View File

@ -1,7 +1,7 @@
[pytest]
DJANGO_SETTINGS_MODULE = awx.settings.development
python_paths = /var/lib/awx/venv/tower/lib/python3.6/site-packages
site_dirs = /var/lib/awx/venv/tower/lib/python3.6/site-packages
python_paths = /var/lib/awx/venv/tower/lib/python3.8/site-packages
site_dirs = /var/lib/awx/venv/tower/lib/python3.8/site-packages
python_files = *.py
addopts = --reuse-db --nomigrations --tb=native
markers =

View File

@ -14,11 +14,11 @@ _cleanup() {
generate_requirements() {
venv="`pwd`/venv"
echo $venv
/usr/bin/python3.6 -m venv "${venv}"
/usr/bin/python3.8 -m venv "${venv}"
# shellcheck disable=SC1090
source ${venv}/bin/activate
${venv}/bin/python3.6 -m pip install -U pip pip-tools
${venv}/bin/python3.8 -m pip install -U pip pip-tools
${pip_compile} --output-file requirements.txt "${requirements_in}" "${requirements_git}"
# consider the git requirements for purposes of resolving deps

View File

@ -34,16 +34,16 @@ RUN dnf -y update && \
patch \
@postgresql:12 \
postgresql-devel \
python3-devel \
python3-pip \
python3-psycopg2 \
python3-setuptools \
python38-devel \
python38-pip \
python38-psycopg2 \
python38-setuptools \
swig \
unzip \
xmlsec1-devel \
xmlsec1-openssl-devel
RUN python3 -m ensurepip && pip3 install "virtualenv < 20"
RUN python3.8 -m ensurepip && pip3 install "virtualenv < 20"
# Install & build requirements
ADD Makefile /tmp/Makefile
@ -94,9 +94,9 @@ RUN dnf -y update && \
@postgresql:12 \
python3-devel \
python3-libselinux \
python3-pip \
python3-psycopg2 \
python3-setuptools \
python38-pip \
python38-psycopg2 \
python38-setuptools \
rsync \
subversion \
sudo \
@ -119,7 +119,7 @@ RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master
RUN curl -L -o /usr/bin/tini https://github.com/krallin/tini/releases/download/v0.19.0/tini-{{ tini_architecture | default('amd64') }} && \
chmod +x /usr/bin/tini
RUN python3 -m ensurepip && pip3 install "virtualenv < 20" supervisor {% if build_dev|bool %}black{% endif %}
RUN python3.8 -m ensurepip && pip3 install "virtualenv < 20" supervisor {% if build_dev|bool %}black{% endif %}
RUN rm -rf /root/.cache && rm -rf /tmp/*
@ -228,8 +228,8 @@ RUN for dir in \
RUN for dir in \
/var/lib/awx/venv \
/var/lib/awx/venv/awx/bin \
/var/lib/awx/venv/awx/lib/python3.6 \
/var/lib/awx/venv/awx/lib/python3.6/site-packages \
/var/lib/awx/venv/awx/lib/python3.8 \
/var/lib/awx/venv/awx/lib/python3.8/site-packages \
/var/lib/awx/projects \
/var/lib/awx/rsyslog \
/var/run/awx-rsyslog \
@ -238,7 +238,7 @@ RUN for dir in \
do mkdir -m 0775 -p $dir ; chmod g+rw $dir ; chgrp root $dir ; done && \
for file in \
/var/run/nginx.pid \
/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx.egg-link ; \
/var/lib/awx/venv/awx/lib/python3.8/site-packages/awx.egg-link ; \
do touch $file ; chmod g+rw $file ; done
{% endif %}