aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/setup.py
diff options
context:
space:
mode:
authorumarcor <unai.martinezcorral@ehu.eus>2020-12-27 22:10:38 +0100
committerumarcor <unai.martinezcorral@ehu.eus>2020-12-27 23:13:21 +0100
commitbf74a0983c2d534e217e7312ab559ca8929ff8a2 (patch)
treefb630d5b83afc2f112996ebb5f1eac44de868132 /pyGHDL/setup.py
parent340fc792bba2ffdb4f930bc427a39ea3a1b659b2 (diff)
downloadghdl-bf74a0983c2d534e217e7312ab559ca8929ff8a2.tar.gz
ghdl-bf74a0983c2d534e217e7312ab559ca8929ff8a2.tar.bz2
ghdl-bf74a0983c2d534e217e7312ab559ca8929ff8a2.zip
rework 'python', rename to 'pyGHDL'
* Rename 'python' to 'pyGHDL'. * Let 'thin' be 'libghdl'. * Move move 'pyutils.py' from 'python/libghdl/vhdl' to a separate package ('pyGHDL/libghdl/utils/'). * Update 'vhdl_langserver' accordingly. * Rename 'vhdl_langserver' to 'lsp'. * Move 'ghdl-ls' to 'pyGHDL/cli'.
Diffstat (limited to 'pyGHDL/setup.py')
-rw-r--r--pyGHDL/setup.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/pyGHDL/setup.py b/pyGHDL/setup.py
new file mode 100644
index 000000000..b76d8cd29
--- /dev/null
+++ b/pyGHDL/setup.py
@@ -0,0 +1,44 @@
+#!/usr/bin/env python
+
+from setuptools import setup, find_packages
+import re
+
+
+def get_version():
+ # Try from version.py. Reads it to avoid loading the shared library.
+ r = re.compile('^__version__ = "(.*)"\n')
+ try:
+ l = open("libghdl/version.py").read()
+ m = r.match(l)
+ if m:
+ return m.group(1)
+ except:
+ pass
+ raise Exception("Cannot find version")
+
+
+# Extract the version now, as setup() may change the current directory.
+version = get_version()
+
+setup(
+ name="pyGHDL",
+ version=version,
+ description="Python bindings for GHDL and high-level APIs (incl. LSP)",
+ author="Tristan Gingold",
+ author_email="tgingold@free.fr",
+ url="http://github.com/ghdl/ghdl",
+ license="GPL-2.0-or-later",
+ packages=find_packages(),
+ # List run-time dependencies here. For an analysis of "install_requires"
+ # vs pip's requirements files see:
+ # https://packaging.python.org/en/latest/requirements.html
+ install_requires=["attrs"],
+ # 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",
+ ]
+ },
+) \ No newline at end of file