From 8e92d48bf048a5b0918ca50a1b068a05ddd6b4b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 7 May 2020 10:14:58 +0200 Subject: [PATCH] :fire: Remove support for Python 3.5 --- .github/workflows/deploy.yml | 2 -- .github/workflows/test.yml | 2 -- README.md | 5 ++--- docker-images/python3.5.dockerfile | 35 ------------------------------ scripts/process_all.py | 7 +++--- 5 files changed, 5 insertions(+), 46 deletions(-) delete mode 100644 docker-images/python3.5.dockerfile diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 478f44b7..cf7516c4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,8 +16,6 @@ jobs: python_version: "3.7" - name: python3.6 python_version: "3.6" - - name: python3.5 - python_version: "3.5" - name: python2.7 python_version: "2.7" - name: python3.6-alpine3.8 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 28d628ee..a78d8b04 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,8 +16,6 @@ jobs: python_version: "3.7" - name: python3.6 python_version: "3.6" - - name: python3.5 - python_version: "3.5" - name: python2.7 python_version: "2.7" - name: python3.6-alpine3.8 diff --git a/README.md b/README.md index 5d5af246..759a47b5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ * [`python3.6` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python3.6.dockerfile) * [`python3.6-alpine3.8` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python3.6-alpine3.8.dockerfile) * [`python3.6-alpine3.7` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python3.6-alpine3.7.dockerfile) -* [`python3.5` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python3.5.dockerfile) * [`python2.7` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python2.7.dockerfile) * [`python2.7-alpine3.8` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python2.7-alpine3.8.dockerfile) * [`python2.7-alpine3.7` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python2.7-alpine3.7.dockerfile) @@ -21,7 +20,7 @@ It doesn't depend on this image but on uWSGI releases for Alpine. # uwsgi-nginx-flask -**Docker** image with **uWSGI** and **Nginx** for **Flask** web applications in **Python 3.5** and above, and **Python 2.7** running in a single container. Optionally using Alpine Linux. +**Docker** image with **uWSGI** and **Nginx** for **Flask** web applications in **Python 3.6** and above, and **Python 2.7** running in a single container. Optionally using Alpine Linux. ## Description @@ -82,7 +81,7 @@ FROM tiangolo/uwsgi-nginx-flask:python3.7 COPY ./app /app ``` -There are several image tags available for Python 3.7, Python 3.6, Python 3.5 and Python 2.7, but for new projects you should use **Python 3.7**. +There are several image tags available for Python 3.6 and above, and Python 2.7, but for new projects you should use the latest version available. As of now, [everyone](https://www.python.org/dev/peps/pep-0373/) [should be](http://flask.pocoo.org/docs/0.12/python3/#python3-support) [using **Python 3**](https://docs.djangoproject.com/en/1.11/faq/install/#what-python-version-should-i-use-with-django). diff --git a/docker-images/python3.5.dockerfile b/docker-images/python3.5.dockerfile deleted file mode 100644 index 4d7e3b6c..00000000 --- a/docker-images/python3.5.dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM tiangolo/uwsgi-nginx:python3.5 - -LABEL maintainer="Sebastian Ramirez " - -RUN pip install flask - -# URL under which static (not modified by Python) files will be requested -# They will be served by Nginx directly, without being handled by uWSGI -ENV STATIC_URL /static -# Absolute path in where the static files wil be -ENV STATIC_PATH /app/static - -# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured) -# ENV STATIC_INDEX 1 -ENV STATIC_INDEX 0 - -# Add demo app -COPY ./app /app -WORKDIR /app - -# Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. -ENV PYTHONPATH=/app - -# Move the base entrypoint to reuse it -RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh -# Copy the entrypoint that will generate Nginx additional configs -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] - -# Run the start script provided by the parent image tiangolo/uwsgi-nginx. -# It will check for an /app/prestart.sh script (e.g. for migrations) -# And then will start Supervisor, which in turn will start Nginx and uWSGI -CMD ["/start.sh"] diff --git a/scripts/process_all.py b/scripts/process_all.py index 08567962..edb504ce 100644 --- a/scripts/process_all.py +++ b/scripts/process_all.py @@ -6,7 +6,6 @@ {"NAME": "latest", "PYTHON_VERSION": "3.7"}, {"NAME": "python3.7", "PYTHON_VERSION": "3.7"}, {"NAME": "python3.6", "PYTHON_VERSION": "3.6"}, - {"NAME": "python3.5", "PYTHON_VERSION": "3.5"}, {"NAME": "python2.7", "PYTHON_VERSION": "2.7"}, {"NAME": "python3.6-alpine3.8", "PYTHON_VERSION": "3.6"}, {"NAME": "python3.6-alpine3.7", "PYTHON_VERSION": "3.6"}, @@ -18,7 +17,7 @@ build_push = os.environ.get("BUILD_PUSH") -def process_tag(*, env: dict): +def process_tag(*, env: dict) -> None: use_env = {**os.environ, **env} script = "scripts/test.sh" if build_push: @@ -28,7 +27,7 @@ def process_tag(*, env: dict): sys.exit(return_code) -def print_version_envs(): +def print_version_envs() -> None: env_lines = [] for env in environments: env_vars = [] @@ -39,7 +38,7 @@ def print_version_envs(): print(line) -def main(): +def main() -> None: start_at = 0 if start_with: start_at = [