diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index df4d463..561a738 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -21,9 +21,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel + pip install build - name: Build package - run: python setup.py sdist bdist_wheel + run: python -m build - name: Publish package uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/VERSION b/VERSION deleted file mode 100644 index adc97d8..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.18 diff --git a/anakinls/__main__.py b/anakinls/__main__.py index e1ea589..61c9de5 100644 --- a/anakinls/__main__.py +++ b/anakinls/__main__.py @@ -18,7 +18,7 @@ import logging from .server import server -from .version import __version__ +from ._version import version logging.basicConfig(level=logging.INFO) logging.getLogger('pygls.protocol').setLevel(logging.WARN) @@ -56,7 +56,7 @@ def main(): args = parser.parse_args() if args.version: - print(inspect.cleandoc(f'''anakinls v{__version__} + print(inspect.cleandoc(f'''anakinls v{version} Copyright (C) 2020 Andrii Kolomoiets This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A diff --git a/anakinls/_version.py b/anakinls/_version.py new file mode 100644 index 0000000..7d1afe0 --- /dev/null +++ b/anakinls/_version.py @@ -0,0 +1,2 @@ +# Will be generated by setuptools_scm +version = '1' diff --git a/anakinls/server.py b/anakinls/server.py index 72f946a..c109502 100644 --- a/anakinls/server.py +++ b/anakinls/server.py @@ -40,7 +40,7 @@ from pygls.protocol import LanguageServerProtocol, lsp_method from pygls.uris import to_fs_path -from .version import __version__ # type: ignore +from ._version import version RE_WORD = re.compile(r'\w*') @@ -128,7 +128,7 @@ def get_attr(o, *attrs): server = LanguageServer( name='anakinls', - version=__version__, + version=version, protocol_cls=AnakinLanguageServerProtocol ) diff --git a/anakinls/version.py b/anakinls/version.py deleted file mode 100644 index bf63db1..0000000 --- a/anakinls/version.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (C) 2020 Andrii Kolomoiets -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -from pathlib import Path - - -__all__ = ['__version__'] - - -__version__ = (Path(__file__).parents[1] / 'VERSION').read_text().strip() diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..67ba90c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,37 @@ +[project] +name = "anakin-language-server" +dynamic = ["version"] +description = "Yet another Jedi Python language server" +readme = "README.md" +requires-python = ">=3.7.16" +dependencies = [ + "jedi>=0.19.0", + "pygls>=1.1,<1.2", + "pyflakes~=2.2", + "pycodestyle~=2.5", + "yapf~=0.30", +] +license = {file = "LICENSE"} +authors = [{name = "Andrii Kolomoiets", email = "andreyk.mad@gmail.com"}] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Topic :: Text Editors :: Integrated Development Environments (IDE)", +] + +[project.urls] +"Homepage" = "https://github.com/muffinmad/anakin-language-server" +"Bug Reports" = "https://github.com/muffinmad/anakin-language-server/issues" +"Source" = "https://github.com/muffinmad/anakin-language-server" + +[project.scripts] +anakinls = "anakinls.__main__:main" + +[tool.setuptools_scm] +version_file = "anakinls/_version.py" + +[build-system] +requires = ["setuptools>=64", "setuptools_scm>=8"] diff --git a/setup.py b/setup.py deleted file mode 100644 index be53be4..0000000 --- a/setup.py +++ /dev/null @@ -1,38 +0,0 @@ -from pathlib import Path -from setuptools import setup # type: ignore - -from anakinls import version - - -setup( - name='anakin-language-server', - version=version.__version__, - author='Andrii Kolomoiets', - author_email='andreyk.mad@gmail.com', - description='Yet another Jedi Python language server', - long_description=Path('README.md').read_text(), - long_description_content_type='text/markdown', - url='https://github.com/muffinmad/anakin-language-server', - packages=['anakinls'], - python_requires='>=3.6', - install_requires=[ - 'jedi>=0.19.0', - 'pygls>=1.1,<1.2', - 'pyflakes~=2.2', - 'pycodestyle~=2.5', - 'yapf~=0.30' - ], - entry_points={ - 'console_scripts': [ - 'anakinls=anakinls.__main__:main' - ] - }, - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Topic :: Text Editors :: Integrated Development Environments (IDE)" - ] -)