Skip to content

Commit

Permalink
Django update to 3.2, Python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
stolpeo committed Feb 1, 2024
1 parent a95e73b commit 1d8f0d8
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 42 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ jobs:
with:
conda-channels: defaults,bioconda,conda-forge
- name: Install mamba.
run: conda install -y mamba python=3.8
run: conda install -y mamba
- name: Install the cadd-scripts package from bioconda
run: mamba install -y cadd-scripts

- name: Checkout repository
uses: actions/checkout@v2
- name: Install project Python dependencies
run: |
pip install -r requirements/base.txt
pip install -r requirements/test.txt
pip install -r requirements/production.txt
- name: Run tests
run: |
coverage run --rcfile=.coveragerc manage.py test -v 2 --settings=config.settings.test
Expand Down
39 changes: 19 additions & 20 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
pytz==2019.2 # https://github.com/stub42/pytz
python-slugify==3.0.3 # https://github.com/un33k/python-slugify
Pillow==6.1.0 # https://github.com/python-pillow/Pillow
argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi
redis==3.3.8 # https://github.com/antirez/redis
celery==4.3.1 # pyup: < 5.0 # https://github.com/celery/celery
django-celery-beat==1.5.0 # https://github.com/celery/django-celery-beat
pytz
python-slugify
Pillow
argon2-cffi
redis
celery

Werkzeug==0.14.1 # pyup: < 0.15 # https://github.com/pallets/werkzeug
Sphinx==2.2.0 # https://github.com/sphinx-doc/sphinx
Werkzeug
Sphinx

# Django
# ------------------------------------------------------------------------------
django<2.0 # pyup: < 3.0 # https://www.djangoproject.com/
django-environ==0.4.5 # https://github.com/joke2k/django-environ
django-model-utils==3.2.0 # https://github.com/jazzband/django-model-utils
django-allauth==0.40.0 # https://github.com/pennersr/django-allauth
django-crispy-forms==1.7.2 # https://github.com/django-crispy-forms/django-crispy-forms
django-redis==4.10.0 # https://github.com/niwinz/django-redis
django-debug-toolbar==2.0 # https://github.com/jazzband/django-debug-toolbar
django==3.2
django-environ
django-model-utils
django-allauth
django-crispy-forms
django-redis
django-debug-toolbar

# Django REST Framework
djangorestframework==3.10.3 # https://github.com/encode/django-rest-framework
coreapi==2.3.3 # https://github.com/core-api/python-client
djangorestframework
coreapi

jsonfield==2.1.1
ipdb==0.12.2 # https://github.com/gotcha/ipdb
jsonfield
ipdb
6 changes: 3 additions & 3 deletions requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

-r ./base.txt

gunicorn==19.9.0 # https://github.com/benoitc/gunicorn
Collectfast==1.0.0 # https://github.com/antonagestam/collectfast
gunicorn
Collectfast

# Django
# ------------------------------------------------------------------------------
django-anymail[mailgun]==6.1.0 # https://github.com/anymail/django-anymail
django-anymail[mailgun]
25 changes: 13 additions & 12 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@

# Testing
# ------------------------------------------------------------------------------
mypy==0.720 # https://github.com/python/mypy
pytest==5.1.2 # https://github.com/pytest-dev/pytest
pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar
mypy
pytest
pytest-sugar

# Code quality
# ------------------------------------------------------------------------------
flake8==3.7.8 # https://github.com/PyCQA/flake8
coverage==4.5.4 # https://github.com/nedbat/coveragepy
black==22.3.0 # https://github.com/ambv/black
pylint-django==2.0.11 # https://github.com/PyCQA/pylint-django
pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery
flake8
coverage
black
pylint-django
pylint-celery

# Django
# ------------------------------------------------------------------------------
factory-boy==2.12.0 # https://github.com/FactoryBoy/factory_boy
factory-boy

django-extensions==2.2.1 # https://github.com/django-extensions/django-extensions
django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin
pytest-django==3.5.1 # https://github.com/pytest-dev/pytest-django
django-extensions
django-coverage-plugin
django-test-plus
pytest-django
2 changes: 1 addition & 1 deletion restapi/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from unittest.mock import patch
import uuid

from django.test import TestCase
from test_plus.test import TestCase
from django.urls import reverse

from restapi.models import AnnotateBackgroundJob
Expand Down
2 changes: 1 addition & 1 deletion restapi/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def post(self, *args, **kwargs):
"genome_build": genomebuild,
"cadd_release": self.request.data.get("cadd_release"),
"variants": [
var for var in self.request.data.getlist("variant") if re.search(RE_VAR, var)
var for var in self.request.data.get("variant") if re.search(RE_VAR, var)
],
}
try:
Expand Down
2 changes: 1 addition & 1 deletion utils/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Base
# ---------------------------------------------------------------------------

FROM python:3.8 AS base
FROM python:3.10-bookworm AS base

ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
Expand Down
3 changes: 2 additions & 1 deletion utils/docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ if [[ "$1" == wsgi ]]; then
elif [[ "$1" == celeryd ]]; then
cd $APP_DIR

exec celery worker \
exec celery \
--app config.celery_app \
worker \
-Q "${CELERY_QUEUES}" \
--concurrency "${CELERY_WORKERS}" \
--loglevel info
Expand Down

0 comments on commit 1d8f0d8

Please sign in to comment.