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

feat: add Django 5 support #20

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
needs: lint
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- name: Checkout
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ install-dev:
lint:
flake8 terraso_allauth tests && isort -c terraso_allauth tests

format: ${VIRTUAL_ENV}/scripts/black ${VIRTUAL_ENV}/scripts/isort
isort --atomic terraso_allauth tests
black terraso_allauth tests

lock: pip-tools
CUSTOM_COMPILE_COMMAND="make lock" pip-compile --upgrade --output-file requirements/requirements.txt requirements/requirements.in
CUSTOM_COMPILE_COMMAND="make lock" pip-compile --upgrade --output-file requirements/requirements-dj2.txt requirements/requirements-dj2.in
CUSTOM_COMPILE_COMMAND="make lock" pip-compile --upgrade --output-file requirements/requirements-dj3.txt requirements/requirements-dj3.in
CUSTOM_COMPILE_COMMAND="make lock" pip-compile --upgrade --output-file requirements/requirements-dj4.txt requirements/requirements-dj4.in
CUSTOM_COMPILE_COMMAND="make lock" pip-compile --upgrade --output-file requirements/requirements-dj5.txt requirements/requirements-dj5.in

lock-dev: pip-tools
CUSTOM_COMPILE_COMMAND="make lock-dev" pip-compile --upgrade --output-file requirements/requirements-dev.txt requirements/requirements-dev.in
Expand All @@ -20,5 +26,11 @@ pip-tools: ${VIRTUAL_ENV}/scripts/pip-sync
test-ci:
tox

${VIRTUAL_ENV}/scripts/black:
pip install black

${VIRTUAL_ENV}/scripts/isort:
pip install isort

