Skip to content

Commit 6e109c6

Browse files
Merge branch 'master' into segregate-dependencies-with-optional-extra-require
* master: docs: Move CHANGELOG out of README chore: Add Py3.12, Py3.13 in Github Actions chore: Upgrade ruff tooling chore: Upgrade requirements + support Django5
2 parents 4e35b52 + 61d0f45 commit 6e109c6

File tree

8 files changed

+160
-148
lines changed

8 files changed

+160
-148
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
timeout-minutes: 9
1515
strategy:
1616
matrix:
17-
python-version: ["3.9", "3.10", "3.11"]
17+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1818

1919
steps:
2020
- uses: actions/checkout@v3
@@ -32,6 +32,6 @@ jobs:
3232
python -m pip install tox tox-gh-actions
3333
python -m pip install -r requirements/testing.txt
3434
- name: Run ruff
35-
run: ruff .
35+
run: ruff check .
3636
- name: Test with tox
3737
run: tox

CHANGELOG.rst

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
Release Notes
2+
-------------
3+
4+
[Dev]
5+
^^^^^
6+
7+
Added
8+
"""""
9+
- Support for Python 3.11, 3.12, 3.13
10+
- CI tests for Py{311,312,313}-Django{2x,3x,4x,5x}.
11+
12+
[3.0.0]
13+
^^^^^^^
14+
15+
Added
16+
"""""
17+
- Support for Django 4.x.
18+
- Support for Django 3.2.
19+
20+
Changed
21+
"""""""
22+
- Method ``phone_verify.backends.nexmo.NexmoBackend.send_sms`` changes parameter name from ``numbers`` to ``number`` to be consistent with rest of the inherited classes.
23+
24+
[2.0.1]
25+
^^^^^^^
26+
27+
Added
28+
"""""
29+
- Support for Python 3.8 & Python 3.9.
30+
- CI tests for Py{36,37,38,39}-Django{20,21,22,30,31}.
31+
32+
Changed
33+
"""""""
34+
- Fixed issue ``generate_session_token`` to handle cases in Py38, Py39 when the ``session_token`` is already ``string`` instead of ``bytes``.
35+
36+
[2.0.0]
37+
^^^^^^^
38+
39+
**NOTE**: The previous version of this library provided the ``security_code`` in the JWT ``session_token``. You would have to re-verify ``phone_numbers`` in *this* version to ensure they are authentically verified.
40+
41+
Added
42+
"""""
43+
44+
- Tests added to provide 100% coverage on the package.
45+
- Add ``nexmo.errors.ClientError`` as exception class in ``phone_verify.backends.nexmo.NexmoBackend`` & ``phone_verify.backends.nexmo.NexmoSandboxBackend``.
46+
47+
Changed
48+
"""""""
49+
50+
- Method signature changed for ``phone_verify.backends.BaseBackend.generate_session_token``. It now accepts only ``phone_number`` instead of combination of ``phone_number`` and ``security_code``.
51+
- Remove the ``security_code`` from JWT ``session_token`` to avoid leaking information.
52+
- Add nonce in ``session_token`` to generate unique tokens for each ``phone_number``.
53+
- Fixes call to ``phone_verify.backends.nexmo.NexmoBackend.send_sms`` method.
54+
55+
[1.1.0]
56+
^^^^^^^
57+
58+
Added
59+
"""""
60+
61+
- Support ``Nexmo`` as a backend service along with ``Twilio``.
62+
- Add docs for writing a custom backend.
63+
64+
Changed
65+
"""""""
66+
67+
- Update ``backends.base.BaseBackend.validate_security_code`` to use ``save()`` instead of ``update()`` to allow Django to emit its ``post_save()`` signal.
68+
69+
[1.0.0]
70+
^^^^^^^
71+
72+
Added
73+
"""""
74+
75+
- Add coverage report through ``coveralls``.
76+
- Support for One-Time Passwords (OTP) using ``VERIFY_SECURITY_CODE_ONLY_ONCE`` as ``True`` in the settings.
77+
- Script to support makemigrations for development.
78+
- ``BaseBackend`` status now have ``SECURITY_CODE_VERIFIED`` and ``SESSION_TOKEN_INVALID`` status to support new states.
79+
80+
Changed
81+
"""""""
82+
83+
- Rename ``TWILIO_SANDBOX_TOKEN`` to ``SANDBOX_TOKEN``.
84+
- Fix signature for ``send_bulk_sms`` method in ``TwilioBackend`` and ``TwilioSandboxBackend``.
85+
- Response for ``/api/phone/register`` contains key ``session_token`` instead of ``session_code``.
86+
- Request payload for ``/api/phone/verify`` now expects ``session_token`` key instead of ``session_code``.
87+
- Response for ``/api/phone/verify`` now sends additional response of ``Security code is already verified`` in case ``VERIFY_SECURITY_CODE_ONLY_ONCE`` is set to ``True``.
88+
- Rename ``otp`` to ``security_code`` in code and docs to be more consistent.
89+
- Rename ``BaseBackend`` status from ``VALID``, ``INVALID``, ``EXPIRED`` to ``SECURITY_CODE_VALID``, ``SECURITY_CODE_INVALID``, and ``SECURITY_CODE_EXPIRED`` respectively.
90+
- Rename ``session_code`` to ``session_token`` to be consistent in code and naming across the app.
91+
- Rename service ``send_otp_and_generate_session_code`` to ``send_security_code_and_generate_session_token``.
92+
- Rename method ``BaseBackend.generate_token`` to ``BaseBackend.generate_security_code``.
93+
- Rename method ``create_otp_and_session_token`` to ``create_security_code_and_session_token``.
94+
- Rename method ``BaseBackend.validate_token`` to ``BaseBackend.validate_security_code`` with an additional parameter of ``session_token``.
95+
96+
[0.2.0]
97+
^^^^^^^
98+
99+
Added
100+
"""""
101+
102+
- ``pre-commit-config`` to maintain code quality using black and other useful tools.
103+
- Docs for integration and usage in `getting_started.rst`_.
104+
- Tox for testing on `py{37}-django{20,21,22}`.
105+
- Travis CI for testing builds.
106+
107+
Changed
108+
"""""""
109+
110+
- Convert ``*.md`` docs to reST Markup.
111+
- Fix issue with installing required package dependencies via ``install_requires``.
112+
113+
[0.1.1]
114+
^^^^^^^
115+
116+
Added
117+
"""""
118+
119+
- README and documentation of API endpoints.
120+
- ``setup.cfg`` to manage coverage.
121+
- ``phone_verify`` app including backends, requirements, tests.
122+
- Initial app setup.

