Skip to content

Commit 29c52e5

Browse files
JoeyRubasCopilot
andcommitted
Python 3.10 (#370)
Switched to python 3.10. Updated tests, docker images, circle Ci and some dependencies. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent ae3ce90 commit 29c52e5

24 files changed

Lines changed: 530 additions & 628 deletions

.circleci/config.yml

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
version: 2.1
22
orbs:
33
codecov: codecov/codecov@1.0.4
4+
browser-tools: circleci/browser-tools@1.5.3
45
jobs:
56
build:
67
docker:
7-
- image: circleci/python:3.7.10-node-browsers
8+
- image: cimg/python:3.10.16-node
89
environment:
910
TEST_BROWSER: chrome
1011
MYSQL_PASSWORD: secret
1112
MITTAB_DB_HOST: 127.0.0.1
1213
PIPENV_VENV_IN_PROJECT: true
13-
- image: circleci/mysql:5.7
14+
- image: cimg/mysql:5.7
1415
environment:
1516
MYSQL_ROOT_PASSWORD: secret
1617
MYSQL_DATABASE: mittab
@@ -23,28 +24,26 @@ jobs:
2324
steps:
2425
- checkout
2526
- restore_cache:
26-
key: deps-v2-{{ checksum "Pipfile.lock" }}
27-
- run:
28-
name: Fix EOL Debian Buster APT sources
29-
command: |
30-
sudo sed -i 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g' /etc/apt/sources.list
31-
sudo sed -i 's|http://security.debian.org/debian-security|http://archive.debian.org/debian-security|g' /etc/apt/sources.list
32-
echo 'Acquire::Check-Valid-Until "false";' | sudo tee /etc/apt/apt.conf.d/99no-check-valid
33-
sudo apt-get -o Acquire::Check-Valid-Until=false update
27+
key: deps-v3-3.10.16-{{ checksum "Pipfile.lock" }}
28+
29+
- browser-tools/install-chrome
30+
- browser-tools/install-chromedriver
3431
- run:
3532
name: install dependencies
3633
command: |
3734
sudo apt-get update
38-
sudo apt-get upgrade -y
3935
sudo apt-get install -y default-mysql-client
40-
sudo pip install pipenv
36+
python -m pip install --upgrade pip
37+
python -m pip install --user pipenv
38+
rm -rf .venv
39+
pipenv --python 3.10.16
4140
pipenv install
4241
npm install
4342
4443
- save_cache:
4544
paths:
4645
- .venv
47-
key: deps-v2-{{ checksum "Pipfile.lock" }}
46+
key: deps-v3-3.10.16-{{ checksum "Pipfile.lock" }}
4847

4948
- run:
5049
# Our primary container isn't MYSQL so run a sleep command until it's ready.
@@ -80,33 +79,29 @@ jobs:
8079
file: ./cov.xml
8180
lint:
8281
docker:
83-
- image: circleci/python:3.7.10-node-browsers
82+
- image: cimg/python:3.10.16-node
8483
environment:
8584
PIPENV_VENV_IN_PROJECT: true
8685
steps:
8786
- checkout
8887
- restore_cache:
89-
key: deps-v2-{{ checksum "Pipfile.lock" }}
90-
- run:
91-
name: Fix EOL Debian Buster APT sources
92-
command: |
93-
sudo sed -i 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g' /etc/apt/sources.list
94-
sudo sed -i 's|http://security.debian.org/debian-security|http://archive.debian.org/debian-security|g' /etc/apt/sources.list
95-
echo 'Acquire::Check-Valid-Until "false";' | sudo tee /etc/apt/apt.conf.d/99no-check-valid
96-
sudo apt-get -o Acquire::Check-Valid-Until=false update
88+
key: deps-v3-3.10.16-{{ checksum "Pipfile.lock" }}
9789
- run:
9890
name: install dependencies
9991
command: |
10092
sudo apt-get update
101-
sudo apt-get upgrade -y
10293
sudo apt-get install -y default-mysql-client
103-
sudo pip install pipenv
94+
python -m pip install --upgrade pip
95+
python -m pip install --user pipenv
96+
# Remove .venv if it exists from cache to avoid version mismatch
97+
rm -rf .venv
98+
pipenv --python 3.10.16
10499
pipenv install
105100
npm install
106101
- save_cache:
107102
paths:
108103
- .venv
109-
key: deps-v2-{{ checksum "Pipfile.lock" }}
104+
key: deps-v3-3.10.16-{{ checksum "Pipfile.lock" }}
110105
- run:
111106
name: Lint -- Python
112107
command: |

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ mittab/backups/
5151
*.sqlite3-journal
5252

5353
# venv
54-
venv/
54+
venv*/
55+
56+
# IDEs
57+
.vscode
5558

5659
# doc stuff
5760
docs/_static/
@@ -122,3 +125,4 @@ typings/
122125
.env
123126

124127
*.dump.sql
128+
.vscode/

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.13
1+
3.10.16

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
FROM python:3.7
1+
FROM python:3.10
22

33
# install dependenices
4+
ARG DOCTL_VERSION=1.120.0
5+
46
RUN apt-get update && \
57
apt-get upgrade -y && \
6-
apt-get install -y vim default-mysql-client
8+
apt-get install -y vim default-mysql-client openssl curl && \
9+
curl -sSL https://github.com/digitalocean/doctl/releases/download/v${DOCTL_VERSION}/doctl-${DOCTL_VERSION}-linux-amd64.tar.gz \
10+
| tar -xz -C /usr/local/bin doctl
711

812
WORKDIR /var/www/tab
913

Dockerfile.static

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.7
1+
FROM python:3.10
22

33
# sets up nodejs to install npm
44
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash

Dockerfile.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM circleci/python:3.7.3-node-browsers
1+
FROM circleci/python:3.10-node-browsers
22

33
RUN sudo apt-get update
44
RUN sudo apt-get upgrade -y

Dockerfile.web

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.7
1+
FROM python:3.10
22

33
# install dependenices
44
RUN apt-get update && apt-get upgrade -y && \

Pipfile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,26 @@ boto3 = "*"
1212
django-bootstrap4 = "==3.0.0"
1313
django-webpack-loader = "==0.6.0"
1414
django-silk = "*"
15-
gunicorn = "==19.7.1"
15+
gunicorn = "==23.0.0"
1616
mysqlclient = "==1.4.4"
1717
xlrd = "==0.9.4"
1818
xlwt = "==1.3.0"
1919
pylint = "==2.3.1"
2020
pylint-django = "==2.0.9"
2121
pylint-quotes = "==0.2.1"
22-
pytest = "==4.4.1"
22+
pytest = "==7.4.2"
2323
pytest-circleci-parallelized = "==0.0.4"
24-
pytest-cov = "==2.7.1"
25-
pytest-django = "==3.4.8"
24+
pytest-cov = "==4.1.0"
25+
pytest-django = "==4.8.0"
2626
requests = "==2.31.0"
27-
selenium = "==3.141.0"
28-
splinter = "==0.10.0"
27+
selenium = "==4.15.2"
28+
splinter = "==0.19.0"
2929
Django = "==3.2.25"
3030
PyYAML = "==5.1.2"
3131
sentry-sdk = {extras = ["django"], version = "*"}
32+
six = "==1.17.0"
33+
exceptiongroup = "*"
34+
wrapt = "*"
3235

3336
[requires]
34-
python_version = "3.7"
37+
python_version = "3.10.16"

0 commit comments

Comments
 (0)