diff options
author | Val Neekman <un33kvu@gmail.com> | 2019-10-20 13:39:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-20 13:39:51 -0400 |
commit | 76f327216bc52adc6115eb6d1483405958810c5c (patch) | |
tree | e5eb48e5627724062166eeb6e2898f6c0acfd0be | |
parent | b9db1bc87e3b19c5c63ab7a00b19685b7996de5d (diff) | |
download | python-slugify-76f327216bc52adc6115eb6d1483405958810c5c.tar.gz |
Drop support for old python - cleanup - up version (#88)4.0.0
* 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
* up version
-rw-r--r-- | .travis.yml | 6 | ||||
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rwxr-xr-x | setup.py | 6 | ||||
-rw-r--r-- | slugify/__init__.py | 2 | ||||
-rw-r--r-- | slugify/slugify.py | 4 | ||||
-rw-r--r-- | test.py | 13 |
6 files changed, 11 insertions, 23 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/CHANGELOG.md b/CHANGELOG.md index 7210471..ba9b28c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 4.0.0 + - Drop support from 2.6, & < 3.4.5 + ## 3.0.6 - Fixed encoding in special.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/__init__.py b/slugify/__init__.py index b1dfecb..ab72a8e 100644 --- a/slugify/__init__.py +++ b/slugify/__init__.py @@ -4,4 +4,4 @@ from .slugify import * __author__ = 'Val Neekman @ Neekware Inc. [@vneekman]' __description__ = 'A Python slugify application that also handles Unicode' -__version__ = '3.0.6' +__version__ = '4.0.0' 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: @@ -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() |