README.rst

Lines changed: 4 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -112,125 +112,9 @@ Licence
112112

113113
GPLv3
114114

115-
Release Notes
116-
-------------
117-
118-
[Dev]
119-
^^^^^
120-
121-
Added
122-
"""""
123-
- Support for Python 3.11.
124-
- CI tests for Py{311}-Django{2x,3x,4x}.
125-
126-
[3.0.0]
127-
^^^^^^^
128-
129-
Added
130-
"""""
131-
- Support for Django 4.x.
132-
- Support for Django 3.2.
133-
134-
Changed
135-
"""""""
136-
- Method ``phone_verify.backends.nexmo.NexmoBackend.send_sms`` changes parameter name from ``numbers`` to ``number`` to be consistent with rest of the inherited classes.
137-
138-
[2.0.1]
139-
^^^^^^^
140-
141-
Added
142-
"""""
143-
- Support for Python 3.8 & Python 3.9.
144-
- CI tests for Py{36,37,38,39}-Django{20,21,22,30,31}.
145-
146-
Changed
147-
"""""""
148-
- Fixed issue ``generate_session_token`` to handle cases in Py38, Py39 when the ``session_token`` is already ``string`` instead of ``bytes``.
149-
150-
[2.0.0]
151-
^^^^^^^
152-
153-
**NOTE**: The previous version of this library provided the ``security_code`` in the JWT ``session_token``. You would have to re-verify ``phone_numbers`` in *this* version to ensure they are authentically verified.
154-
155-
Added
156-
"""""
157-
158-
- Tests added to provide 100% coverage on the package.
159-
- Add ``nexmo.errors.ClientError`` as exception class in ``phone_verify.backends.nexmo.NexmoBackend`` & ``phone_verify.backends.nexmo.NexmoSandboxBackend``.
160-
161-
Changed
162-
"""""""
163-
164-
- Method signature changed for ``phone_verify.backends.BaseBackend.generate_session_token``. It now accepts only ``phone_number`` instead of combination of ``phone_number`` and ``security_code``.
165-
- Remove the ``security_code`` from JWT ``session_token`` to avoid leaking information.
166-
- Add nonce in ``session_token`` to generate unique tokens for each ``phone_number``.
167-
- Fixes call to ``phone_verify.backends.nexmo.NexmoBackend.send_sms`` method.
168-
169-
[1.1.0]
170-
^^^^^^^
171-
172-
Added
173-
"""""
174-
175-
- Support ``Nexmo`` as a backend service along with ``Twilio``.
176-
- Add docs for writing a custom backend.
177-
178-
Changed
179-
"""""""
180-
181-
- Update ``backends.base.BaseBackend.validate_security_code`` to use ``save()`` instead of ``update()`` to allow Django to emit its ``post_save()`` signal.
182-
183-
[1.0.0]
184-
^^^^^^^
185-
186-
Added
187-
"""""
188-
189-
- Add coverage report through ``coveralls``.
190-
- Support for One-Time Passwords (OTP) using ``VERIFY_SECURITY_CODE_ONLY_ONCE`` as ``True`` in the settings.
191-
- Script to support makemigrations for development.
192-
- ``BaseBackend`` status now have ``SECURITY_CODE_VERIFIED`` and ``SESSION_TOKEN_INVALID`` status to support new states.
193-
194-
Changed
195-
"""""""
196-
197-
- Rename ``TWILIO_SANDBOX_TOKEN`` to ``SANDBOX_TOKEN``.
198-
- Fix signature for ``send_bulk_sms`` method in ``TwilioBackend`` and ``TwilioSandboxBackend``.
199-
- Response for ``/api/phone/register`` contains key ``session_token`` instead of ``session_code``.
200-
- Request payload for ``/api/phone/verify`` now expects ``session_token`` key instead of ``session_code``.
201-
- Response for ``/api/phone/verify`` now sends additional response of ``Security code is already verified`` in case ``VERIFY_SECURITY_CODE_ONLY_ONCE`` is set to ``True``.
202-
- Rename ``otp`` to ``security_code`` in code and docs to be more consistent.
203-
- Rename ``BaseBackend`` status from ``VALID``, ``INVALID``, ``EXPIRED`` to ``SECURITY_CODE_VALID``, ``SECURITY_CODE_INVALID``, and ``SECURITY_CODE_EXPIRED`` respectively.
204-
- Rename ``session_code`` to ``session_token`` to be consistent in code and naming across the app.
205-
- Rename service ``send_otp_and_generate_session_code`` to ``send_security_code_and_generate_session_token``.
206-
- Rename method ``BaseBackend.generate_token`` to ``BaseBackend.generate_security_code``.
207-
- Rename method ``create_otp_and_session_token`` to ``create_security_code_and_session_token``.
208-
- Rename method ``BaseBackend.validate_token`` to ``BaseBackend.validate_security_code`` with an additional parameter of ``session_token``.
209-
210-
[0.2.0]
211-
^^^^^^^
212-
213-
Added
214-
"""""
215-
216-
- ``pre-commit-config`` to maintain code quality using black and other useful tools.
217-
- Docs for integration and usage in `getting_started.rst`_.
218-
- Tox for testing on `py{37}-django{20,21,22}`.
219-
- Travis CI for testing builds.
220-
221-
Changed
222-
"""""""
223-
224-
- Convert ``*.md`` docs to reST Markup.
225-
- Fix issue with installing required package dependencies via ``install_requires``.
226-
227-
[0.1.1]
228-
^^^^^^^
115+
Changelog
116+
---------
229117

230-
Added
231-
"""""
118+
See `changelog.rst`_
232119

