Skip to content

Commit 6ebd264

Browse files
authored
update supported versions and prepare release (#233)
1 parent d32fb53 commit 6ebd264

13 files changed

+101
-67
lines changed

.circleci/config.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ workflows:
77
name: test-py<< matrix.python >>-dj<< matrix.django >>
88
matrix:
99
parameters:
10-
python: ["3.10", "3.9"]
11-
django: ["4.1", "4.0", "3.2"]
10+
python: ["3.12", "3.11", "3.10"]
11+
django: ["4.2", "4.1", "3.2"]
1212
- check
1313

1414
jobs:
@@ -21,7 +21,7 @@ jobs:
2121
type: string
2222
docker:
2323
- image: cimg/python:<< parameters.python >>
24-
- image: cimg/postgres:14.0
24+
- image: cimg/postgres:15.5
2525
environment:
2626
POSTGRES_DB: circle_test
2727
POSTGRES_USER: testapp
@@ -50,8 +50,8 @@ jobs:
5050
- when:
5151
condition:
5252
and:
53-
- equal: [<< parameters.python >>, "3.10"]
54-
- equal: [<< parameters.django >>, "4.0"]
53+
- equal: [<< parameters.python >>, "3.12"]
54+
- equal: [<< parameters.django >>, "4.2"]
5555
steps:
5656
- run:
5757
name: Check coverage with Python << parameters.python >>
@@ -66,12 +66,12 @@ jobs:
6666

6767
check:
6868
docker:
69-
- image: cimg/python:3.10
69+
- image: cimg/python:3.12
7070
working_directory: ~/rest-auth-toolkit
7171
steps:
7272
- checkout
7373
- restore_cache:
74-
key: check-v2
74+
key: check-v3
7575
- run:
7676
name: Install CI tools
7777
command: |
@@ -81,7 +81,7 @@ jobs:
8181
name: Check packaging and dependencies
8282
command: venv/bin/tox -e pkg
8383
- save_cache:
84-
key: check-v2
84+
key: check-v3
8585
paths:
8686
- venv
8787
- .tox

CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Changelog for Rest-Framework-Auth-Toolkit
22

3-
## v0.13 (unreleased)
3+
## v0.13
4+
5+
Tested with Python 3.10, 3.11 and 3.12,
6+
and Django 3.2, 4.1 and 4.2.
47

58

69
## v0.12

README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ See the [changelog](CHANGELOG.md) for breaking changes.
3434
To run tests:
3535

3636
```
37-
export DATABASE_URL=postgres://ratk@localhost:5432/ratk
37+
export DATABASE_URL=postgres://ratk:ktar@localhost:5432/ratk
3838
tox
3939
```
4040

41-
You will have to create the `ratk` role first, as well as
42-
the `ratk` and `test_ratk` databases.
41+
You will have to create the `ratk` role first, for example using psql:
42+
43+
```
44+
create role ratk login createdb;
45+
alter role rath with password encrypted 'ktar';
46+
```

demo/README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,27 @@ cd demo
2424
pip install -r requirements.txt
2525
```
2626

27+
Finally, you'll need to create the database (only once), for example
28+
using psql:
29+
30+
```
31+
create database ratk with owner ratk;
32+
```
33+
2734
# How to run
2835

2936
Define the environment variables needed by the app:
3037

3138
```
32-
export DATABASE_URL=postgres://restauth@localhost:5432/demo
39+
export DATABASE_URL=postgres://restauth:password@localhost:5432/demo
3340
export DEMO_FACEBOOK_APP_ID="..."
3441
export DEMO_FACEBOOK_APP_SECRET_KEY="..."
3542
```
3643

3744
(using a [virtualenvwrapper hook](https://virtualenvwrapper.readthedocs.io/en/latest/scripts.html#postactivate)
3845
or a `.env` file with [direnv](https://direnv.net/) is a good ideae to make this automatic)
3946

40-
You can then run Django commands (from the `demo` directory):
47+
You can then run Django commands (still inside the `demo` directory):
4148

4249
```
4350
python manage.py migrate
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Django 4.2.10 on 2024-02-26 00:33
2+
3+
from django.db import migrations
4+
import shortuuid.django_fields
5+
6+
7+
class Migration(migrations.Migration):
8+
dependencies = [
9+
("accounts", "0005_auto_20210511_1956"),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name="emailconfirmation",
15+
name="external_id",
16+
field=shortuuid.django_fields.ShortUUIDField(
17+
alphabet=None, length=22, max_length=22, prefix=""
18+
),
19+
),
20+
]

