Skip to content

Commit

Permalink
Drop support for EOL Python 2.6 and 3.2-2.4 (#87)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
hugovk authored and un33k committed Oct 14, 2019
1 parent b9db1bc commit 588372d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@
'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',
Expand Down Expand Up @@ -68,6 +65,7 @@ def get_version(package):
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']},
)
4 changes: 2 additions & 2 deletions slugify/slugify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 0 additions & 13 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,18 +242,5 @@ def test_smart_truncate_no_seperator(self):
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()

0 comments on commit 588372d

Please sign in to comment.