Skip to content

Commit e0eed13

Browse files
TheBukyTheBuky
authored andcommitted
Following the Python and Django roadmap, removing all versions not supported anymore in 2020
1 parent 2a942cd commit e0eed13

File tree

8 files changed

+21
-60
lines changed

8 files changed

+21
-60
lines changed

.travis.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,16 @@ sudo: True
33
dist: xenial
44
matrix:
55
include:
6-
- env: TOXENV=py27-django111
7-
python: "2.7"
8-
- env: TOXENV=pypy-django111
9-
python: "pypy"
10-
- env: TOXENV=py35-django111
11-
python: "3.5"
12-
- env: TOXENV=py36-django111
13-
python: "3.6"
14-
- env: TOXENV=py36-django20
15-
python: "3.6"
6+
- env: TOXENV=pypy3-django22
7+
python: "pypy3"
168
- env: TOXENV=py35-django22
179
python: "3.5"
1810
- env: TOXENV=py36-django22
1911
python: "3.6"
2012
- env: TOXENV=py37-django22
2113
python: "3.7"
14+
- env: TOXENV=py38-django22
15+
python: "3.8"
2216
- env: TOXENV=py36-django30
2317
python: "3.6"
2418
- env: TOXENV=py37-django30
@@ -32,7 +26,7 @@ matrix:
3226
- env: TOXENV=py38-django-master
3327
python: "3.8-dev"
3428
- env: TOXENV=docs
35-
python: "2.7"
29+
python: "3.6"
3630
allow_failures:
3731
- env: TOXENV=py36-django-master
3832
- env: TOXENV=py37-django-master
@@ -54,6 +48,6 @@ deploy:
5448
on:
5549
tags: true
5650
repo: jazzband/django-pipeline
57-
condition: "$TOXENV = py27-django111"
51+
condition: "$TOXENV = py36-django22"
5852
notifications:
5953
email: false

pipeline/collector.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
import django
88
from django.contrib.staticfiles import finders
99
from django.contrib.staticfiles.storage import staticfiles_storage
10-
try:
11-
from django.utils.six import iterkeys
12-
except ImportError:
13-
iterkeys = iter
1410

1511

1612
from pipeline.finders import PipelineFinder
@@ -61,7 +57,7 @@ def collect(self, request=None, files=[]):
6157
if files and len(files) == len(found_files):
6258
break
6359

64-
return iterkeys(found_files)
60+
return found_files.keys()
6561

6662
def copy_file(self, path, prefixed_path, source_storage):
6763
# Delete the target file if needed or break

pipeline/compilers/__init__.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
from django.contrib.staticfiles.storage import staticfiles_storage
1010
from django.core.files.base import ContentFile
1111
from django.utils.encoding import smart_bytes
12-
try:
13-
from django.utils.six import string_types, text_type
14-
except ImportError:
15-
string_types = (str,)
16-
text_type = str
1712

