From 266a237f7708bf57638a9973a8a6757ca28b4d80 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 9 Mar 2020 18:19:48 +0100 Subject: python: update setup.py to install ghdl-ls --- python/README | 18 ++++++++++++++++++ python/setup.py | 27 +++++++++++++++++---------- 2 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 python/README diff --git a/python/README b/python/README new file mode 100644 index 000000000..c82ccc4d4 --- /dev/null +++ b/python/README @@ -0,0 +1,18 @@ +pyghdl is a language server for VHDL based on ghdl. + +It implements the Language Server Protocol. +The server is implemented in Python (3.x) but relies on libghdl for parsing. + +It also provides a python interface to libghdl, which could be used to +develop tools around the parser and analyzer. + +To install: +1) First install ghdl (add --enable-python during configuration). + This is needed so that the libraries are available +2) In ghdl/python, install pyghdl. There is a setup.py script, so you can do: + $ pip install . + To install for development: pip install -e . + Add --user to install in your home directory. + +The executable is named 'ghdl-ls'. It uses stdin/stdout to communicate with +its client. diff --git a/python/setup.py b/python/setup.py index 479b9f5af..17b4a17e5 100644 --- a/python/setup.py +++ b/python/setup.py @@ -5,7 +5,7 @@ from distutils.core import setup import re def get_version(): - # Try from version.py. Reads it to avoid to load the shared library. + # Try from version.py. Reads it to avoid loading the shared library. r = re.compile("^__version__ = '(.*)'\n") try: l = open('libghdl/version.py').read() @@ -20,23 +20,30 @@ def get_version(): version=get_version() setup( - name='libghdl', + name='pyghdl', version=version, - description='Interface to ghdl, a VHDL analyzer', - long_description="""GHDL is a vhdl simulator and libghdl provides a low-level -interface to the parser. This library gives access to the AST so that you can -write tools like linters. -""", + description='VHDL Language Server and interface to ghdl, a VHDL analyzer', + long_description=open('README').read(), author='Tristan Gingold', author_email='tgingold@free.fr', url='http://github.com/ghdl/ghdl', license='GPL-2.0-or-later', package_dir={ - 'libghdl': './libghdl' + 'libghdl': 'libghdl', + 'vhdl_langserver': 'vhdl_langserver' }, packages=[ 'libghdl', 'libghdl.thin', - 'libghdl.thin.vhdl' - ] + 'libghdl.thin.vhdl', + 'vhdl_langserver' + ], + # To provide executable scripts, use entry points in preference to the + # "scripts" keyword. Entry points provide cross-platform support and allow + # pip to create the appropriate form of executable for the target platform. + entry_points={ + 'console_scripts': [ + 'ghdl-ls = vhdl_langserver.main:main', + ] + }, ) -- cgit v1.2.3