From 72a4967da8db4afa355f756ff9993b657cd4f9a0 Mon Sep 17 00:00:00 2001 From: bgaudino Date: Thu, 29 Jan 2026 16:54:38 -0600 Subject: [PATCH 1/5] Update tests --- .github/workflows/tests.yml | 27 ++++++++++++++++++++++++ .travis.yml | 19 ----------------- CHANGELOG.rst | 7 +++++-- absoluteuri/__init__.py | 11 +++++++--- absoluteuri/tests.py | 8 +++---- setup.py | 20 ++++++++---------- test_settings.py | 4 +++- tox.ini | 42 +++++++++++++++++++++++++++---------- 8 files changed, 87 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..e13072c --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,27 @@ +name: Tests + +on: + push: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + + name: Python ${{ matrix.python }} + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + allow-prereleases: true + + - run: pip install tox tox-gh-actions + + - run: tox diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 33c0926..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -sudo: false -language: python -python: - - "3.6" -cache: - directories: - - $HOME/.pip-cache/ -env: - - TOX_ENV=py27-dj111 - - TOX_ENV=py36-dj111 - - TOX_ENV=py36-dj20 - - TOX_ENV=py36-dj21 -install: - - pip install --upgrade pip - - pip install tox>=1.8.0 -script: - - tox -e $TOX_ENV -after_script: - - cat .tox/$TOX_ENV/log/*.log diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d9498b2..e90c29d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,10 +3,13 @@ Changelog ========= -1.3.1 (unreleased) +2.0.0 (unreleased) ------------------ -- Nothing changed yet. +- Drop support for Python < 3.8 +- Drop support for Django < 4.2. +- Add support for Django 4.2, 5.0, 5.1, 5.2, and 6.0. +- Add support for Python 3.10, 3.11, 3.12, 3.13, and 3.14. 1.3.0 (2018-09-04) diff --git a/absoluteuri/__init__.py b/absoluteuri/__init__.py index bda387b..542be87 100644 --- a/absoluteuri/__init__.py +++ b/absoluteuri/__init__.py @@ -1,9 +1,14 @@ -import pkg_resources - from django import urls from django.conf import settings -__version__ = pkg_resources.get_distribution('django-absoluteuri').version +try: + from importlib.metadata import version + + __version__ = version('django-absoluteuri') +except ImportError: + import pkg_resources + + __version__ = pkg_resources.get_distribution('django-absoluteuri').version def build_absolute_uri(path): diff --git a/absoluteuri/tests.py b/absoluteuri/tests.py index 80b1787..acab529 100644 --- a/absoluteuri/tests.py +++ b/absoluteuri/tests.py @@ -2,7 +2,7 @@ from django.test import TestCase from django.template import Template, Context -from django.conf.urls import url +from django.urls import re_path import absoluteuri @@ -12,9 +12,9 @@ def view(request, *args, **kwargs): urlpatterns = [ - url(r'^foo/$', view, name='view'), - url(r'^foo/(?P\w+)/$', view, name='view'), - url(r'^foo/(\d+)/$', view, name='view'), + re_path(r'^foo/$', view, name='view'), + re_path(r'^foo/(?P\w+)/$', view, name='view'), + re_path(r'^foo/(\d+)/$', view, name='view'), ] diff --git a/setup.py b/setup.py index a715bc8..0b876db 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ def read(fname): setup( name='django-absoluteuri', - version='1.3.1.dev0', + version='2.0.0', description=__doc__, long_description=readme + '\n\n' + changelog, author='Fusionbox, Inc.', @@ -21,11 +21,7 @@ def read(fname): url='https://github.com/fusionbox/django-absoluteuri', packages=[package for package in find_packages() if package.startswith('absoluteuri')], install_requires=[ - 'Django>=1.11', - ], - test_suite='setuptest.setuptest.SetupTestSuite', - tests_require=[ - 'django-setuptest', + 'Django>=4.2', ], license="Apache 2.0", zip_safe=True, @@ -36,11 +32,13 @@ def read(fname): 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Natural Language :: English', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', + 'Programming Language :: Python :: 3.14', ], ) diff --git a/test_settings.py b/test_settings.py index f4e82e3..868d26b 100644 --- a/test_settings.py +++ b/test_settings.py @@ -1,5 +1,5 @@ # We just put it here to get the checks to shut up -MIDDLEWARE_CLASSES = [] +MIDDLEWARE = [] INSTALLED_APPS = ( 'django.contrib.sites', @@ -14,6 +14,8 @@ SITE_ID = 1 +SECRET_KEY = 'test-secret-key' + ROOT_URLCONF = 'absoluteuri.tests' TEMPLATES = [ diff --git a/tox.ini b/tox.ini index 0a62a9d..b614dbc 100644 --- a/tox.ini +++ b/tox.ini @@ -1,18 +1,38 @@ [tox] envlist= - py{27,36}-dj111 - py36-dj20 - py36-dj21 + py{38,39}-dj42 + py{10}-dj{42,50,51,52} + py{11,12}-dj{42,50,51,52} + py313-dj{51,52} + py314-dj60 [testenv] basepython= - py27: python2.7 - py36: python3.6 + py38: python3.8 + py39: python3.9 + py310: python3.10 + py311: python3.11 + py312: python3.12 + py313: python3.13 + py314: python3.14 +setenv= + PYTHONPATH={toxinidir} + DJANGO_SETTINGS_MODULE=test_settings commands= - /usr/bin/env - python setup.py test + django-admin test absoluteuri deps= - dj111: Django>=1.11,<2.0 - dj20: Django>=2.0,<2.1 - dj21: Django>=2.1,<2.2 -whitelist_externals= + dj42: Django>=4.2,<4.3 + dj50: Django>=5.0,<5.1 + dj51: Django>=5.1,<5.2 + dj52: Django>=5.2,<5.3 + dj60: Django>=6.0,<6.1 +allowlist_externals= env +[gh-actions] +python = + 3.8: py38 + 3.9: py39 + 3.10: py310 + 3.11: py311 + 3.12: py312 + 3.13: py313 + 3.14: py314 From 1662db089f84d2f60c2fb884938fd15311d2a935 Mon Sep 17 00:00:00 2001 From: bgaudino Date: Thu, 29 Jan 2026 17:00:46 -0600 Subject: [PATCH 2/5] Fix python names in tox.ini --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index b614dbc..bd80d67 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] envlist= py{38,39}-dj42 - py{10}-dj{42,50,51,52} - py{11,12}-dj{42,50,51,52} + py310-dj{42,50,51,52} + py{311,312}-dj{42,50,51,52} py313-dj{51,52} py314-dj60 [testenv] From 19f8206f4fd464672a25577fba92aa199491564a Mon Sep 17 00:00:00 2001 From: bgaudino Date: Fri, 30 Jan 2026 14:52:20 -0600 Subject: [PATCH 3/5] Replace travis badge with gh badge --- README.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index c576163..a920119 100644 --- a/README.rst +++ b/README.rst @@ -1,15 +1,16 @@ django-absoluteuri ================== -.. image:: https://travis-ci.org/fusionbox/django-absoluteuri.png?branch=master - :target: https://travis-ci.org/fusionbox/django-absoluteuri +.. image:: https://github.com/fusionbox/django-absoluteuri/actions/workflows/tests.yml/badge.svg + :target: https://github.com/fusionbox/django-absoluteuri/actions/workflows/tests.yml + :alt: Tests Absolute URI functions and template tags for Django. Why --- - +'' There are times when you need to output an absolute URL (for example, inside an email), but you don't always have access to the request. These utilities use the Sites Framework if available in order to create absolute URIs. From 13e408b805a607cd4a489f984510e0b97070fda3 Mon Sep 17 00:00:00 2001 From: Brian Gaudino <74442563+bgaudino@users.noreply.github.com> Date: Tue, 17 Feb 2026 14:59:39 -0600 Subject: [PATCH 4/5] Update README.rst Fix copy/paste mistake in readme --- README.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/README.rst b/README.rst index a920119..e9f5542 100644 --- a/README.rst +++ b/README.rst @@ -10,7 +10,6 @@ Absolute URI functions and template tags for Django. Why --- -'' There are times when you need to output an absolute URL (for example, inside an email), but you don't always have access to the request. These utilities use the Sites Framework if available in order to create absolute URIs. From 916eb5956bff503b7e45db71e23433bfa88dfc8a Mon Sep 17 00:00:00 2001 From: Brian Gaudino <74442563+bgaudino@users.noreply.github.com> Date: Tue, 17 Feb 2026 15:01:02 -0600 Subject: [PATCH 5/5] Update README.rst --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index e9f5542..38eacf1 100644 --- a/README.rst +++ b/README.rst @@ -10,6 +10,7 @@ Absolute URI functions and template tags for Django. Why --- + There are times when you need to output an absolute URL (for example, inside an email), but you don't always have access to the request. These utilities use the Sites Framework if available in order to create absolute URIs.