From 361d4f894e9f1c3dd844d4b2c0a920788df67f29 Mon Sep 17 00:00:00 2001 From: Abigail G Date: Wed, 17 Mar 2021 23:10:57 -0400 Subject: [PATCH] bump python to <=3.9, bump d.py to ~=1.6.0 fixes #361 --- .github/workflows/linting.yml | 2 +- CHANGELOG.md | 1 + DEVELOPING.md | 2 +- Dockerfile | 31 ++++++++----------------------- Makefile | 2 +- README.md | 2 +- requirements.txt | 2 +- run.sh | 4 ++-- 8 files changed, 16 insertions(+), 30 deletions(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 7969270..4e451e1 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -9,7 +9,7 @@ jobs: - uses: actions/checkout@master - uses: actions/setup-python@v1 with: - python-version: 3.7 + python-version: 3.9 architecture: x64 - name: Install flake8 run: pip install flake8 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1929293..732e753 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Renamed `?cond` to `?solar`. - Reduced `?hamstudy` timeout to 5 minutes. - Library used for QRZ lookups. +- Python>=3.9 now required. ### Fixed - Weird image caching situation for `?greyline` on Discord's side. - The help command was not using the prefix it was invoked with. diff --git a/DEVELOPING.md b/DEVELOPING.md index e3d824c..d22f4e9 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -7,7 +7,7 @@ 1. [Fork this repo][1] into your own GitHub namespace. 1. Make sure the `master` branch is up to date, then make yourself a new branch with a descriptive name. 1. Once the forked repo is cloned and on the proper branch, you can set up the development environment. - 1. Install python 3.7 or higher. + 1. Install python 3.9 or higher. 1. Run `make dev-install`. This should install everything you need to develop and run qrm. 1. [Create a bot and token][2], and add it to `data/keys.py`. diff --git a/Dockerfile b/Dockerfile index 2f4b351..8485a3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.10 +FROM python:3.9-slim COPY . /app WORKDIR /app @@ -6,35 +6,20 @@ WORKDIR /app ENV PYTHON_BIN python3 RUN \ - echo "**** install build packages ****" && \ - apk add --no-cache --virtual=build-dependencies \ - g++ \ - git \ - gcc \ - libxml2-dev \ - libxslt-dev \ - libressl-dev \ - libffi-dev \ - jpeg-dev \ - zlib-dev \ - python3-dev && \ + apt-get update && \ echo "**** install runtime packages ****" && \ - apk add --no-cache \ - libressl \ - cairo \ - libjpeg-turbo \ - py3-lxml \ - py3-pip \ - python3 && \ + apt-get install -y --no-install-recommends \ + libcairo2 \ + libjpeg62-turbo \ + python-lxml \ + && \ echo "**** install pip packages ****" && \ pip3 install -U pip setuptools wheel && \ pip3 install -r requirements.txt && \ echo "**** clean up ****" && \ - apk del --purge \ - build-dependencies && \ rm -rf \ /root/.cache \ /tmp/* \ - /var/cache/apk/* + /var/lib/apt/lists/* CMD ["/bin/sh", "run.sh", "--pass-errors", "--no-botenv"] diff --git a/Makefile b/Makefile index 62be00f..c44433c 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ # Those are the defaults; they can be over-ridden if specified # at en environment level or as 'make' arguments. BOTENV ?= botenv -PYTHON_BIN ?= python3.7 +PYTHON_BIN ?= python3.9 PIP_OUTPUT ?= -q diff --git a/README.md b/README.md index b125ea1..e2e5056 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ See [README-DOCKER.md](./README-DOCKER.md) ### Without Docker -Requires Python 3.7 or newer. +Requires Python 3.9 or newer. Prep the environment. For more information on extra options, see the [quick-bot-no-pain Makefile documentation](https://github.com/0x5c/quick-bot-no-pain/blob/master/docs/makefile.md). diff --git a/requirements.txt b/requirements.txt index 80d0097..5b28175 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -discord.py~=1.5.0 +discord.py~=1.6.0 ctyparser~=2.0 gridtools~=1.0 qrztools[async]~=1.0 diff --git a/run.sh b/run.sh index cf1d67b..7e18840 100644 --- a/run.sh +++ b/run.sh @@ -34,9 +34,9 @@ while [ ! -z "$1" ]; do done -# If $PYTHON_BIN is not defined, default to 'python3.7' +# If $PYTHON_BIN is not defined, default to 'python3.9' if [ $_NO_BOTENV -eq 1 -a -z "$PYTHON_BIN" ]; then - PYTHON_BIN='python3.7' + PYTHON_BIN='python3.9' fi