diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e56efe..216c391 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/Makefile b/Makefile index e518478..a3e5660 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 diff --git a/pyvenv.cfg b/pyvenv.cfg new file mode 100644 index 0000000..fa3dd1e --- /dev/null +++ b/pyvenv.cfg @@ -0,0 +1,3 @@ +home = /Applications/Xcode.app/Contents/Developer/usr/bin +include-system-site-packages = false +version = 3.12 diff --git a/requirements/requirements-dev.in b/requirements/requirements-dev.in index ebf0483..7441407 100644 --- a/requirements/requirements-dev.in +++ b/requirements/requirements-dev.in @@ -7,4 +7,4 @@ pytest-cov pytest-django responses tox -tox-pyenv \ No newline at end of file +virtualenv-pyenv diff --git a/requirements/requirements-dj2.txt b/requirements/requirements-dj2.txt index a23f8a4..29e22ba 100644 --- a/requirements/requirements-dj2.txt +++ b/requirements/requirements-dj2.txt @@ -1,14 +1,14 @@ # -# 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 @@ -16,23 +16,23 @@ 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 diff --git a/requirements/requirements-dj3.in b/requirements/requirements-dj3.in index 2fd2f77..4c065a4 100644 --- a/requirements/requirements-dj3.in +++ b/requirements/requirements-dj3.in @@ -1,2 +1,2 @@ -Django>=3.0,<=3.2 +Django>=3.0,<=4.0 django-allauth diff --git a/requirements/requirements-dj3.txt b/requirements/requirements-dj3.txt index 66eea26..3c3dc67 100644 --- a/requirements/requirements-dj3.txt +++ b/requirements/requirements-dj3.txt @@ -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 diff --git a/requirements/requirements-dj4.in b/requirements/requirements-dj4.in new file mode 100644 index 0000000..cb9ad58 --- /dev/null +++ b/requirements/requirements-dj4.in @@ -0,0 +1,2 @@ +Django>=4.0,<=5.0 +django-allauth diff --git a/requirements/requirements-dj4.txt b/requirements/requirements-dj4.txt new file mode 100644 index 0000000..860d372 --- /dev/null +++ b/requirements/requirements-dj4.txt @@ -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 diff --git a/requirements/requirements.in b/requirements/requirements.in index f9cb2d0..2416060 100644 --- a/requirements/requirements.in +++ b/requirements/requirements.in @@ -1,2 +1,2 @@ -Django>4.0,<5.0 +Django>=5.0,<=6.0 django-allauth diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 623b479..d689a21 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -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 diff --git a/tests/test_views.py b/tests/test_views.py index cd311c6..faa8a72 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -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" diff --git a/tox.ini b/tox.ini index c6c7519..028af47 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,14 @@ [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] @@ -15,3 +16,5 @@ python = 3.8: py38 3.9: py39 3.10: py310 + 3.11: py311 + 3.12: py312