summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo van Kemenade <hugovk@users.noreply.github.com>2019-10-15 00:11:14 +0300
committerVal Neekman <un33kvu@gmail.com>2019-10-14 17:11:14 -0400
commit588372d9e68979c2990873e9562d203ce3098442 (patch)
treefdad4306796a863436f4bb3ce988bf045dc51da7
parentb9db1bc87e3b19c5c63ab7a00b19685b7996de5d (diff)
downloadpython-slugify-588372d9e68979c2990873e9562d203ce3098442.tar.gz
Drop support for EOL Python 2.6 and 3.2-2.4 (#87)
* Drop support for EOL Python 2.6 and 3.2-3.4 * Remove duplicate class * Upgrade Python syntax with pyupgrade * Upgrade PyPy and PyPy3 and test 3.8 beta
-rw-r--r--.travis.yml6
-rwxr-xr-xsetup.py6
-rw-r--r--slugify/slugify.py4
-rw-r--r--test.py13
4 files changed, 7 insertions, 22 deletions
diff --git a/.travis.yml b/.travis.yml
index 5e311a5..a393a66 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,12 +3,12 @@ dist: xenial
python:
- "2.7"
- - "3.4"
- "3.5"
- "3.6"
- "3.7"
- - "pypy2.7-6.0"
- - "pypy3.5-6.0"
+ - "3.8-dev"
+ - "pypy"
+ - "pypy3"
install:
- pip install pip -U
diff --git a/setup.py b/setup.py
index 83fcf63..00a7f4b 100755
--- a/setup.py
+++ b/setup.py
@@ -24,12 +24,9 @@ classifiers = [
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.2',
- 'Programming Language :: Python :: 3.3',
- 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
@@ -68,6 +65,7 @@ setup(
packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES),
install_requires=install_requires,
extras_require=extras_require,
+ python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
classifiers=classifiers,
entry_points={'console_scripts': ['slugify=slugify.slugify:main']},
)
diff --git a/slugify/slugify.py b/slugify/slugify.py
index 6e66ace..4268fd1 100644
--- a/slugify/slugify.py
+++ b/slugify/slugify.py
@@ -62,9 +62,9 @@ def smart_truncate(string, max_length=0, word_boundary=False, separator=' ', sav
if word:
next_len = len(truncated) + len(word)
if next_len < max_length:
- truncated += '{0}{1}'.format(word, separator)
+ truncated += '{}{}'.format(word, separator)
elif next_len == max_length:
- truncated += '{0}'.format(word)
+ truncated += '{}'.format(word)
break
else:
if save_order:
diff --git a/test.py b/test.py
index 29f0ac7..98debff 100644
--- a/test.py
+++ b/test.py
@@ -242,18 +242,5 @@ class TestUtils(unittest.TestCase):
self.assertEqual(r, txt)
-class TestUtils(unittest.TestCase):
-
- def test_smart_truncate_no_max_length(self):
- txt = '1,000 reasons you are #1'
- r = smart_truncate(txt)
- self.assertEqual(r, txt)
-
- def test_smart_truncate_no_seperator(self):
- txt = '1,000 reasons you are #1'
- r = smart_truncate(txt, max_length=100, separator='_')
- self.assertEqual(r, txt)
-
-
if __name__ == '__main__':
unittest.main()