-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
98 lines (79 loc) · 3.14 KB
/
setup.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import os.path as osp
import platform
import sys
from setuptools import find_namespace_packages, setup
# Ensure user has the correct Python version
if sys.version_info < (3, 7):
print("Mathics support Python 3.7 and above; you have %d.%d" % sys.version_info[:2])
sys.exit(-1)
def get_srcdir():
filename = osp.normcase(osp.dirname(osp.abspath(__file__)))
return osp.realpath(filename)
def read(*rnames):
return open(osp.join(get_srcdir(), *rnames)).read()
# Get/set VERSION and long_description from files
long_description = read("README.rst") + "\n"
__version__ = "0.0.0" # overwritten by exec below
# stores __version__ in the current namespace
exec(compile(open("pymathics/natlang/version.py").read(), "version.py", "exec"))
is_PyPy = platform.python_implementation() == "PyPy"
# Install a wordlist.
# Environment variables "lang", "WORDLIST_SIZE", and "SPACY_DOWNLOAD" override defaults.
# 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", "%s" % (lang,))
# FIXME:
# consider using langid3 and pyenchant
setup(
name="pymathics-natlang",
version=__version__,
packages=find_namespace_packages(include=["pymathics.*"]),
install_requires=[
"Mathics3>=7.0.0.dev0",
"click>=8.0",
"joblib>=1.0.1",
"langid", # replace with a supported newer package, e.g. via spacy
"llvmlite>=0.36",
"nltk>=3.8.0",
"pattern>=3.6.0",
"pyenchant>=3.2.0",
"pycountry>=3.2.0",
"spacy>=3.4",
"wasabi<1.1.0,>=0.8.2",
],
zip_safe=False,
maintainer="Mathics3 Group",
maintainer_email="[email protected]",
long_description=long_description,
long_description_content_type="text/x-rst",
# metadata for upload to PyPI
classifiers=[
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Software Development :: Interpreters",
"Topic :: Scientific/Engineering :: Human Machine Interfaces",
"Topic :: Text Processing",
"Topic :: Text Processing :: Linguistic",
],
# TODO: could also include long_description, download_url,
)
os.system("%s -m spacy download %s" % (sys.executable, lang))
os.system("%s -m nltk.downloader 'wordnet2022 omw" % sys.executable)