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 Dec 7, 2020
1 parent d14fa93 commit e4b2340
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 30 deletions.
14 changes: 5 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ virtualenv_ansible:
mkdir $(VENV_BASE); \
fi; \
if [ ! -d "$(VENV_BASE)/ansible" ]; then \
virtualenv -p python $(VENV_BASE)/ansible && \
$(PYTHON) -m venv --system-site-package $(VENV_BASE)/ansible && \
$(VENV_BASE)/ansible/bin/pip install $(PIP_OPTIONS) $(VENV_BOOTSTRAP); \
fi; \
fi
Expand All @@ -133,7 +133,7 @@ virtualenv_ansible_py3:
mkdir $(VENV_BASE); \
fi; \
if [ ! -d "$(VENV_BASE)/ansible" ]; then \
virtualenv -p $(PYTHON) $(VENV_BASE)/ansible; \
$(PYTHON) -m venv --system-site-package $(VENV_BASE)/ansible; \
$(VENV_BASE)/ansible/bin/pip install $(PIP_OPTIONS) $(VENV_BOOTSTRAP); \
fi; \
fi
Expand All @@ -147,7 +147,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 All @@ -160,8 +160,6 @@ requirements_ansible: virtualenv_ansible
cat requirements/requirements_ansible.txt requirements/requirements_ansible_git.txt | PYCURL_SSL_LIBRARY=$(PYCURL_SSL_LIBRARY) $(VENV_BASE)/ansible/bin/pip install $(PIP_OPTIONS) --no-binary $(SRC_ONLY_PKGS) -r /dev/stdin ; \
fi
$(VENV_BASE)/ansible/bin/pip uninstall --yes -r requirements/requirements_ansible_uninstall.txt
# Same effect as using --system-site-packages flag on venv creation
rm $(shell ls -d $(VENV_BASE)/ansible/lib/python* | head -n 1)/no-global-site-packages.txt

requirements_ansible_py3: virtualenv_ansible_py3
if [[ "$(PIP_OPTIONS)" == *"--no-index"* ]]; then \
Expand All @@ -170,8 +168,6 @@ requirements_ansible_py3: virtualenv_ansible_py3
cat requirements/requirements_ansible.txt requirements/requirements_ansible_git.txt | PYCURL_SSL_LIBRARY=$(PYCURL_SSL_LIBRARY) $(VENV_BASE)/ansible/bin/pip3 install $(PIP_OPTIONS) --no-binary $(SRC_ONLY_PKGS) -r /dev/stdin ; \
fi
$(VENV_BASE)/ansible/bin/pip3 uninstall --yes -r requirements/requirements_ansible_uninstall.txt
# Same effect as using --system-site-packages flag on venv creation
rm $(shell ls -d $(VENV_BASE)/ansible/lib/python* | head -n 1)/no-global-site-packages.txt

requirements_ansible_dev:
if [ "$(VENV_BASE)" ]; then \
Expand Down Expand Up @@ -220,7 +216,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 @@ -339,7 +335,7 @@ swagger: reports
check: flake8 pep8 # pyflakes pylint

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 /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 installer/roles/image_build/files/Dockerfile.sdist
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ RUN dnf -y update && dnf -y install epel-release && \
git \
make \
nodejs \
python3 \
python3-setuptools
python38 \
python38-setuptools

# Use the distro provided npm to bootstrap our required version of node
RUN npm install -g n && n 10.15.0 && dnf remove -y nodejs
Expand Down
20 changes: 10 additions & 10 deletions installer/roles/image_build/templates/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ RUN dnf -y update && \
patch \
@postgresql:10 \
postgresql-devel \
python3-devel \
python3-pip \
python3-psycopg2 \
python3-setuptools \
python38-devel \
python38-pip \
python38-psycopg2 \
python38-setuptools \
swig \
unzip \
xmlsec1-devel \
Expand Down Expand Up @@ -127,11 +127,11 @@ RUN dnf -y update && \
libcgroup-tools \
nginx \
@postgresql:10 \
python3-devel \
python38-devel \
python3-libselinux \
python3-pip \
python3-psycopg2 \
python3-setuptools \
python38-pip \
python38-psycopg2 \
python38-setuptools \
rsync \
subversion \
sudo \
Expand Down Expand Up @@ -222,7 +222,7 @@ RUN chmod u+s /usr/bin/bwrap ; \
{% if build_dev|bool %}
RUN for dir in \
/venv \
/venv/awx/lib/python3.6 \
/venv/awx/lib/python3.8 \
/var/lib/awx/projects \
/var/lib/awx/rsyslog \
/var/run/awx-rsyslog \
Expand All @@ -231,7 +231,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 \
/venv/awx/lib/python3.6/site-packages/awx.egg-link ; \
/venv/awx/lib/python3.8/site-packages/awx.egg-link ; \
do touch $file ; chmod g+rw $file ; done
{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion installer/roles/kubernetes/templates/deployment.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ spec:
- >-
yum install -y ansible curl python-setuptools epel-release \
openssl openssl-devel gcc python-devel &&
yum install -y python-virtualenv python36 python36-devel &&
yum install -y python-virtualenv python38 python38-devel &&
mkdir -p {{ custom_venvs_path }} &&
{% for custom_venv in custom_venvs %}
virtualenv -p {{ custom_venv.python | default(custom_venvs_python) }} \
Expand Down
8 changes: 0 additions & 8 deletions tools/scripts/awx-python
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
#!/usr/bin/env bash
# Enable needed Software Collections, if installed
for scl in rh-postgresql10; do
if [ -f /etc/scl/prefixes/$scl ]; then
if [ -f `cat /etc/scl/prefixes/$scl`/$scl/enable ]; then
. `cat /etc/scl/prefixes/$scl`/$scl/enable
fi
fi
done

# Enable Tower virtualenv
for venv_path in /var/lib/awx/venv/awx /venv/awx; do
Expand Down

0 comments on commit e4b2340

Please sign in to comment.