demo/demo/accounts/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from model_utils.fields import AutoCreatedField
66
from model_utils.models import TimeStampedModel
7-
from shortuuidfield import ShortUUIDField
7+
from shortuuid.django_fields import ShortUUIDField
88

99
from rest_auth_toolkit.managers import BaseEmailUserManager
1010
from rest_auth_toolkit.models import BaseEmailUser, BaseAPIToken, BaseEmailConfirmation

demo/requirements.in

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
flit
2-
pip-tools == 6.10.*
2+
pip-tools == 7.4.*
33

4-
django == 4.0.*
4+
django == 4.2.*
55
djangorestframework
66
django-debug-toolbar
77
dj-database-url
88
psycopg2
99

1010
django-model-utils
11-
django-shortuuidfield
11+
shortuuid
1212

13-
# TODO add editable install for rest-framework-auth-toolkit
14-
# (when supported by pip and pip-compile); see README for how to install rest-auth-toolkit
15-
#-e ..[facebook]
16-
# In the meantime we include facepy here to make sure requirements.txt
13+
# we can't add "-e ..[facebook]" here in a way that works correctly in the
14+
# pinned requirements file, so we include facepy to make sure requirements.txt
1715
# contains all transitive dependencies
1816
facepy
1917

2018
# API docs
2119
coreapi
2220
markdown
2321
pygments
22+
23+
# old dependency retained to keep migrations working
24+
django-shortuuidfield

demo/requirements.txt

+30-31
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,46 @@
11
#
2-
# This file is autogenerated by pip-compile with python 3.10
3-
# To update, run:
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
44
#
55
# pip-compile --annotation-style=line requirements.in
66
#
7-
asgiref==3.5.2 # via django
8-
build==0.9.0 # via pip-tools
9-
certifi==2022.9.24 # via requests
10-
charset-normalizer==2.1.1 # via requests
11-
click==8.1.3 # via pip-tools
7+
asgiref==3.7.2 # via django
8+
build==1.0.3 # via pip-tools
9+
certifi==2024.2.2 # via requests
10+
charset-normalizer==3.3.2 # via requests
11+
click==8.1.7 # via pip-tools
1212
coreapi==2.3.3 # via -r requirements.in
1313
coreschema==0.0.4 # via coreapi
14-
dj-database-url==1.0.0 # via -r requirements.in
15-
django==4.0.8 # via -r requirements.in, dj-database-url, django-debug-toolbar, django-model-utils, django-shortuuidfield, djangorestframework
16-
django-debug-toolbar==3.7.0 # via -r requirements.in
17-
django-model-utils==4.3.1 # via -r requirements.in
14+
dj-database-url==2.1.0 # via -r requirements.in
15+
django==4.2.10 # via -r requirements.in, dj-database-url, django-debug-toolbar, django-model-utils, django-shortuuidfield, djangorestframework
16+
django-debug-toolbar==4.3.0 # via -r requirements.in
17+
django-model-utils==4.4.0 # via -r requirements.in
1818
django-shortuuidfield==0.1.3 # via -r requirements.in
1919
djangorestframework==3.14.0 # via -r requirements.in
20-
docutils==0.19 # via flit
20+
docutils==0.20.1 # via flit
2121
facepy==1.0.12 # via -r requirements.in
22-
flit==3.8.0 # via -r requirements.in
23-
flit-core==3.8.0 # via flit
24-
idna==3.4 # via requests
22+
flit==3.9.0 # via -r requirements.in
23+
flit-core==3.9.0 # via flit
24+
idna==3.6 # via requests
2525
itypes==1.2.0 # via coreapi
26-
jinja2==3.1.2 # via coreschema
27-
markdown==3.4.1 # via -r requirements.in
28-
markupsafe==2.1.1 # via jinja2
29-
packaging==21.3 # via build
30-
pep517==0.13.0 # via build
31-
pip-tools==6.10.0 # via -r requirements.in
32-
psycopg2==2.9.5 # via -r requirements.in
33-
pygments==2.13.0 # via -r requirements.in
34-
pyparsing==3.0.9 # via packaging
35-
pytz==2022.6 # via djangorestframework
36-
requests==2.28.1 # via coreapi, facepy, flit
37-
shortuuid==1.0.11 # via django-shortuuidfield
26+
jinja2==3.1.3 # via coreschema
27+
markdown==3.5.2 # via -r requirements.in
28+
markupsafe==2.1.5 # via jinja2
29+
packaging==23.2 # via build
30+
pip-tools==7.4.0 # via -r requirements.in
31+
psycopg2==2.9.9 # via -r requirements.in
32+
pygments==2.17.2 # via -r requirements.in
33+
pyproject-hooks==1.0.0 # via build, pip-tools
34+
pytz==2024.1 # via djangorestframework
35+
requests==2.31.0 # via coreapi, facepy, flit
36+
shortuuid==1.0.11 # via -r requirements.in, django-shortuuidfield
3837
six==1.16.0 # via django-shortuuidfield, facepy
39-
sqlparse==0.4.3 # via django, django-debug-toolbar
40-
tomli==2.0.1 # via build, pep517
38+
sqlparse==0.4.4 # via django, django-debug-toolbar
4139
tomli-w==1.0.0 # via flit
40+
typing-extensions==4.9.0 # via dj-database-url
4241
uritemplate==4.1.1 # via coreapi
43-
urllib3==1.26.12 # via requests
44-
wheel==0.38.4 # via pip-tools
42+
urllib3==2.2.1 # via requests
43+
wheel==0.42.0 # via pip-tools
4544