233-
- README and documentation of API endpoints.
234-
- ``setup.cfg`` to manage coverage.
235-
- ``phone_verify`` app including backends, requirements, tests.
236-
- Initial app setup.
120+
.. _changelog.rst: https://github.com/CuriousLearner/django-phone-verify/blob/master/CHANGELOG.rst

requirements/common.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Core Stuff
22
# -------------------------------------
3-
PyJWT==2.8.0
3+
PyJWT==2.10.1
44

55
# Configuration
66
# -------------------------------------
7-
python-dotenv==1.0.0
7+
python-dotenv==1.0.1
88

99
# Phone number related Stuff
1010
# -------------------------------------
11-
phonenumbers==8.13.25
12-
django-phonenumber-field==7.2.0
13-
twilio==8.10.2
11+
phonenumbers==9.0.1
12+
django-phonenumber-field==8.0.0
13+
twilio==9.5.1
1414
nexmo==2.5.2

requirements/development.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
# Core Stuff
55
# -------------------------------------
6-
Django==4.2.7
7-
djangorestframework==3.14.0
6+
Django==4.2.20
7+
djangorestframework==3.15.2
88

99
# Code quality
1010
#--------------------------------------
11-
pre-commit==3.5.0
11+
pre-commit==4.2.0

requirements/testing.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Testing
22
# -------------------------------------
3-
pytest==7.4.3
4-
pytest-django==4.7.0
5-
pytest-cov==4.1.0
3+
pytest==8.3.5
4+
pytest-django==4.10.0
5+
pytest-cov==6.0.0
66

