Skip to content

Commit b8be7d6

Browse files
authored
Promote text-unidecode to primary decoding api (#73)
* enable raw re pattern * conditional text_unidecode install * update readme, changelog, manifest * update ci * readme * drop test for py 2.6 and 3.3 * clean up readme * readme * add support user-specific replacements (#66) thx * clean up, up version * add text-unidecode option as extra * Upgrade Unidecode, add text-unidecode as extra option (#71) * Add replacements option (#67) * add text-unidecode option as extra * remove req.txt files * Optional Extra Requirements (#72) * Add replacements option (#67) * Upgrade Unidecode, add text-unidecode as extra option (#71) * Add replacements option (#67) * add text-unidecode option as extra * remove req.txt files * use text-unidecode as primary decoding package * add dev reqs
1 parent 1340320 commit b8be7d6

8 files changed

Lines changed: 17 additions & 24 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 3.0.0
2+
- Upgrade Unidecode
3+
- Promote text-unidecode as the primary decoding package
4+
- Add Unidecode as an optional extra. "pip install python-slugify[unidecode]"
5+
16
## 2.0.1
27
- Add replacements option e.g. [['|', 'or'], ['%', 'percent'], ['-', '_']] (@andriyor)
38

‎README.md‎

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,16 @@ Overview
1515
Notice
1616
====================
1717

18-
By default, this modules installs and uses [Unidecode](https://github.com/avian2/unidecode) *(GPL)* for its decoding needs. However if you wish to use [text-unidecode](https://github.com/kmike/text-unidecode) *(GPL & Perl Artistic)* instead, please ensure it is installed prior to `python-slugify` installation.
18+
This module, by default installs and uses [text-unidecode](https://github.com/kmike/text-unidecode) *(GPL & Perl Artistic)* for its decoding needs.
1919

20-
In cases where both `Unidecode` and `text-unidecode` are installed, `Unidecode` is used as the default decoding module.
20+
However, there is an alternative decoding package called [Unidecode](https://github.com/avian2/unidecode) *(GPL)*. It can be installed as `python-slugify[unidecode]` for those who prefer it.
2121

2222

2323
How to install
2424
====================
25-
26-
1. easy_install python-slugify
27-
2. pip install python-slugify
28-
3. git clone http://github.com/un33k/python-slugify
29-
a. cd python-slugify
30-
b. python setup.py install
31-
4. wget https://github.com/un33k/python-slugify/zipball/master
32-
a. unzip the downloaded file
33-
b. cd python-slugify-*
34-
c. python setup.py install
35-
25+
easy_install python-slugify |OR| easy_install python-slugify[unidecode]
26+
-- OR --
27+
pip install python-slugify |OR| pip install python-slugify[unidecode]
3628

3729
How to use
3830
====================

‎dev.requirements.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pycodestyle==2.5.0

‎requirements.txt‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎requirements_alt.txt‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎setup.py‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,15 @@
77
import sys
88
import codecs
99

10-
install_requires = []
11-
try:
12-
import text_unidecode
13-
except ImportError:
14-
install_requires.append('Unidecode>=0.04.16')
15-
1610
name = 'python-slugify'
1711
package = 'slugify'
1812
description = 'A Python Slugify application that handles Unicode'
1913
url = 'https://github.com/un33k/python-slugify'
2014
author = 'Val Neekman'
2115
author_email = '[email protected]'
2216
license = 'MIT'
17+
install_requires = ['text-unidecode==1.2']
18+
extras_require = {'unidecode': ['Unidecode==1.0.23']}
2319

2420
classifiers = [
2521
'Development Status :: 5 - Production/Stable',
@@ -70,6 +66,7 @@ def get_version(package):
7066
author_email=author_email,
7167
packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES),
7268
install_requires=install_requires,
69+
extras_require=extras_require,
7370
classifiers=classifiers,
7471
entry_points={'console_scripts': ['slugify=slugify.slugify:main']},
7572
)

‎slugify/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
__author__ = 'Val Neekman @ Neekware Inc. [@vneekman]'
55
__description__ = 'A Python slugify application that also handles Unicode'
6-
__version__ = '2.0.1'
6+
__version__ = '3.0.0'

‎slugify/slugify.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
unichr = chr
1515

1616
try:
17-
import unidecode
18-
except ImportError:
1917
import text_unidecode as unidecode
18+
except ImportError:
19+
import unidecode
2020

2121
__all__ = ['slugify', 'smart_truncate']
2222

0 commit comments

Comments
 (0)