Skip to content

Commit 19bac34

Browse files
bennylopemgrdcm
andauthored
Add support for Django 6.0 (#295)
* Add testing support for Django 6.0 and Python 3.14 * Remove Python 3.9 which is EOL * Remove support for Django 3.2 which is EOL * Update migrations and docs * Set DEFAULT_AUTO_FIELD * Remove migrations, rely on test settings * Update flake8 version * Update version Closes #289 Closes #291 Closes #294 --------- Co-authored-by: Dan Moore <mgrdcm@me.com>
1 parent 9d4b090 commit 19bac34

9 files changed

Lines changed: 50 additions & 31 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
12+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1313

1414
steps:
1515
- uses: actions/checkout@v1

HISTORY.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
History
44
=======
55

6+
2.6.0
7+
-----
8+
9+
* Drop Python 3.9 support
10+
* Add Python 3.14 support
11+
* Add Django 6.0 support
12+
613
2.5.0
714
-----
815

README.rst

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ Targets & testing
8888

8989
The codebase is targeted and tested against:
9090

91-
* Django 3.2.x against Python 3.8, 3.9, 3.10
92-
* Django 4.2.x against Python 3.8, 3.9, 3.10, 3.11, 3.12
93-
* Django 5.2.x against Python 3.10, 3.11, 3.12, 3.13
91+
* Django 4.2.x against Python 3.10, 3.11, 3.12
92+
* Django 5.2.x against Python 3.10, 3.11, 3.12, 3.13, 3.14
93+
* Django 6.0.x against Python 3.12, 3.13, 3.14
9494

9595
To run the tests against all target environments, install `tox
9696
<https://testrun.org/tox/latest/>`_ and then execute the command::
@@ -146,6 +146,12 @@ By default you will need to install `django-extensions` or comparable libraries
146146
if you plan on adding Django Organizations as an installed app to your Django
147147
project. See below on configuring.
148148

149+
Upgrading
150+
---------
151+
152+
Upgrading django-organizations is expected to be a low-impact operation. See the Upgrading
153+
section in the Getting Started docs for additional considerations.
154+
149155
Configuring
150156
-----------
151157

@@ -268,14 +274,3 @@ License
268274

269275
Anyone is free to use or modify this software under the terms of the BSD
270276
license.
271-
272-
Sponsors
273-
========
274-
275-
`Muster <https://www.muster.com/home?utm_source=github&campaign=opensource>`_ is building precision advocacy software to impact policy through grassroots action.
276-
277-
.. image:: https://www.muster.com/hs-fs/hubfs/muster_logo-2.png?width=600&name=muster_logo-2.png
278-
:target: https://www.muster.com/home?utm_source=github&campaign=opensource
279-
:width: 400
280-
:alt: Alternative text
281-

conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def pytest_configure():
1616
DATABASES={
1717
"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": "test.sqlite3"}
1818
},
19+
DEFAULT_AUTO_FIELD="django.db.models.AutoField",
1920
INSTALLED_APPS=[
2021
"django.contrib.auth",
2122
"django.contrib.contenttypes",

docs/getting_started.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,21 @@ consistent**, including keyword arguments. Otherwise you will end up generating
9797
extraneous and possibly conflicting migrations in your own app. The SlugField
9898
must accept the `populate_from` keyword argument.
9999

100+
Upgrading
101+
=========
102+
103+
Updating Django from a pre-6.0 version to 6.0 or above may result in creating
104+
new migrations for custom organization models if you do not already have
105+
`DEFAULT_AUTO_FIELD` set in your project. This is because in Django 6.0 the
106+
default field changed from `AutoField` (with an `IntegerField` under the hood)
107+
to a `BigAutoField` (with a `BigIntegerField` under the hood).
108+
109+
This applies to your project and your project migrations, however, so
110+
you are free to treat this however you want, e.g. if you want to keep `IntegerFields`
111+
as the field type, configure your project settings as much or separate the `database
112+
and state operations <https://docs.djangoproject.com/en/6.0/ref/migration-operations/#django.db.migrations.operations.SeparateDatabaseAndState>`_
113+
in the migration (maybe not ideal but safe with regard to your database).
114+
100115
Users and multi-account membership
101116
==================================
102117

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = [
55
]
66
description = "Group accounts for Django"
77
readme = "README.rst"
8-
requires-python = ">=3.9"
8+
requires-python = ">=3.10"
99
license = {text = "BSD License"}
1010
classifiers = [
1111
"Development Status :: 5 - Production/Stable",
@@ -15,15 +15,15 @@ classifiers = [
1515
"License :: OSI Approved :: BSD License",
1616
"Operating System :: OS Independent",
1717
"Programming Language :: Python",
18-
"Programming Language :: Python :: 3.9",
1918
"Programming Language :: Python :: 3.10",
2019
"Programming Language :: Python :: 3.11",
2120
"Programming Language :: Python :: 3.12",
2221
"Programming Language :: Python :: 3.13",
22+
"Programming Language :: Python :: 3.14",
2323
"Programming Language :: Python :: Implementation :: CPython",
2424
]
2525
dependencies = [
26-
"Django>=3.2",
26+
"Django>=4.2",
2727
"django-extensions>=2.0.8",
2828
]
2929
dynamic = ["version"]

setup.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ classifiers =
1616
License :: OSI Approved :: BSD License
1717
Operating System :: OS Independent
1818
Programming Language :: Python
19-
Programming Language :: Python :: 3.8
20-
Programming Language :: Python :: 3.9
2119
Programming Language :: Python :: 3.10
2220
Programming Language :: Python :: 3.11
21+
Programming Language :: Python :: 3.12
22+
Programming Language :: Python :: 3.13
23+
Programming Language :: Python :: 3.14
2324
Programming Language :: Python :: Implementation :: CPython
2425
Development Status :: 5 - Production/Stable
2526

@@ -30,7 +31,7 @@ packages = find:
3031
package_dir=
3132
=src
3233
install_requires =
33-
Django>=3.2.0
34+
Django>=4.2.0
3435
django-extensions>=2.0.8
3536
python_requires = >=3.8
3637

src/organizations/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
__author__ = "Ben Lopatin"
44
__email__ = "ben@benlopatin.com"
5-
__version__ = "2.5.0"
5+
__version__ = "2.6.0"

tox.ini

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[tox]
22
envlist =
33
flake8,
4-
py{39,310}-django{32},
5-
py{39}-django{42},
4+
py{310}-django{32}
65
py{310,311,312}-django{42}
7-
py{310,311,312,313}-django{52}
6+
py{310,311,312,313,314}-django{52}
7+
py{312,313,314}-django{60}
88

99
[gh-actions]
1010
python =
11-
3.9: py39
1211
3.10: py310
1312
3.11: py311
1413
3.12: py312
1514
3.13: py313
15+
3.14: py314
1616

1717
[build-system]
1818
build-backend = "hatchling.build"
@@ -24,22 +24,22 @@ setenv =
2424
PYTHONPATH = {toxinidir}:{toxinidir}/organizations
2525
commands = pytest {posargs} --cov=organizations
2626
basepython =
27-
py39: python3.9
2827
py310: python3.10
2928
py311: python3.11
3029
py312: python3.12
3130
py313: python3.13
31+
py314: python3.14
3232
deps =
3333
hatch>=1.7.0
34-
django32: Django>=3.2,<4
35-
django42: Django>=4.2,<5
36-
django52: Django>=5.2,<6
34+
django42: Django>=4.2.8,<5 # Django 4.2.8 is required for Python 3.12 support
35+
django52: Django>=5.2.8,<6 # Django 5.2.8 is required for Python 3.14 support
36+
django60: Django>=6.0,<6.1
3737
extras = tests
3838

3939
[testenv:flake8]
4040
basepython=python3
4141
deps=
42-
flake8==3.12.7
42+
flake8==7.3.0
4343
commands=
4444
flake8 src/organizations tests
4545

0 commit comments

Comments
 (0)