Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Python 3.10 #245

Merged
merged 3 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ orbs:
jobs:
checkout-to-workspace:
docker:
- image: cimg/python:3.8.12-node
- image: cimg/python:3.10.4-node
steps:
- checkout
- persist_to_workspace:
Expand All @@ -15,7 +15,7 @@ jobs:
- .
build-flask:
docker:
- image: cimg/python:3.8.12
- image: cimg/python:3.10.4
working_directory: ~/back
steps:
- attach_workspace:
Expand All @@ -30,23 +30,23 @@ jobs:
python --version
pyenv virtualenvs
pyenv virtualenv --force env
source $(pyenv root)/versions/3.8.12/envs/env/bin/activate
source $(pyenv root)/versions/3.10.4/envs/env/bin/activate
pip install -e . -r requirements.txt
# Cache the installed packages
- save_cache:
key: webapp-deps-{{ checksum "requirements.txt" }}
paths:
- /home/circleci/.pyenv/versions/3.8.12/envs/env
- /home/circleci/.pyenv/versions/3.10.4/envs/env
# save build to a CircleCI workspace
- persist_to_workspace:
root: ~/
paths:
- back/*
- .pyenv/versions/3.8.12/envs
- .pyenv/versions/3.10.4/envs

build-and-test-react:
docker:
- image: cimg/python:3.8.12-node
- image: cimg/python:3.10.4-node
working_directory: ~/react
steps:
- attach_workspace:
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
# following https://circleci.com/docs/2.0/project-walkthrough/
test-flask:
docker:
- image: cimg/python:3.8.12
- image: cimg/python:3.10.4
- image: cimg/mysql:8.0.27
environment:
MYSQL_ROOT_PASSWORD: dropapp_root
Expand All @@ -118,17 +118,17 @@ jobs:
- run:
name: install dev dependencies for linting and testing
command: |
source $(pyenv root)/versions/3.8.12/envs/env/bin/activate
source $(pyenv root)/versions/3.10.4/envs/env/bin/activate
pip install -r requirements-dev.txt
- run:
name: run style checks on Python files
command: |
source $(pyenv root)/versions/3.8.12/envs/env/bin/activate
source $(pyenv root)/versions/3.10.4/envs/env/bin/activate
pre-commit run --files **/*.py
- save_cache:
key: webapp-dev-deps-{{ checksum "requirements-dev.txt" }}-{{ checksum "../.pre-commit-config.yaml" }}
paths:
- /home/circleci/.pyenv/versions/3.8.12/envs/env
- /home/circleci/.pyenv/versions/3.10.4/envs/env
- ~/.cache/pre-commit
# https://circleci.com/docs/2.0/postgres-config/#example-mysql-project
- run:
Expand All @@ -151,7 +151,7 @@ jobs:
- run:
name: Run pytest
command: |
source $(pyenv root)/versions/3.8.12/envs/env/bin/activate
source $(pyenv root)/versions/3.10.4/envs/env/bin/activate
pytest --cov-report xml:test-results/coverage.xml --cov=boxtribute_server
- store_test_results:
path: test-results
Expand All @@ -168,7 +168,7 @@ jobs:
serviceName:
type: string
docker:
- image: cimg/python:3.8.12-node
- image: cimg/python:3.10.4-node
working_directory: ~/back
steps:
# Attach workspace from build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Here, is a list of intro tutorials for each technologies / frameworks / language

- [GraphQL](https://graphql.org/learn/)
- [Ariadne](https://ariadnegraphql.org/docs/flask-integration.html)
- [Python 3.X](https://devguide.python.org/)
- [Python 3.10](https://devguide.python.org/)
- [Flask](https://flask.palletsprojects.com/en/1.1.x/tutorial/layout/)
- [PeeWee](http://docs.peewee-orm.com/en/latest/peewee/quickstart.html)
- MySQL
Expand Down
2 changes: 1 addition & 1 deletion back/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG flask_env

# using alpine for smallest docker image
FROM python:3.8-alpine AS base
FROM python:3.10.4-alpine3.15 AS base

WORKDIR /app/back
# install packages separately to use docker build-caching so we don't need to
Expand Down
2 changes: 1 addition & 1 deletion back/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The following steps build on top of each other and have to be performed in corre

### Install python

Install [Python >=3.6](https://www.python.org/downloads/) on your computer. You will need it to run tests on the back-end and the formatters and linters on both back-end and front-end.
Install [Python >=3.10](https://www.python.org/downloads/) on your computer. You will need it to run tests on the back-end and the formatters and linters on both back-end and front-end.

### Create a Python virtual environment

Expand Down
2 changes: 1 addition & 1 deletion back/app.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
runtime: python38
runtime: python310
service: v2-staging
entrypoint: gunicorn -b :$PORT
handlers:
Expand Down
4 changes: 2 additions & 2 deletions back/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
black==22.3.0
flake8==4.0.1
isort==5.10.1
pre-commit==2.17.0
pre-commit==2.19.0
pytest>=5.4.3
pytest-mock==3.6.1
pytest-mock==3.8.1
pytest-cov==3.0.0
4 changes: 2 additions & 2 deletions back/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ariadne==0.14.1
Flask==2.0.3
ariadne==0.15.1
Flask==2.1.2
Flask-Cors==3.0.10
PyMySQL==1.0.2
peewee==3.14.10
Expand Down
4 changes: 2 additions & 2 deletions back/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
organisations to source, store and distribute donated goods to people in
need in a fair and dignified way.""",
url="https://github.com/boxwise/boxtribute",
author="boxwise.co",
author_email="hello@boxwise.co",
author="Stichting Boxwise",
author_email="hello@boxtribute.org",
license="Apache 2.0",
packages=find_packages(exclude=["test"]),
install_requires=REQUIREMENTS,
Expand Down