Skip to content

Commit

Permalink
Python: Bump to python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Spredzy committed Mar 12, 2021
1 parent 8298b76 commit 74dd3ae
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 := ,
Expand Down Expand Up @@ -299,8 +299,8 @@ swagger: reports
check: flake8 pep8 # pyflakes pylint

awx-link:
[ -d "/awx_devel/awx.egg-info" ] || python3 /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
[ -d "/awx_devel/awx.egg-info" ] || $(PYTHON) /awx_devel/setup.py egg_info_dev
cp -f /tmp/awx.egg-link /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

Expand Down
4 changes: 2 additions & 2 deletions awxkit/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def run(self):
'PyYAML',
'requests',
],
python_requires=">=3.6",
python_requires=">=3.8",
extras_require={
'formatting': ['jq'],
'websockets': ['websocket-client==0.57.0'],
Expand All @@ -83,7 +83,7 @@ def run(self):
'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',
],
Expand Down
2 changes: 1 addition & 1 deletion awxkit/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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:}:.
Expand Down
4 changes: 2 additions & 2 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -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 =
Expand Down
4 changes: 2 additions & 2 deletions requirements/updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 12 additions & 12 deletions tools/ansible/roles/dockerfile/templates/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -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 %}flake8{% endif %}
RUN python3.8 -m ensurepip && pip3 install "virtualenv < 20" supervisor {% if build_dev|bool %}flake8{% endif %}

RUN rm -rf /root/.cache && rm -rf /tmp/*

Expand Down Expand Up @@ -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 \
Expand All @@ -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 %}

Expand Down

0 comments on commit 74dd3ae

Please sign in to comment.