|
1 |
| -#!/usr/bin/env python |
| 1 | +#!/usr/bin/env python3 |
2 | 2 |
|
3 | 3 | # Copyright 2017-2020 Palantir Technologies, Inc.
|
4 | 4 | # Copyright 2021- Python Language Server Contributors.
|
5 | 5 |
|
6 |
| -import ast |
7 |
| -import os |
8 |
| -from setuptools import find_packages, setup |
| 6 | +from setuptools import setup, find_packages |
9 | 7 |
|
10 |
| -HERE = os.path.abspath(os.path.dirname(__file__)) |
11 |
| - |
12 |
| - |
13 |
| -def get_version(module='pylsp'): |
14 |
| - """Get version.""" |
15 |
| - with open(os.path.join(HERE, module, '_version.py'), 'r') as f: |
16 |
| - data = f.read() |
17 |
| - lines = data.split('\n') |
18 |
| - for line in lines: |
19 |
| - if line.startswith('VERSION_INFO'): |
20 |
| - version_tuple = ast.literal_eval(line.split('=')[-1].strip()) |
21 |
| - version = '.'.join(map(str, version_tuple)) |
22 |
| - break |
23 |
| - return version |
24 |
| - |
25 |
| - |
26 |
| -README = open('README.md', 'r').read() |
27 |
| - |
28 |
| -install_requires = [ |
29 |
| - 'jedi>=0.17.2,<0.19.0', |
30 |
| - 'python-lsp-jsonrpc>=1.0.0', |
31 |
| - 'pluggy', |
32 |
| - 'ujson>=3.0.0', |
33 |
| - 'setuptools>=39.0.0' |
34 |
| -] |
35 |
| - |
36 |
| -setup( |
37 |
| - name='python-lsp-server', |
38 |
| - version=get_version(), |
39 |
| - description='Python Language Server for the Language Server Protocol', |
40 |
| - long_description=README, |
41 |
| - long_description_content_type='text/markdown', |
42 |
| - url='https://github.com/python-lsp/python-lsp-server', |
43 |
| - author='Python Language Server Contributors', |
44 |
| - packages=find_packages(exclude=['contrib', 'docs', 'test', 'test.*']), |
45 |
| - install_requires=install_requires, |
46 |
| - python_requires='>=3.7', |
47 |
| - extras_require={ |
48 |
| - 'all': [ |
49 |
| - 'autopep8>=1.6.0,<1.7.0', |
50 |
| - 'flake8>=4.0.0,<4.1.0', |
51 |
| - 'mccabe>=0.6.0,<0.7.0', |
52 |
| - 'pycodestyle>=2.8.0,<2.9.0', |
53 |
| - 'pydocstyle>=2.0.0', |
54 |
| - 'pyflakes>=2.4.0,<2.5.0', |
55 |
| - 'pylint>=2.5.0', |
56 |
| - 'rope>=0.10.5', |
57 |
| - 'yapf', |
58 |
| - ], |
59 |
| - 'autopep8': ['autopep8>=1.6.0,<1.7.0'], |
60 |
| - 'flake8': ['flake8>=4.0.0,<4.1.0'], |
61 |
| - 'mccabe': ['mccabe>=0.6.0,<0.7.0'], |
62 |
| - 'pycodestyle': ['pycodestyle>=2.8.0,<2.9.0'], |
63 |
| - 'pydocstyle': ['pydocstyle>=2.0.0'], |
64 |
| - 'pyflakes': ['pyflakes>=2.4.0,<2.5.0'], |
65 |
| - 'pylint': ['pylint>=2.5.0'], |
66 |
| - 'rope': ['rope>0.10.5'], |
67 |
| - 'yapf': ['yapf'], |
68 |
| - 'test': ['pylint>=2.5.0', 'pytest', 'pytest-cov', 'coverage', |
69 |
| - 'numpy', 'pandas', 'matplotlib', 'pyqt5', 'flaky'], |
70 |
| - }, |
71 |
| - entry_points={ |
72 |
| - 'console_scripts': [ |
73 |
| - 'pylsp = pylsp.__main__:main', |
74 |
| - ], |
75 |
| - 'pylsp': [ |
76 |
| - 'autopep8 = pylsp.plugins.autopep8_format', |
77 |
| - 'folding = pylsp.plugins.folding', |
78 |
| - 'flake8 = pylsp.plugins.flake8_lint', |
79 |
| - 'jedi_completion = pylsp.plugins.jedi_completion', |
80 |
| - 'jedi_definition = pylsp.plugins.definition', |
81 |
| - 'jedi_hover = pylsp.plugins.hover', |
82 |
| - 'jedi_highlight = pylsp.plugins.highlight', |
83 |
| - 'jedi_references = pylsp.plugins.references', |
84 |
| - 'jedi_rename = pylsp.plugins.jedi_rename', |
85 |
| - 'jedi_signature_help = pylsp.plugins.signature', |
86 |
| - 'jedi_symbols = pylsp.plugins.symbols', |
87 |
| - 'mccabe = pylsp.plugins.mccabe_lint', |
88 |
| - 'preload = pylsp.plugins.preload_imports', |
89 |
| - 'pycodestyle = pylsp.plugins.pycodestyle_lint', |
90 |
| - 'pydocstyle = pylsp.plugins.pydocstyle_lint', |
91 |
| - 'pyflakes = pylsp.plugins.pyflakes_lint', |
92 |
| - 'pylint = pylsp.plugins.pylint_lint', |
93 |
| - 'rope_completion = pylsp.plugins.rope_completion', |
94 |
| - 'rope_rename = pylsp.plugins.rope_rename', |
95 |
| - 'yapf = pylsp.plugins.yapf_format' |
96 |
| - ] |
97 |
| - }, |
98 |
| -) |
| 8 | +if __name__ == "__main__": |
| 9 | + setup( |
| 10 | + name="python-lsp-server", # to allow GitHub dependency tracking work |
| 11 | + packages=find_packages(exclude=["contrib", "docs", "test", "test.*"]), # https://github.com/pypa/setuptools/issues/2688 |
| 12 | + ) |
0 commit comments