-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
35 lines (24 loc) · 867 Bytes
/
setup.py
File metadata and controls
35 lines (24 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup
from setuptools.command.egg_info import egg_info
# Full package name with two-letter language code, e.g. fr, zh
lang = os.environ.get("lang", "en_core_web_md")
# Size of wordlist used
# sm=small, lg=large, md=medium.
WORDLIST_SIZE = os.environ.get("WORDLIST_SIZE", "md")
SPACY_DOWNLOAD = os.environ.get("SPACY_DOWNLOAD", lang)
class CustomCommands(egg_info):
"""This runs as part of building an sdist"""
def finalize_options(self):
"""Run program to create JSON tables"""
os.system(f"{sys.executable} -m spacy download {lang}")
os.system(f"{sys.executable} -m nltk.downloader 'wordnet2022 omw")
super().finalize_options()
# FIXME:
# consider using langid3 and pyenchant
setup(
cmdclass={"egg_info": CustomCommands},
zip_safe=False,
)