Skip to content

Commit

Permalink
0.8.0 - add support for django 5.1 (#76)
Browse files Browse the repository at this point in the history
public
  * add support for Django 5.1
  * drop support for Django 3.2
  * introduce `DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO` environment variable
    to make upgrades easier

internal
  * use pyproject's `dynamic` feature for version & description
  * specify dependencies in `setup.py` so we can have dynamic version depdencies
  • Loading branch information
zsoldosp authored Aug 26, 2024
1 parent ad6e7f8 commit 234e9fe
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 11 deletions.
23 changes: 22 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ Install django-currentuser::

pip install django-currentuser

Add it to the middleware classes in your settings.py::
Note: if there is a new Django version released that the library hasn't been
upgraded to support yet, e.g.:

The conflict is caused by:
The user requested django==5.1
django-currentuser 0.8.0 depends on Django<5.1 and >=4.2

you can try to install it with the unsupported/untested Django version by
using the `DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO` environment variable

DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO=1 pip install django-currentuser

Ade it to the middleware classes in your settings.py::

MIDDLEWARE = (
...,
Expand Down Expand Up @@ -57,10 +69,19 @@ Supported Versions
Release Notes
-------------

* 0.8.0

* add support for Django 5.1
* drop support for Django 3.2
* introduce `DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO` environment variable
to make upgrades easier

* 0.7.0

* add support for Django 5.0
* add support for Python 3.12
* drop support for Django 4.0 and 4.1

* 0.6.1

* remove project transfer warning from README in order not to scare people away from the project
Expand Down
2 changes: 1 addition & 1 deletion django_currentuser/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.7.0'
__version__ = '0.8.0'
11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ build-backend = "setuptools.build_meta"

[project]
name = "django-currentuser"
version = "0.7.0"
dynamic = ["version", "readme", "dependencies"]
authors = [
{ name="Peter Zsoldos", email="[email protected]" },
]
maintainers = [
{ name="Peter Zsoldos", email="[email protected]" },
]
description = "Conveniently store reference to request user on thread/db level."
readme = "README.rst"
requires-python = ">=3.8"
classifiers = [
'Development Status :: 4 - Beta',
Expand All @@ -29,12 +28,9 @@ classifiers = [
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.2',
'Framework :: Django :: 5.0',
]
dependencies = [
'Django>=3.2, < 5.1, !=4.0, !=4.1'
'Framework :: Django :: 5.1',
]

[project.urls]
Expand All @@ -44,3 +40,6 @@ dependencies = [
[tool.setuptools]
packages = ["django_currentuser"]

[tool.setuptools.dynamic]
version = {attr = "django_currentuser.__version__"}
readme = {file = ["README.rst"]}
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import os

use_unsupported_django = os.environ.get('DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO', '0') == '1'

dependencies = ['Django'] if use_unsupported_django else ["Django>=4.2, < 5.2"]


if __name__ == "__main__":
setup()
setup(install_requires=dependencies)
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# See README.rst supported versions
[tox]
envlist =
py{38,39,310}-django32,
py{38,39,310,311,312}-django42,
py{310,311,312}-django50,
py{310,311,312}-django51,
requires =
tox >= 4.6.3
setuptools >= 61.0.0
Expand All @@ -18,9 +18,9 @@ setenv =
DJANGO_SETTINGS_MODULE = settings
PIP_INDEX_URL = https://pypi.python.org/simple/
deps =
django32: Django>=3.2,<3.3
django42: Django>=4.2,<4.3
django50: Django>=5.0,<5.1
django51: Django>=5.1,<5.2
py38,py39,py310,py311: flake8==3.8.4
py312: flake8==5.0
# TODO: duplicated from pyproject.toml
Expand Down

0 comments on commit 234e9fe

Please sign in to comment.