Skip to content

Commit

Permalink
Merge pull request #65 from yprez/drop-old-django-python-versions-sup…
Browse files Browse the repository at this point in the history
…port

Drop support for old Django / Python versions
  • Loading branch information
yprez authored May 25, 2021
2 parents 2c4a9fd + 09e4a08 commit e400467
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 65 deletions.
13 changes: 0 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,13 @@ language: python

jobs:
include:
- python: 2.7
- python: 3.4
- python: 3.5
dist: xenial
language: python
- python: 3.6
dist: xenial
language: python
- python: 3.7
dist: xenial
sudo: true
- python: 3.8
dist: xenial
sudo: true
- python: 3.9
dist: xenial
sudo: true

install:
- pip install -U packaging # fix for Python3.4 build
- pip install tox tox-travis coveralls
script:
- tox
Expand Down
12 changes: 6 additions & 6 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
Changelog
=========

v1.0.7 - Unreleased

v1.1.0 - Unreleased
===================

* Add tests for Django 3.1.
* Add tests for Django 3.2 LTS.
* Test on Python 3.9 (for Django versions 2.2 LTS to present (3.2 LTS))
* Fix failing tests for Django 2.2.
* Fix failing lint test
* Add tests/support for Django 3.2, 3.1.
* Add tests/support for Python 3.9.
* Drop support for Python 2.7, 3.4.
* Drop support for Django 1.x, 2.0, 2.1.


v1.0.6 - 23/04/2020
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Originally based on: `Django snippet 2484 <http://djangosnippets.org/snippets/24
Supported versions
==================

* Django 3.2, 3.1, 3.0, 2.2, 2.1, 2.0, 1.11, 1.10, 1.9, 1.8
* Python 3.9, 3.8, 3.7, 3.6, 3.5, 3.4, 2.7
* Django 3.2, 3.1, 2.2
* Python 3.9, 3.8, 3.7, 3.6, 3.5


Installation
Expand Down
24 changes: 5 additions & 19 deletions logentry_admin/admin.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
from __future__ import unicode_literals

import django
from django.contrib import admin
from django.contrib.admin.models import LogEntry, ADDITION, CHANGE, DELETION
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.urls import reverse, NoReverseMatch
from django.utils.encoding import force_str
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
from django.utils.translation import pgettext_lazy

if django.VERSION[0] < 2:
from django.utils.encoding import force_text as force_str
from django.utils.translation import ugettext_lazy as _
else:
from django.utils.encoding import force_str
from django.utils.translation import gettext_lazy as _

try:
from django.urls import reverse, NoReverseMatch
except ImportError:
from django.core.urlresolvers import reverse, NoReverseMatch


action_names = {
ADDITION: pgettext_lazy('logentry_admin:action_type', 'Addition'),
Expand Down Expand Up @@ -164,17 +152,15 @@ def get_queryset(self, request):

def get_actions(self, request):
actions = super(LogEntryAdmin, self).get_actions(request)
if 'delete_selected' in actions:
del actions['delete_selected']
actions.pop('delete_selected', None)
return actions

def action_description(self, obj):
return action_names[obj.action_flag]
action_description.short_description = _('action')

def get_change_message(self, obj):
if django.VERSION >= (1, 10):
return obj.get_change_message()
# TODO: is this still required in newer Django versions?
return obj.change_message
get_change_message.short_description = _('change message')

Expand Down
14 changes: 2 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
name='django-logentry-admin',
author='Yuri Prezument',
author_email='y@yprez.com',
version='1.0.6',
version='1.1.0',
packages=['logentry_admin'],
package_data={
'logentry_admin': [
Expand All @@ -26,30 +26,20 @@
description='Show all LogEntry objects in the Django admin site.',
long_description='\n\n'.join([readme, changelog]),
install_requires=[
'Django>=1.7',
'Django>=2.2',
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Framework :: Django :: 2.1',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Natural Language :: English',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
Expand Down
14 changes: 1 addition & 13 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,12 @@
envlist =
{py39,py38,py37,py36}-django32,
{py39,py38,py37,py36}-django31,
{py39,py38,py37,py36}-django30,
{py39,py38,py37,py36,py35}-django22,
{py37,py36,py35}-django21,
{py37,py36,py35,py34}-django20,
{py37,py36,py35,py34,py27}-{django111},
{py35,py34,py27}-{django110,django19,django18},
py36-flake8
py39-flake8

[testenv]
deps =
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
django110: Django>=1.10,<1.11
django111: Django>=1.11,<2.0
django20: Django>=2.0,<2.1
django21: Django>=2.1,<2.2
django22: Django>=2.2,<2.3
django30: Django>=3.0,<3.1
django31: Django>=3.1,<3.2
django32: Django>=3.2,<3.3
coverage
Expand Down

0 comments on commit e400467

Please sign in to comment.