77
django-dynamic-fixture==4.0.1
8-
pytest-mock==3.12.0
9-
tox==4.11.3
10-
ruff==0.1.6
8+
pytest-mock==3.14.0
9+
tox==4.24.2
10+
ruff==0.11.2

ruff.toml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
line-length = 120
2+
exclude = [
3+
".tox",
4+
".git",
5+
"docs",
6+
"venv",
7+
".venv",
8+
]
9+
10+
[lint]
211
select = [
312
'B', # flake8-bugbear
413
'E', # pycodestyle errors
@@ -7,13 +16,6 @@ select = [
716
'W', # pycodestyle warnings
817
'B9',
918
]
10-
exclude = [
11-
".tox",
12-
".git",
13-
"docs",
14-
"venv",
15-
".venv",
16-
]
1719

18-
[isort]
20+
[lint.isort]
1921
known-first-party = ["phone_verify"]

tox.ini

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
[tox]
22
distribute = False
33
envlist =
4-
py{39,310,311}-django{2x,3x,4x}
4+
py{39,310,311,312,313}-django{2x,3x,4x,5x}
55
skip_missing_interpreters = True
66

77
[gh-actions]
88
python =
99
3.9: py39
1010
3.10: py310
1111
3.11: py311
12+
3.12: py312
13+
3.13: py313
1214
django=
1315
django2x: Django>=2.0,<3.0
14-
django3x: Django>=3.0,<3.2.13
15-
django4x: Django>=4.0
16+
django3x: Django>=3.0,<4.0
17+
django4x: Django>=4.0,<5.0
18+
django5x: Django>=5.0,<6.0
1619

1720
[testenv]
1821
usedevelop = True
@@ -24,6 +27,7 @@ deps =
2427
django30: Django>=3.0,<3.1
2528
django31: Django>=3.1,<3.1.13
2629
django32: Django>=3.2,<3.2.5
27-
django40: Django>=4.0
30+
django40: Django>=4.0,<4.3
31+
django50: Django>=5.0,<6.0
2832
commands =
2933
pytest --cov -v --tb=native

0 commit comments

Comments
 (0)