Drop Python2.7 from the docker builds, and default to gtk3 only

This commit is contained in:
Robin Dunn
2020-07-30 21:03:04 -07:00
parent 28b710f19d
commit 07a1e9ea96
13 changed files with 60 additions and 38 deletions

View File

@@ -24,9 +24,11 @@ this writing you can pull images with these names and tags:
wxpython4/build:debian-10
wxpython4/build:fedora-29
wxpython4/build:fedora-30
wxpython4/build:fedora-31
wxpython4/build:ubuntu-14.04
wxpython4/build:ubuntu-16.04
wxpython4/build:ubuntu-18.04
wxpython4/build:ubuntu-20.04
Building Images

View File

@@ -12,7 +12,8 @@ ENV GTK2_OK=yes
# Update and install basic OS packages
RUN \
yum -y install https://centos7.iuscommunity.org/ius-release.rpm; \
yum -y install https://repo.ius.io/ius-release-el7.rpm \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm; \
yum -y update; \
yum -y group install development; \
yum -y install sudo nano which; \
@@ -41,7 +42,7 @@ RUN \
# Install all available Python packages and their dev packages
yum -y install python python-tools python-devel python-virtualenv; \
yum -y install python36u python36u-tools python36u-devel; \
# CLean up the yum caches
# Clean up the yum caches
yum clean all;
# Set the user and group to use for the rest of the commands
@@ -54,7 +55,6 @@ WORKDIR ${HOME}
RUN \
cd ${HOME}; \
mkdir -p ${HOME}/venvs; \
python2.7 -m virtualenv --python=python2.7 venvs/Py27; \
python3.6 -m venv venvs/Py36;
# Add files from host into the container

View File

@@ -41,7 +41,8 @@ RUN \
webkit2gtk3-devel; \
# Install all available Python packages and their dev packages
yum -y install python3 python3-tools python3-devel; \
# CLean up the yum caches
yum -y install python38 python38-devel; \
# Clean up the yum caches
yum clean all;
# Set the user and group to use for the rest of the commands
@@ -54,7 +55,8 @@ WORKDIR ${HOME}
RUN \
cd ${HOME}; \
mkdir -p ${HOME}/venvs; \
python3.6 -m venv venvs/Py36;
python3.6 -m venv venvs/Py36; \
python3.8 -m venv venvs/Py38;
# Add files from host into the container
COPY scripts ${HOME}/bin

View File

@@ -41,7 +41,6 @@ RUN \
# Install all available Python packages and their dev packages
RUN \
apt-get install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv; \
apt-get install -y python3.7 python3.7-dev libpython3.7-dev python3.7-venv; \
apt-get clean;
@@ -56,7 +55,6 @@ WORKDIR ${HOME}
RUN \
cd ${HOME}; \
mkdir -p ${HOME}/venvs; \
virtualenv --python=python2.7 venvs/Py27; \
python3.7 -m venv venvs/Py37;
# Add files from host into the container

View File

@@ -43,7 +43,6 @@ RUN \
# Install all available Python packages and their dev packages
RUN \
apt-get install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv; \
apt-get install -y python3.5 python3.5-dev libpython3.5-dev python3.5-venv; \
apt-get clean;
@@ -58,7 +57,6 @@ WORKDIR ${HOME}
RUN \
cd ${HOME}; \
mkdir -p ${HOME}/venvs; \
virtualenv --python=python2.7 venvs/Py27; \
python3.5 -m venv venvs/Py35;
# Add files from host into the container

View File

@@ -36,7 +36,7 @@ RUN \
dnf -y install python2 python2-tools python2-devel python2-virtualenv; \
dnf -y install python3 python3-tools python3-devel; \
dnf -y install python36; \
# CLean up dnf caches
# Clean up dnf caches
dnf clean all;
@@ -50,7 +50,6 @@ WORKDIR ${HOME}
RUN \
cd ${HOME}; \
mkdir -p ${HOME}/venvs; \
python2.7 -m virtualenv --python=python2.7 venvs/Py27; \
python3.6 -m venv venvs/Py36; \
python3.7 -m venv venvs/Py37;

View File

@@ -33,10 +33,9 @@ RUN \
SDL-devel \
webkit2gtk3-devel; \
# Install all available Python packages and their dev packages
dnf -y install python2 python2-tools python2-devel python2-virtualenv; \
dnf -y install python3 python3-tools python3-devel; \
dnf -y install python36; \
# CLean up dnf caches
# Clean up dnf caches
dnf clean all;
@@ -50,7 +49,6 @@ WORKDIR ${HOME}
RUN \
cd ${HOME}; \
mkdir -p ${HOME}/venvs; \
python2.7 -m virtualenv --python=python2.7 venvs/Py27; \
python3.6 -m venv venvs/Py36; \
python3.7 -m venv venvs/Py37;

View File

@@ -35,7 +35,7 @@ RUN \
# Install all available Python packages and their dev packages
dnf -y install python3 python3-tools python3-devel; \
dnf -y install python38; \
# CLean up dnf caches
# Clean up dnf caches
dnf clean all;

View File

