-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
140 lines (129 loc) · 4.21 KB
/
Copy pathsetup.py
File metadata and controls
140 lines (129 loc) · 4.21 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/usr/bin/env python
#
# Setup script for the Natural Language Toolkit
#
# Copyright (C) 2001-2026 NLTK Project
# Author: NLTK Team <nltk.team@gmail.com>
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
# Work around mbcs bug in distutils.
# https://bugs.python.org/issue10945
import codecs
try:
codecs.lookup("mbcs")
except LookupError:
ascii = codecs.lookup("ascii")
func = lambda name, enc=ascii: {True: enc}.get(name == "mbcs")
codecs.register(func)
import os
# Use the VERSION file to get NLTK version
version_file = os.path.join(os.path.dirname(__file__), "nltk", "VERSION")
with open(version_file) as fh:
nltk_version = fh.read().strip()
# Use README.md as the long description shown on PyPI. Fall back to a short
# blurb if it is unavailable, so a build can never fail on a missing README.
_short_description = (
"The Natural Language Toolkit (NLTK) is a Python package for "
"natural language processing."
)
readme_file = os.path.join(os.path.dirname(__file__), "README.md")
try:
with open(readme_file, encoding="utf-8") as fh:
long_description = fh.read()
long_description_content_type = "text/markdown"
except OSError:
long_description = _short_description
long_description_content_type = "text/plain"
# setuptools
from setuptools import find_packages, setup
# Specify groups of optional dependencies
extras_require = {
"machine_learning": [
"numpy",
"python-crfsuite",
"scikit-learn",
"scipy",
],
"plot": ["matplotlib"],
"tgrep": ["pyparsing"],
"twitter": ["twython"],
"corenlp": ["requests"],
}
# Add a group made up of all optional dependencies
extras_require["all"] = {
package for group in extras_require.values() for package in group
}
# Adds CLI commands
console_scripts = """
[console_scripts]
nltk=nltk.cli:cli
"""
_project_homepage = "https://www.nltk.org/"
setup(
name="nltk",
description="Natural Language Toolkit",
version=nltk_version,
url=_project_homepage,
project_urls={
"Documentation": _project_homepage,
"Source Code": "https://github.com/nltk/nltk",
"Issue Tracker": "https://github.com/nltk/nltk/issues",
},
long_description=long_description,
long_description_content_type=long_description_content_type,
license="Apache License, Version 2.0",
keywords=[
"NLP",
"CL",
"natural language processing",
"computational linguistics",
"parsing",
"tagging",
"tokenizing",
"syntax",
"linguistics",
"language",
"natural language",
"text analytics",
],
maintainer="NLTK Team",
maintainer_email="nltk.team@gmail.com",
author="NLTK Team",
author_email="nltk.team@gmail.com",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Human Machine Interfaces",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Text Processing",
"Topic :: Text Processing :: Filters",
"Topic :: Text Processing :: General",
"Topic :: Text Processing :: Indexing",
"Topic :: Text Processing :: Linguistic",
],
package_data={"nltk": ["test/*.doctest", "VERSION"]},
python_requires=">=3.10",
install_requires=[
"defusedxml",
"click",
"joblib",
"regex>=2021.8.3",
"tqdm",
],
extras_require=extras_require,
packages=find_packages(),
zip_safe=False, # since normal files will be present too?
entry_points=console_scripts,
)