Skip to content

Commit 08670fa

Browse files
author
perrette
committed
use python-slugify instead of normality
get rid of pyicu dependency
1 parent 8322c8d commit 08670fa

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

papers/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from papers.bib import (Biblio, FUZZY_RATIO, DEFAULT_SIMILARITY, entry_filecheck,
2222
backupfile as backupfile_func, isvalidkey, DuplicateKeyError, clean_filesdir)
2323
from papers.utils import move, checksum, view_pdf, open_folder
24+
from papers.compat import slugify
2425
from papers import __version__
2526

2627

@@ -424,7 +425,6 @@ def installcmd(parser, o, config):
424425
config.gitdir = o.gitdir
425426

426427
elif config.bibtex is not None:
427-
from normality import slugify
428428
bibi = config.bibtex[:-len(".bib")] if config.bibtex.endswith(".bib") else config.bibtex
429429
config.gitdir = os.path.join(BACKUP_DIR, slugify(bibi))
430430

papers/compat.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# compat
2+
from slugify import slugify
3+
from unidecode import unidecode
4+
5+
def normalize(text):
6+
if text is None:
7+
return None
8+
return unidecode(text).strip()

papers/filename.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Key and file name formatting
33
"""
4-
from normality import slugify, normalize
4+
from papers.compat import slugify, normalize
55
from papers.encoding import family_names
66

77
def listtag(words, maxlength=30, minwordlen=3, n=100, sep='-'):

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies = [
2222
"bibtexparser",
2323
"scholarly",
2424
"rapidfuzz",
25-
"normality",
25+
"python-slugify",
2626
"bs4",
2727
]
2828
dynamic = ["version"]
@@ -65,7 +65,7 @@ deps =
6565
crossrefapi
6666
rapidfuzz
6767
unidecode
68-
normality
68+
python-slugify
6969
bs4
7070
pytest
7171
pytest-cov

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ crossrefapi
44
bibtexparser < 2.0.0
55
scholarly
66
rapidfuzz
7-
normality
8-
bs4
7+
bs4
8+
python-slugify

0 commit comments

Comments
 (0)