From 76f327216bc52adc6115eb6d1483405958810c5c Mon Sep 17 00:00:00 2001 From: Val Neekman Date: Sun, 20 Oct 2019 13:39:51 -0400 Subject: Drop support for old python - cleanup - up version (#88) * 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 --- .travis.yml | 6 +++--- CHANGELOG.md | 3 +++ setup.py | 6 ++---- slugify/__init__.py | 2 +- slugify/slugify.py | 4 ++-- 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 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/__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: 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() -- cgit v1.2.1 From 2889262308f3fba2b50d8ff7ce404a09353a9568 Mon Sep 17 00:00:00 2001 From: Val Neekman Date: Sun, 20 Oct 2019 13:45:47 -0400 Subject: add contribution section --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 800b7a6..239f263 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,12 @@ To run the tests against the current environment: python test.py +Contribution +==================== + +Please read the ([wiki](https://github.com/un33k/python-slugify/wiki/Python-Slugify-Wiki)) page prior to raising any PRs. + + License ==================== -- cgit v1.2.1