Skip to content

Commit

Permalink
Drop support for old python - cleanup - up version (#88)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
un33k authored Oct 20, 2019
1 parent b9db1bc commit 76f3272
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 23 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 4.0.0
- Drop support from 2.6, & < 3.4.5

## 3.0.6
- Fixed encoding in special.py

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']},
)
2 changes: 1 addition & 1 deletion slugify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

__author__ = 'Val Neekman @ Neekware Inc. [@vneekman]'
__description__ = 'A Python slugify application that also handles Unicode'
__version__ = '3.0.6'
__version__ = '4.0.0'
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 76f3272

Please sign in to comment.