Skip to content

Move the package metadata from setup.py to setup.cfg #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# autogenerated version file
/pylsp_jsonrpc/_version.py

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
19 changes: 18 additions & 1 deletion pylsp_jsonrpc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.

from . import _version
from ._version import __version__

__all__ = [__version__]

def convert_version_info(version: str) -> (int, ..., str):
version_info = version.split(".")
for i in range(len(version_info)): # pylint:disable=consider-using-enumerate
try:
version_info[i] = int(version_info[i])
except ValueError:
version_info[i] = version_info[i].split("+")[0]
version_info = version_info[: i + 1]
break

return tuple(version_info)


_version.VERSION_INFO = convert_version_info(__version__)

__all__ = ("__version__",)
5 changes: 0 additions & 5 deletions pylsp_jsonrpc/_version.py

This file was deleted.

7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build-system]
requires = ["setuptools>=44", "wheel", "setuptools_scm[toml]>=3.4.3"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "pylsp_jsonrpc/_version.py"
write_to_template = "__version__ = \"{version}\"\n" # VERSION_INFO is populated in __main__
29 changes: 29 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
[metadata]
name = python-lsp-jsonrpc
author = Python Language Server Contributors
description = JSON RPC 2.0 server library
url = https://github.com/python-lsp/python-lsp-jsonrpc
long_description = file: README.md
long_description_content_type = text/markdown


[options]
packages = find:
setup_requires = setuptools>=44; wheel; setuptools_scm[toml]>=3.4.3
install_requires = ujson>=3.0.0

[options.packages.find]
exclude =
contrib
docs
test
test.*

[options.extras_require]
test =
pylint
pycodestyle
pyflakes
pytest
pytest-cov
coverage

[pycodestyle]
ignore = E226, E722, W504
Expand Down
47 changes: 0 additions & 47 deletions setup.py

This file was deleted.