${VIRTUAL_ENV}/scripts/pip-sync:
pip install pip-tools
3 changes: 3 additions & 0 deletions pyvenv.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
home = /Applications/Xcode.app/Contents/Developer/usr/bin
include-system-site-packages = false
version = 3.12
2 changes: 1 addition & 1 deletion requirements/requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ pytest-cov
pytest-django
responses
tox
tox-pyenv
virtualenv-pyenv
22 changes: 11 additions & 11 deletions requirements/requirements-dj2.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make lock
#
certifi==2023.7.22
certifi==2024.2.2
# via requests
cffi==1.15.0
cffi==1.16.0
# via cryptography
charset-normalizer==2.0.12
charset-normalizer==3.3.2
# via requests
cryptography==42.0.4
# via pyjwt
defusedxml==0.7.1
# via python3-openid
django==2.2.28
# via
# -r requirements-dj2.in
# -r requirements/requirements-dj2.in
# django-allauth
django-allauth==0.51.0
# via -r requirements-dj2.in
idna==3.3
django-allauth==0.54.0
# via -r requirements/requirements-dj2.in
idna==3.6
# via requests
oauthlib==3.2.2
# via requests-oauthlib
pycparser==2.21
# via cffi
pyjwt[crypto]==2.4.0
pyjwt[crypto]==2.8.0
# via
# django-allauth
# pyjwt
python3-openid==3.2.0
# via django-allauth
pytz==2022.1
pytz==2024.1
# via django
requests==2.31.0
# via
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-dj3.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Django>=3.0,<=3.2
Django>=3.0,<=4.0
django-allauth
26 changes: 12 additions & 14 deletions requirements/requirements-dj3.txt
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@
#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make lock
#
asgiref==3.5.2
asgiref==3.7.2
# via django
certifi==2023.7.22
certifi==2024.2.2
# via requests
cffi==1.15.0
cffi==1.16.0
# via cryptography
charset-normalizer==2.0.12
charset-normalizer==3.3.2
# via requests
cryptography==42.0.4
# via pyjwt
defusedxml==0.7.1
# via python3-openid
django==3.2
django==4.0
# via
# -r requirements-dj3.in
# -r requirements/requirements-dj3.in
# django-allauth
django-allauth==0.51.0
# via -r requirements-dj3.in
idna==3.3
django-allauth==0.61.1
# via -r requirements/requirements-dj3.in
idna==3.6
# via requests
oauthlib==3.2.2
# via requests-oauthlib
pycparser==2.21
# via cffi
pyjwt[crypto]==2.4.0
pyjwt[crypto]==2.8.0
# via
# django-allauth
# pyjwt
python3-openid==3.2.0
# via django-allauth
pytz==2022.1
# via django
requests==2.31.0
# via
# django-allauth
Expand Down
2 changes: 2 additions & 0 deletions requirements/requirements-dj4.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Django>=4.0,<=5.0
django-allauth
46 changes: 46 additions & 0 deletions requirements/requirements-dj4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make lock
#
asgiref==3.7.2
# via django
certifi==2024.2.2
# via requests
cffi==1.16.0
# via cryptography
charset-normalizer==3.3.2
# via requests
cryptography==42.0.2
# via pyjwt
defusedxml==0.7.1
# via python3-openid
django==4.0
# via
# -r requirements/requirements-dj3.in
# django-allauth
django-allauth==0.61.1
# via -r requirements/requirements-dj3.in
idna==3.6
# via requests
oauthlib==3.2.2
# via requests-oauthlib
pycparser==2.21
# via cffi
pyjwt[crypto]==2.8.0
# via
# django-allauth
# pyjwt
python3-openid==3.2.0
# via django-allauth
requests==2.31.0
# via
# django-allauth
# requests-oauthlib
requests-oauthlib==1.3.1
# via django-allauth
sqlparse==0.4.4
# via django
urllib3==2.2.0
# via requests
2 changes: 1 addition & 1 deletion requirements/requirements.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Django>4.0,<5.0
Django>=5.0,<=6.0
django-allauth
24 changes: 12 additions & 12 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make lock
#
asgiref==3.5.2
asgiref==3.7.2
# via django
certifi==2023.7.22
certifi==2024.2.2
# via requests
cffi==1.15.0
cffi==1.16.0
# via cryptography
charset-normalizer==2.0.12
charset-normalizer==3.3.2
# via requests
cryptography==42.0.4
# via pyjwt
defusedxml==0.7.1
# via python3-openid
django==4.0.5
django==4.2.10
# via
# -r requirements.in
# -r requirements/requirements.in
# django-allauth
django-allauth==0.51.0
# via -r requirements.in
idna==3.3
django-allauth==0.61.1
# via -r requirements/requirements.in
idna==3.6
# via requests
oauthlib==3.2.2
# via requests-oauthlib
pycparser==2.21
# via cffi
pyjwt[crypto]==2.4.0
pyjwt[crypto]==2.8.0
# via
# django-allauth
# pyjwt
Expand Down
2 changes: 1 addition & 1 deletion tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_adapter_loads_url_from_settings(settings):


def test_adapter_default_base_url(settings):
del(settings.SOCIALACCOUNT_PROVIDERS["terraso"]["SERVER_URL"])
del settings.SOCIALACCOUNT_PROVIDERS["terraso"]["SERVER_URL"]

assert TerrasoOAuth2Adapter(None).base_url == "https://api.terraso.org"

Expand Down
9 changes: 6 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
[tox]
envlist = py{38,39,310}-dj{2,3,4}
envlist = py{38,39,310,311,312}-dj{2,3,4,5}

[testenv]
usedevelop = true
deps =
py{38,39,310}: -rrequirements/requirements-dev.txt
py{38,39,310,311,312}: -rrequirements/requirements-dev.txt
dj{2}: -rrequirements/requirements-dj2.txt
dj{3}: -rrequirements/requirements-dj3.txt
dj{4}: -rrequirements/requirements.txt
dj{4}: -rrequirements/requirements-dj4.txt
dj{5}: -rrequirements/requirements.txt
commands = pytest

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312