From bf9d5fac13d36ff10235b5e85f8dadcad34e0ba1 Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Mon, 9 May 2022 16:50:49 +0000 Subject: [PATCH] Move the project metadata into `PEP 621`-compliant `pyproject.toml` (#207) --- pyproject.toml | 91 +++++++++++++++++++++++++++++++++++++++++++++++++- setup.cfg | 87 ----------------------------------------------- setup.py | 1 - 3 files changed, 90 insertions(+), 89 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cbad00d4..1aa50163 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,96 @@ [build-system] -requires = ["setuptools>=44", "wheel", "setuptools_scm[toml]>=3.4.3"] +requires = ["setuptools>=61.2.0", "wheel", "setuptools_scm[toml]>=3.4.3"] build-backend = "setuptools.build_meta" +[project] +name = "python-lsp-server" +authors = [{name = "Python Language Server Contributors"}] +description = "Python Language Server for the Language Server Protocol" +readme = "README.md" +license = {text = "MIT"} +requires-python = ">=3.7" +dependencies = [ + "jedi>=0.17.2,<0.19.0", + "python-lsp-jsonrpc>=1.0.0", + "pluggy>=1.0.0", + "ujson>=3.0.0", + "setuptools>=39.0.0", +] +dynamic = ["version"] + +[project.urls] +Homepage = "https://github.com/python-lsp/python-lsp-server" + +[project.optional-dependencies] +all = [ + "autopep8>=1.6.0,<1.7.0", + "flake8>=4.0.0,<4.1.0", + "mccabe>=0.6.0,<0.7.0", + "pycodestyle>=2.8.0,<2.9.0", + "pydocstyle>=2.0.0", + "pyflakes>=2.4.0,<2.5.0", + "pylint>=2.5.0", + "rope>=0.10.5", + "yapf", +] +autopep8 = ["autopep8>=1.6.0,<1.7.0"] +flake8 = ["flake8>=4.0.0,<4.1.0"] +mccabe = ["mccabe>=0.6.0,<0.7.0"] +pycodestyle = ["pycodestyle>=2.8.0,<2.9.0"] +pydocstyle = ["pydocstyle>=2.0.0"] +pyflakes = ["pyflakes>=2.4.0,<2.5.0"] +pylint = ["pylint>=2.5.0"] +rope = ["rope>0.10.5"] +yapf = ["yapf"] +test = [ + "pylint>=2.5.0", + "pytest", + "pytest-cov", + "coverage", + "numpy", + "pandas", + "matplotlib", + "pyqt5", + "flaky", +] + +[project.entry-points.pylsp] +autopep8 = "pylsp.plugins.autopep8_format" +folding = "pylsp.plugins.folding" +flake8 = "pylsp.plugins.flake8_lint" +jedi_completion = "pylsp.plugins.jedi_completion" +jedi_definition = "pylsp.plugins.definition" +jedi_hover = "pylsp.plugins.hover" +jedi_highlight = "pylsp.plugins.highlight" +jedi_references = "pylsp.plugins.references" +jedi_rename = "pylsp.plugins.jedi_rename" +jedi_signature_help = "pylsp.plugins.signature" +jedi_symbols = "pylsp.plugins.symbols" +mccabe = "pylsp.plugins.mccabe_lint" +preload = "pylsp.plugins.preload_imports" +pycodestyle = "pylsp.plugins.pycodestyle_lint" +pydocstyle = "pylsp.plugins.pydocstyle_lint" +pyflakes = "pylsp.plugins.pyflakes_lint" +pylint = "pylsp.plugins.pylint_lint" +rope_completion = "pylsp.plugins.rope_completion" +rope_rename = "pylsp.plugins.rope_rename" +yapf = "pylsp.plugins.yapf_format" + +[project.scripts] +pylsp = "pylsp.__main__:main" + +[tool.setuptools] +license-files = ["LICENSE"] +include-package-data = false + +[tool.setuptools.packages.find] +exclude = ["contrib", "docs", "test", "test.*", "test.plugins", "test.plugins.*"] +namespaces = false + [tool.setuptools_scm] write_to = "pylsp/_version.py" write_to_template = "__version__ = \"{version}\"\n" # VERSION_INFO is populated in __main__ + +[tool.pytest.ini_options] +testpaths = ["test"] +addopts = "--cov-report html --cov-report term --junitxml=pytest.xml --cov pylsp --cov test" diff --git a/setup.cfg b/setup.cfg index 17db54d9..0b2f84ca 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,91 +1,4 @@ -[metadata] -name = python-lsp-server -author = Python Language Server Contributors -description = Python Language Server for the Language Server Protocol -url = https://github.com/python-lsp/python-lsp-server -long_description = file: README.md -long_description_content_type = text/markdown -license = MIT -license_file = LICENSE - -[options] -packages = find: -python_requires = >=3.7 -install_requires = - jedi>=0.17.2,<0.19.0 - python-lsp-jsonrpc>=1.0.0 - pluggy>=1.0.0 - ujson>=3.0.0 - setuptools>=39.0.0 -setup_requires = setuptools>=44; wheel; setuptools_scm[toml]>=3.4.3 - -[options.packages.find] -exclude = contrib; docs; test; test.*; test.plugins; test.plugins.* - -[options.extras_require] -all = - autopep8>=1.6.0,<1.7.0 - flake8>=4.0.0,<4.1.0 - mccabe>=0.6.0,<0.7.0 - pycodestyle>=2.8.0,<2.9.0 - pydocstyle>=2.0.0 - pyflakes>=2.4.0,<2.5.0 - pylint>=2.5.0 - rope>=0.10.5 - yapf -autopep8 = autopep8>=1.6.0,<1.7.0 -flake8 = flake8>=4.0.0,<4.1.0 -mccabe = mccabe>=0.6.0,<0.7.0 -pycodestyle = pycodestyle>=2.8.0,<2.9.0 -pydocstyle = pydocstyle>=2.0.0 -pyflakes = pyflakes>=2.4.0,<2.5.0 -pylint = pylint>=2.5.0 -rope = rope>0.10.5 -yapf = yapf -test = - pylint>=2.5.0 - pytest - pytest-cov - coverage - numpy - pandas - matplotlib - pyqt5 - flaky - -[options.entry_points] -console_scripts = pylsp = pylsp.__main__:main -pylsp = - autopep8 = pylsp.plugins.autopep8_format - folding = pylsp.plugins.folding - flake8 = pylsp.plugins.flake8_lint - jedi_completion = pylsp.plugins.jedi_completion - jedi_definition = pylsp.plugins.definition - jedi_hover = pylsp.plugins.hover - jedi_highlight = pylsp.plugins.highlight - jedi_references = pylsp.plugins.references - jedi_rename = pylsp.plugins.jedi_rename - jedi_signature_help = pylsp.plugins.signature - jedi_symbols = pylsp.plugins.symbols - mccabe = pylsp.plugins.mccabe_lint - preload = pylsp.plugins.preload_imports - pycodestyle = pylsp.plugins.pycodestyle_lint - pydocstyle = pylsp.plugins.pydocstyle_lint - pyflakes = pylsp.plugins.pyflakes_lint - pylint = pylsp.plugins.pylint_lint - rope_completion = pylsp.plugins.rope_completion - rope_rename = pylsp.plugins.rope_rename - yapf = pylsp.plugins.yapf_format - [pycodestyle] ignore = E226, E722, W504 max-line-length = 120 exclude = test/plugins/.ropeproject,test/.ropeproject - - -[tool:pytest] -testpaths = test -addopts = - --cov-report html --cov-report term --junitxml=pytest.xml - --cov pylsp --cov test - diff --git a/setup.py b/setup.py index 28d2d305..04cfa069 100755 --- a/setup.py +++ b/setup.py @@ -8,5 +8,4 @@ if __name__ == "__main__": setup( name="python-lsp-server", # to allow GitHub dependency tracking work - packages=find_packages(exclude=["contrib", "docs", "test", "test.*"]), # https://github.com/pypa/setuptools/issues/2688 )