4645
# The following packages are considered to be unsafe in a requirements file:
4746
# pip

pyproject.toml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
[build-system]
2-
requires = ["flit_core == 3.4.*"]
2+
requires = ["flit_core == 3.9.*"]
33
build-backend = "flit_core.buildapi"
44

55
[project]
66
dynamic = ["version", "description"]
77
name = "Rest_Framework_Auth_Toolkit"
88
authors = [ { name = "Caravan Coop", email = "[email protected]" } ]
99
readme = "README.md"
10-
requires-python = ">= 3.8"
10+
requires-python = ">= 3.10"
1111
classifiers = [
1212
"Development Status :: 4 - Beta",
1313
"Intended Audience :: Developers",
1414
"Environment :: Web Environment",
1515
"License :: OSI Approved :: MIT License",
1616
"Programming Language :: Python :: 3",
1717
"Programming Language :: Python :: 3 :: Only",
18-
"Programming Language :: Python :: 3.9",
1918
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
2021
"Framework :: Django",
2122
"Framework :: Django :: 3.2",
22-
"Framework :: Django :: 4.0",
2323
"Framework :: Django :: 4.1",
24+
"Framework :: Django :: 4.2",
2425
]
2526
dependencies = [
26-
"django >= 2.2",
27+
"django >= 3.2",
2728
]
2829

2930
[project.optional-dependencies]

rest_auth_toolkit/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Simple + flexible signup and login for Django APIs"""
22

3-
__version__ = '0.13.dev0'
3+
__version__ = '0.13'

rest_auth_toolkit/models.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import os
22
import binascii
3-
from datetime import datetime
3+
from datetime import datetime, timezone
44

55
from django.conf import settings
66
from django.contrib.auth.models import AbstractUser
77
from django.db import models
88
from django.dispatch import Signal
9-
from django.utils.timezone import utc
109
from django.utils.translation import gettext_lazy as _
1110

1211
from .managers import BaseEmailUserManager, BaseAPITokenManager
@@ -71,7 +70,7 @@ def confirm(self):
7170
The time period to confirm an email is configured with the setting
7271
email_confirmation_validity_period, which defaults to 60 minutes.
7372
"""
74-
now = datetime.now(utc)
73+
now = datetime.now(timezone.utc)
7574
delay = (now - self.created).total_seconds()
7675
validity = get_setting('email_confirmation_validity_period', 60) * 60
7776

tests/conftest.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pytest_plugins = ["python_path"]

tox.ini

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{310,39}-dj{4.1,4.0,3.2}
2+
envlist = py{312,311,310}-dj{4.2,4.1,3.2}
33
minversion = 3.4.0
44
isolated_build = True
55

@@ -10,9 +10,9 @@ deps =
1010
-r requirements-test.txt
1111
-r demo/requirements.txt
1212
commands =
13-
py{310,39}-dj3.2: pip install django==3.2.*
14-
py{310,39}-dj4.0: pip install django==4.0.*
15-
py{310,39}-dj4.1: pip install django==4.1.*
13+
py{312,311,310}-dj3.2: pip install django==3.2.*
14+
py{312,311,310}-dj4.1: pip install django==4.1.*
15+
py{312,311,310}-dj4.2: pip install django==4.2.*
1616
flake8 rest_auth_toolkit tests demo
1717
pytest {posargs}
1818

@@ -39,7 +39,6 @@ commands =
3939
env =
4040
RAT_TESTING=1
4141
DJANGO_SETTINGS_MODULE=demo.settings
42-
plugins = python_path
4342
addopts = -svv --showlocals --reuse-db
4443
pythonpath = demo
4544
testpaths = tests/unit tests/functional

0 commit comments

Comments
 (0)