1813
from pipeline.conf import settings
1914
from pipeline.exceptions import CompilerError
@@ -114,7 +109,7 @@ def execute_command(self, command, cwd=None, stdout_captured=None):
114109
"""
115110
argument_list = []
116111
for flattening_arg in command:
117-
if isinstance(flattening_arg, string_types):
112+
if isinstance(flattening_arg, (str,)):
118113
argument_list.append(flattening_arg)
119114
else:
120115
argument_list.extend(flattening_arg)
@@ -148,7 +143,7 @@ def execute_command(self, command, cwd=None, stdout_captured=None):
148143
except OSError as e:
149144
stdout_captured = None # Don't save erroneous result.
150145
raise CompilerError(e, command=argument_list,
151-
error_output=text_type(e))
146+
error_output=str(e))
152147
finally:
153148
# Decide what to do with captured stdout.
154149
if stdout:

pipeline/compressors/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010

1111
from django.contrib.staticfiles.storage import staticfiles_storage
1212
from django.utils.encoding import smart_bytes, force_text
13-
try:
14-
from django.utils.six import string_types
15-
except ImportError:
16-
string_types = (str,)
1713

1814
from pipeline.conf import settings
1915
from pipeline.exceptions import CompressorError
@@ -241,7 +237,7 @@ class SubProcessCompressor(CompressorBase):
241237
def execute_command(self, command, content):
242238
argument_list = []
243239
for flattening_arg in command:
244-
if isinstance(flattening_arg, string_types):
240+
if isinstance(flattening_arg, (str,)):
245241
argument_list.append(flattening_arg)
246242
else:
247243
argument_list.extend(flattening_arg)

pipeline/conf.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
from django.conf import settings as _settings
99
from django.core.signals import setting_changed
1010
from django.dispatch import receiver
11-
try:
12-
from django.utils.six import string_types
13-
except ImportError:
14-
string_types = (str,)
1511

1612

1713
DEFAULTS = {
@@ -101,7 +97,7 @@ def __init__(self, wrapped_settings):
10197
def __getitem__(self, key):
10298
value = self.settings[key]
10399
if key.endswith(("_BINARY", "_ARGUMENTS")):
104-
if isinstance(value, string_types):
100+
if isinstance(value, (str,)):
105101
return tuple(shlex.split(value, posix=(os.name == 'posix')))
106102
return tuple(value)
107103
return value

pipeline/forms.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
from django.contrib.staticfiles.storage import staticfiles_storage
66
from django.utils.functional import cached_property
7-
try:
8-
from django.utils.six import iteritems, add_metaclass
9-
except ImportError:
10-
from .decorator import add_metaclass
11-
def iteritems(dictionary):
12-
return dictionary.items()
137

148
from .collector import default_collector
159
from .conf import settings
@@ -173,7 +167,7 @@ def _get_css_files(cls, extra_files):
173167
media_type='css',
174168
extra_files=extra_files.get(media_target,
175169
[])))
176-
for media_target, media_packages in iteritems(css_packages)
170+
for media_target, media_packages in css_packages.items()
177171
)
178172

179173
def _get_js_files(cls, extra_files):
@@ -238,8 +232,7 @@ def _get_media_files(cls, packager, media_packages, media_type,
238232
return source_files
239233

240234

241-
@add_metaclass(PipelineFormMediaMetaClass)
242-
class PipelineFormMedia(object):
235+
class PipelineFormMedia(object, metaclass=PipelineFormMediaMetaClass):
243236
"""Base class for form or widget Media classes that use Pipeline packages.
244237
245238
Forms or widgets that need custom CSS or JavaScript media on a page can

setup.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name='django-pipeline',
9-
version='1.7.0',
9+
version='2.0.0',
1010
description='Pipeline is an asset packaging library for Django.',
1111
long_description=io.open('README.rst', encoding='utf-8').read() + '\n\n' +
1212
io.open('HISTORY.rst', encoding='utf-8').read(),
@@ -24,21 +24,18 @@
2424
'Development Status :: 5 - Production/Stable',
2525
'Environment :: Web Environment',
2626
'Framework :: Django',
27-
'Framework :: Django :: 1.11',
28-
'Framework :: Django :: 2.0',
2927
'Framework :: Django :: 2.2',
3028
'Framework :: Django :: 3.0',
3129
'Intended Audience :: Developers',
3230
'License :: OSI Approved :: MIT License',
3331
'Operating System :: OS Independent',
3432
'Programming Language :: Python',
35-
'Programming Language :: Python :: 2.7',
3633
'Programming Language :: Python :: 3',
3734
'Programming Language :: Python :: 3.5',
3835
'Programming Language :: Python :: 3.6',
3936
'Programming Language :: Python :: 3.7',
4037
'Programming Language :: Python :: 3.8',
41-
'Programming Language :: Python :: Implementation :: PyPy',
38+
'Programming Language :: Python :: Implementation :: PyPy3',
4239
'Topic :: Utilities',
4340
'Topic :: Software Development :: Libraries :: Python Modules',
4441
'Topic :: Internet :: WWW/HTTP',

tox.ini

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
[tox]
22
envlist =
3-
{py27,pypy,py34}-django{111}
4-
py35-django{20,22,111,-master}
5-
py36-django{111,22,-master}
6-
py37-django{111,22,-master}
3+
{pypy3,py35}-django{22}
4+
py36-django{22,30,-master}
5+
py37-django{22,30,-master}
76
py38-django{22,30,-master}
87
docs
98

109
[testenv]
1110
basepython =
12-
py27: python2.7
13-
pypy: pypy
14-
py34: python3.4
11+
pypy3: pypy3
1512
py35: python3.5
1613
py36: python3.6
1714
py37: python3.7
1815
py38: python3.8
1916
deps =
20-
py{27,py}: mock
21-
py{27,py}: futures
22-
django111: Django>=1.11,<1.12
23-
django20: Django>=2.0,<2.2
17+
pypy3: mock
2418
django22: Django>=2.2.1,<2.3
2519
django30: Django>=3.0
2620
django-master: https://github.com/django/django/archive/master.tar.gz
@@ -39,7 +33,7 @@ commands =
3933
whitelist_externals = npm
4034

4135
[testenv:docs]
42-
basepython = python2.7
36+
basepython = python3.6
4337
changedir = docs
4438
deps = sphinx
4539
commands =

0 commit comments

Comments
 (0)