|
32 | 32 |
|
33 | 33 | import ckipnlp as about |
34 | 34 |
|
35 | | -with open('README.rst', encoding='utf-8') as fin: |
36 | | - readme = fin.read() |
| 35 | +################################################################################ |
| 36 | + |
| 37 | +def main(): |
| 38 | + |
| 39 | + with open('README.rst', encoding='utf-8') as fin: |
| 40 | + readme = fin.read() |
| 41 | + |
| 42 | + setup( |
| 43 | + name=about.__name__, |
| 44 | + version=about.__version__, |
| 45 | + author=about.__author_name__, |
| 46 | + author_email=about.__author_email__, |
| 47 | + description=about.__description__, |
| 48 | + long_description=readme, |
| 49 | + long_description_content_type='text/x-rst', |
| 50 | + url=about.__url__, |
| 51 | + download_url=about.__download_url__, |
| 52 | + platforms=['linux_x86_64'], |
| 53 | + license=about.__license__, |
| 54 | + classifiers=[ |
| 55 | + 'Development Status :: 4 - Beta', |
| 56 | + 'Environment :: Console', |
| 57 | + 'Programming Language :: Python', |
| 58 | + 'Programming Language :: Python :: 3', |
| 59 | + 'Programming Language :: Python :: 3.5', |
| 60 | + 'Programming Language :: Python :: 3.6', |
| 61 | + 'Programming Language :: Python :: 3.7', |
| 62 | + 'Programming Language :: Python :: 3.8', |
| 63 | + 'Programming Language :: Python :: 3.9', |
| 64 | + 'Programming Language :: Python :: 3 :: Only', |
| 65 | + 'Programming Language :: Cython', |
| 66 | + 'License :: Free for non-commercial use', |
| 67 | + 'Operating System :: POSIX :: Linux', |
| 68 | + 'Natural Language :: Chinese (Traditional)', |
| 69 | + ], |
| 70 | + python_requires='>=3.5', |
| 71 | + packages=find_namespace_packages(include=['ckipnlp', 'ckipnlp.*',]), |
| 72 | + install_requires=[ |
| 73 | + 'treelib>=1.5.5', |
| 74 | + ], |
| 75 | + ext_modules=cythonize( |
| 76 | + [ |
| 77 | + Extension('ckipnlp._core.ws', |
| 78 | + sources=['src/ws/ckipws.pyx'], |
| 79 | + libraries=['WordSeg'], |
| 80 | + language='c++', |
| 81 | + ), |
| 82 | + Extension('ckipnlp._core.parser', |
| 83 | + sources=['src/parser/ckipparser.pyx'], |
| 84 | + libraries=['CKIPCoreNLP', 'CKIPParser', 'CKIPWS', 'CKIPSRL'], |
| 85 | + language='c++', |
| 86 | + ), |
| 87 | + ], |
| 88 | + build_dir='build', |
| 89 | + ), |
| 90 | + data_files=[], |
| 91 | + cmdclass={ |
| 92 | + 'install': InstallCommand, |
| 93 | + 'develop': DevelopCommand, |
| 94 | + }, |
| 95 | + ) |
37 | 96 |
|
38 | 97 | ################################################################################ |
39 | 98 |
|
@@ -97,10 +156,10 @@ def finalize_options(self): |
97 | 156 |
|
98 | 157 | # subdirectory |
99 | 158 | opt_subdirectory = [ |
100 | | - ('ws_lib_dir', 'ws_dir', 'lib',), |
101 | | - ('ws_share_dir', 'ws_dir', '',), |
102 | | - ('parser_lib_dir', 'parser_dir', 'lib',), |
103 | | - ('parser_share_dir','parser_dir', '',), |
| 159 | + ('ws_lib_dir', 'ws_dir', 'lib',), |
| 160 | + ('ws_share_dir', 'ws_dir', '',), |
| 161 | + ('parser_lib_dir', 'parser_dir', 'lib',), |
| 162 | + ('parser_share_dir', 'parser_dir', '',), |
104 | 163 |
|
105 | 164 | ('data2_dir', 'ws_share_dir', 'Data2',), |
106 | 165 | ('data2_dir', 'parser_share_dir', 'Data2',), |
@@ -199,52 +258,5 @@ def __init__(self, *args, **kwargs): |
199 | 258 |
|
200 | 259 | ################################################################################ |
201 | 260 |
|
202 | | -setup( |
203 | | - name=about.__name__, |
204 | | - version=about.__version__, |
205 | | - author=about.__author_name__, |
206 | | - author_email=about.__author_email__, |
207 | | - description=about.__description__, |
208 | | - long_description=readme, |
209 | | - long_description_content_type='text/x-rst', |
210 | | - url=about.__url__, |
211 | | - download_url=about.__download_url__, |
212 | | - platforms=['linux_x86_64'], |
213 | | - license=about.__license__, |
214 | | - classifiers=[ |
215 | | - 'Development Status :: 4 - Beta', |
216 | | - 'Environment :: Console', |
217 | | - 'Programming Language :: Python', |
218 | | - 'Programming Language :: Python :: 3', |
219 | | - 'Programming Language :: Python :: 3.5', |
220 | | - 'Programming Language :: Python :: 3.6', |
221 | | - 'Programming Language :: Python :: 3.7', |
222 | | - 'Programming Language :: Cython', |
223 | | - 'License :: Free for non-commercial use', |
224 | | - 'Operating System :: POSIX :: Linux', |
225 | | - 'Natural Language :: Chinese (Traditional)', |
226 | | - ], |
227 | | - python_requires='>=3.5', |
228 | | - packages=find_namespace_packages(include=['ckipnlp', 'ckipnlp.*', 'ckipws', 'ckipparser',]), |
229 | | - install_requires=[ |
230 | | - 'treelib>=1.5.5', |
231 | | - ], |
232 | | - ext_modules=cythonize( |
233 | | - [ |
234 | | - Extension('ckipnlp._core.ws', |
235 | | - sources=['src/ws/ckipws.pyx'], |
236 | | - libraries=['WordSeg'], |
237 | | - ), |
238 | | - Extension('ckipnlp._core.parser', |
239 | | - sources=['src/parser/ckipparser.pyx'], |
240 | | - libraries=['CKIPCoreNLP','CKIPParser','CKIPWS','CKIPSRL'], |
241 | | - ), |
242 | | - ], |
243 | | - build_dir='build', |
244 | | - ), |
245 | | - data_files=[], |
246 | | - cmdclass={ |
247 | | - 'install': InstallCommand, |
248 | | - 'develop': DevelopCommand, |
249 | | - }, |
250 | | -) |
| 261 | +if __name__ == '__main__': |
| 262 | + main() |
0 commit comments