diff --git a/docker/README.rst b/docker/README.rst index 69336e83..a80f1a50 100644 --- a/docker/README.rst +++ b/docker/README.rst @@ -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 @@ -36,7 +38,7 @@ Since images are available on DockerHub there shouldn't be much need for building them yourself, but just in case, here is how to do it. All images can be built with a simple command like this:: - inv build-images + inv build-images And one or more specific images can be built like this:: diff --git a/docker/build/centos-7/Dockerfile b/docker/build/centos-7/Dockerfile index 8ba759fa..8187ee57 100644 --- a/docker/build/centos-7/Dockerfile +++ b/docker/build/centos-7/Dockerfile @@ -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 diff --git a/docker/build/centos-8/Dockerfile b/docker/build/centos-8/Dockerfile index 27cf5f8e..d9ee88b2 100644 --- a/docker/build/centos-8/Dockerfile +++ b/docker/build/centos-8/Dockerfile @@ -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 diff --git a/docker/build/debian-10/Dockerfile b/docker/build/debian-10/Dockerfile index 77700048..52456012 100644 --- a/docker/build/debian-10/Dockerfile +++ b/docker/build/debian-10/Dockerfile @@ -37,11 +37,10 @@ RUN \ libtiff-dev \ libwebkit2gtk-4.0-dev \ libxtst-dev; \ - apt-get clean; + apt-get clean; # 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,8 +55,7 @@ WORKDIR ${HOME} RUN \ cd ${HOME}; \ mkdir -p ${HOME}/venvs; \ - virtualenv --python=python2.7 venvs/Py27; \ - python3.7 -m venv venvs/Py37; + python3.7 -m venv venvs/Py37; # Add files from host into the container COPY scripts ${HOME}/bin diff --git a/docker/build/debian-9/Dockerfile b/docker/build/debian-9/Dockerfile index b3b575c9..0ed1bbee 100644 --- a/docker/build/debian-9/Dockerfile +++ b/docker/build/debian-9/Dockerfile @@ -39,11 +39,10 @@ RUN \ libwebkit2gtk-4.0-dev \ libwebkitgtk-dev \ libxtst-dev; \ - apt-get clean; + apt-get clean; # 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,8 +57,7 @@ WORKDIR ${HOME} RUN \ cd ${HOME}; \ mkdir -p ${HOME}/venvs; \ - virtualenv --python=python2.7 venvs/Py27; \ - python3.5 -m venv venvs/Py35; + python3.5 -m venv venvs/Py35; # Add files from host into the container COPY scripts ${HOME}/bin diff --git a/docker/build/fedora-29/Dockerfile b/docker/build/fedora-29/Dockerfile index 95705630..f6d8e5eb 100644 --- a/docker/build/fedora-29/Dockerfile +++ b/docker/build/fedora-29/Dockerfile @@ -24,8 +24,8 @@ RUN \ gstreamer1-devel \ gstreamer1-plugins-base-devel \ gtk3-devel \ - libjpeg-turbo-devel \ - libnotify-devel \ + libjpeg-turbo-devel \ + libnotify-devel \ libpng-devel \ libSM-devel \ libtiff-devel \ @@ -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,9 +50,8 @@ 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; + python3.7 -m venv venvs/Py37; # Add files from host into the container COPY scripts ${HOME}/bin diff --git a/docker/build/fedora-30/Dockerfile b/docker/build/fedora-30/Dockerfile index a47d20b0..75ec0de7 100644 --- a/docker/build/fedora-30/Dockerfile +++ b/docker/build/fedora-30/Dockerfile @@ -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,9 +49,8 @@ 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; + python3.7 -m venv venvs/Py37; # Add files from host into the container COPY scripts ${HOME}/bin diff --git a/docker/build/fedora-31/Dockerfile b/docker/build/fedora-31/Dockerfile index 3035a376..47170351 100644 --- a/docker/build/fedora-31/Dockerfile +++ b/docker/build/fedora-31/Dockerfile @@ -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; diff --git a/docker/build/ubuntu-14.04/Dockerfile b/docker/build/ubuntu-14.04/Dockerfile index 2556a26a..4630e0f0 100644 --- a/docker/build/ubuntu-14.04/Dockerfile +++ b/docker/build/ubuntu-14.04/Dockerfile @@ -41,13 +41,12 @@ RUN \ libwebkitgtk-3.0-dev \ libwebkitgtk-dev \ libxtst-dev; \ - apt-get clean; + apt-get clean; # 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,9 +61,8 @@ 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; + python3.6 -m venv venvs/Py36; # Add files from host into the container COPY scripts ${HOME}/bin diff --git a/docker/build/ubuntu-16.04/Dockerfile b/docker/build/ubuntu-16.04/Dockerfile index 81672534..218cdb33 100644 --- a/docker/build/ubuntu-16.04/Dockerfile +++ b/docker/build/ubuntu-16.04/Dockerfile @@ -39,13 +39,12 @@ RUN \ libwebkitgtk-3.0-dev \ libwebkitgtk-dev \ libxtst-dev; \ - apt-get clean; + apt-get clean; # 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; diff --git a/docker/build/ubuntu-18.04/Dockerfile b/docker/build/ubuntu-18.04/Dockerfile index c5174789..c9d2309c 100644 --- a/docker/build/ubuntu-18.04/Dockerfile +++ b/docker/build/ubuntu-18.04/Dockerfile @@ -44,12 +44,11 @@ RUN \ libwebkit2gtk-4.0-dev \ libwebkitgtk-dev \ libxtst-dev; \ - apt-get clean; + apt-get clean; # 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; diff --git a/docker/scripts/hello.sh b/docker/scripts/hello.sh index 8330c7ab..7502e98a 100755 --- a/docker/scripts/hello.sh +++ b/docker/scripts/hello.sh @@ -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 diff --git a/docker/tasks.py b/docker/tasks.py index aca5eb45..b5e9a498 100644 --- a/docker/tasks.py +++ b/docker/tasks.py @@ -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)