@@ -47,7 +47,6 @@ RUN \
# Install all available Python packages and their dev packages
RUN \
if [ ${USE_DEADSNAKES} = yes ]; then add-apt-repository ppa:deadsnakes/ppa; apt-get update; fi; \
apt-get install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv; \
apt-get install -y python3.5 python3.5-dev libpython3.5-dev python3.5-venv; \
apt-get install -y python3.6 python3.6-dev libpython3.6-dev python3.6-venv; \
apt-get clean;
@@ -62,7 +61,6 @@ WORKDIR ${HOME}
RUN \
cd ${HOME}; \
mkdir -p ${HOME}/venvs; \
virtualenv --python=python2.7 venvs/Py27; \
python3.5 -m venv venvs/Py35; \
python3.6 -m venv venvs/Py36;

View File

@@ -45,7 +45,6 @@ RUN \
# Install all available Python packages and their dev packages
RUN \
if [ ${USE_DEADSNAKES} = yes ]; then add-apt-repository ppa:deadsnakes/ppa; apt-get update; fi; \
apt-get install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv; \
apt-get install -y python3.6 python3.6-dev libpython3.6-dev python3.6-venv; \
apt-get install -y python3.8 python3.8-dev libpython3.8-dev python3.8-venv; \
apt-get clean;
@@ -60,7 +59,6 @@ WORKDIR ${HOME}
RUN \
cd ${HOME}; \
mkdir -p ${HOME}/venvs; \
virtualenv --python=python2.7 venvs/Py27; \
python3.6 -m venv venvs/Py36; \
python3.7 -m venv venvs/Py37; \
python3.8 -m venv venvs/Py38;

View File

@@ -49,7 +49,6 @@ RUN \
# Install all available Python packages and their dev packages
RUN \
if [ ${USE_DEADSNAKES} = yes ]; then add-apt-repository ppa:deadsnakes/ppa; apt-get update; fi; \
apt-get install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv; \
apt-get install -y python3.6 python3.6-dev libpython3.6-dev python3.6-venv; \
apt-get install -y python3.7 python3.7-dev libpython3.7-dev python3.7-venv; \
apt-get install -y python3.8 python3.8-dev libpython3.8-dev python3.8-venv; \
@@ -69,7 +68,6 @@ WORKDIR ${HOME}
RUN \
cd ${HOME}; \
mkdir -p ${HOME}/venvs; \
virtualenv --python=python2.7 venvs/Py27; \
python3.6 -m venv venvs/Py36; \
python3.7 -m venv venvs/Py37; \
python3.8 -m venv venvs/Py38;

View File

@@ -4,6 +4,7 @@ echo " User: " $(whoami)
echo " ~/bin: " $(ls ~/bin)
echo " ~/venvs:" $(ls ~/venvs)
echo " /dist: " $(ls /dist)
echo " GTK2_OK: " $GTK2_OK
echo ""
if [ -x /usr/bin/lsb_release ]; then

View File

@@ -43,6 +43,29 @@ def build_images(ctx, image, gui=False):
'-t wxpython4/{type}:{name} .'.format(name=img_name, type=img_type),
pty=True, echo=True)
# test it
test_images(ctx, [img_name], gui)
@task(
aliases=['test_image', 'ti'],
help={
'image': 'Name of a docker image to test. May be specified more than once. Defaults to all.',
'gui': 'Test the gui version of an image instead of just the build image.',
},
iterable=['image'],
)
def test_images(ctx, image, gui=False):
"""
Build docker image(s).
"""
if image == []:
image = _get_all_distros(gui)
os.chdir(HERE)
dist=os.path.abspath('../dist')
img_type = 'gui' if gui else 'build'
for img_name in image:
# test it
ctx.run('docker run -it --rm -v {}:/dist '
'wxpython4/{}:{} hello.sh'.format(dist, img_type, img_name),
pty=True, echo=True)
@@ -72,17 +95,16 @@ def push(ctx, image, gui=False):
pty=True, echo=True)
@task(
aliases=['build_wxp', 'bwxp'],
help={
'image':'Name of a docker image to use for building. May be specified more than once. Defaults to all.',
'port': 'One of gtk2, gtk3 or all. Defaults to all.',
'port': 'One of "gtk2", "gtk3" or "all". Defaults to "gtk3".',
'venv': 'The name of a Python virtual environment to use for the build, like Py27, Py36, etc. Defaults to all.'
},
iterable=['image'],
)
def build_wxpython(ctx, image, venv='all', port='all'):
def build_wxpython(ctx, image, venv='all', port='gtk3'):
"""
Use docker images to build wxPython.
@@ -100,6 +122,7 @@ def build_wxpython(ctx, image, venv='all', port='all'):
'wxpython4/build:{} do-build.sh {} {}'.format(dist, img_name, venv, port),
pty=True, echo=True)
@task(
help={
'image_tag':"The tag of the image to be run",
@@ -128,5 +151,12 @@ def run(ctx, image_tag, cmd=None, gui=False, port=5901, keep=False):
def _get_all_distros(gui=False):
os.chdir(HERE)
wildcard = os.path.join('gui' if gui else 'build', '*-*')
all_matching = glob.glob(wildcard)
all_matching = sorted(glob.glob(wildcard))
return [os.path.basename(item) for item in all_matching]
@task()
def showall(ctx, gui=False):
images = _get_all_distros(gui)
for img in images:
print(img)