aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/requirements.txt2
-rw-r--r--pyGHDL/__init__.py8
-rw-r--r--pyGHDL/cli/requirements.txt6
-rw-r--r--pyGHDL/dom/requirements.txt2
-rw-r--r--pyGHDL/libghdl/requirements.txt2
-rw-r--r--setup.py117
6 files changed, 28 insertions, 109 deletions
diff --git a/doc/requirements.txt b/doc/requirements.txt
index cb4081ec3..376121903 100644
--- a/doc/requirements.txt
+++ b/doc/requirements.txt
@@ -1,5 +1,7 @@
-r ../pyGHDL/requirements.txt
+pyTooling.Packaging>=0.3.1
+
sphinx>=3.4.2
#recommonmark>=0.7.1
python-dateutil>=2.8.1
diff --git a/pyGHDL/__init__.py b/pyGHDL/__init__.py
index eb400e0f1..eb32f03b4 100644
--- a/pyGHDL/__init__.py
+++ b/pyGHDL/__init__.py
@@ -47,7 +47,13 @@ this is provided from a ``pyGHDL`` packages with four sub-packages:
* ``pyGHDL.lsp`` - A `language server protocol <https://en.wikipedia.org/wiki/Language_Server_Protocol>`__ (LSP)
written in Python. The implementation offers an HTTPS service that can be used e.g. by editors and IDEs supporting LSP.
"""
-from pydecor import export
+__author__ = "Tristan Gingold and contributors"
+__email__ = "tgingold@free.fr"
+__copyright__ = "2002-2021, Tristan Gingold and contributors"
+__license__ = "GNU General Public License v2"
+__version__ = "2.0.0-dev"
+
+from pyTooling.Decorators import export
@export
diff --git a/pyGHDL/cli/requirements.txt b/pyGHDL/cli/requirements.txt
index 30f22625c..111f8fa26 100644
--- a/pyGHDL/cli/requirements.txt
+++ b/pyGHDL/cli/requirements.txt
@@ -1,5 +1,5 @@
-r ../dom/requirements.txt
-pyAttributes==2.2.1
-pyMetaClasses==1.3.1
-pyTerminalUI==1.4.1
+pyTooling>=1.5.1
+pyTooling.TerminalUI>=1.5.3
+pyAttributes>=2.3.2
diff --git a/pyGHDL/dom/requirements.txt b/pyGHDL/dom/requirements.txt
index 18340052a..6fa43649b 100644
--- a/pyGHDL/dom/requirements.txt
+++ b/pyGHDL/dom/requirements.txt
@@ -1,4 +1,4 @@
-r ../libghdl/requirements.txt
-pyVHDLModel==0.12.0
+pyVHDLModel==0.14.0
#https://github.com/VHDL/pyVHDLModel/archive/dev.zip#pyVHDLModel
diff --git a/pyGHDL/libghdl/requirements.txt b/pyGHDL/libghdl/requirements.txt
index 538e15ba4..0291212ff 100644
--- a/pyGHDL/libghdl/requirements.txt
+++ b/pyGHDL/libghdl/requirements.txt
@@ -1 +1 @@
-pyTooling>=1.5.1
+pyTooling>=1.5.2
diff --git a/setup.py b/setup.py
index f61a0f2a4..e1789c3db 100644
--- a/setup.py
+++ b/setup.py
@@ -32,121 +32,32 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ============================================================================
+#
+from pathlib import Path
+from pyTooling.Packaging import DescribePythonPackageHostedOnGitHub
-from pathlib import Path
-from re import compile as re_compile
-from typing import List
-
-from setuptools import (
- setup as setuptools_setup,
- find_packages as setuptools_find_packages,
-)
-
-gitHubNamespace = "ghdl"
-projectName = "ghdl"
-packageName = "pyGHDL"
-packagePath = Path(packageName)
-
-readmeFile = packagePath / "README.md"
-requirementsFile = packagePath / "requirements.txt"
-
-
-# Read (local) README for upload to PyPI
-def get_description(file: Path) -> str:
- with file.open("r") as fh:
- description = fh.read()
- return description
-
-
-# Read requirements file and add them to package dependency list
-def get_requirements(file: Path) -> List[str]:
- requirements = []
- with file.open("r") as fh:
- for line in fh.read().splitlines():
- if line.startswith("#") or line == "":
- continue
- elif line.startswith("-r"):
- # Remove the first word/argument (-r)
- filename = " ".join(line.split(" ")[1:])
- requirements += get_requirements(file.parent / filename)
- elif line.startswith("https"):
- # Convert 'URL#NAME' to 'NAME @ URL'
- splitItems = line.split("#")
- requirements.append("{} @ {}".format(splitItems[1], splitItems[0]))
- else:
- requirements.append(line)
- return requirements
-
-
-def get_version():
- # Try from version.py. Reads it to avoid loading the shared library.
- pattern = re_compile('^__version__ = "(.*)"\n')
- try:
- line = open("pyGHDL/libghdl/version.py").read()
- match = pattern.match(line)
- if match:
- return match.group(1)
- except Exception:
- pass
-
- raise Exception("Cannot find version")
-
-
-# Derive URLs
-sourceCodeURL = "https://github.com/{namespace}/{projectName}".format(
- namespace=gitHubNamespace, projectName=projectName
-)
-documentationURL = (
- "https://{namespace}.github.io/{projectName}/using/py/index.html".format(
- namespace=gitHubNamespace, projectName=projectName
- )
-)
-requirements = list(set(get_requirements(requirementsFile)))
-
+gitHubNamespace = "ghdl"
+packageName = "pyGHDL"
+packageDirectory = packageName
+packageInformationFile = Path(f"{packageDirectory}/__init__.py")
-# Assemble all package information
-setuptools_setup(
- name=packageName,
- version=get_version(),
- author="Tristan Gingold",
- author_email="tgingold@free.fr",
- license="GPL-2.0-or-later",
+DescribePythonPackageHostedOnGitHub(
+ packageName=packageName,
description="Python binding for GHDL and high-level APIs (incl. LSP).",
- long_description=get_description(readmeFile),
- long_description_content_type="text/markdown",
- url=sourceCodeURL,
- project_urls={
- "Documentation": documentationURL,
- "Source Code": sourceCodeURL,
- "Issue Tracker": sourceCodeURL + "/issues",
- },
- python_requires=">=3.6",
- install_requires=requirements,
- packages=setuptools_find_packages(exclude=("tests",)),
- entry_points={
- "console_scripts": [
- "ghdl-ls = pyGHDL.cli.lsp:main",
- "ghdl-dom = pyGHDL.cli.dom:main",
- ]
- },
+ license="GPL-2.0-or-later",
+ gitHubNamespace=gitHubNamespace,
keywords="Python3 VHDL Parser Compiler Simulator GHDL",
+ sourceFileWithVersion=packageInformationFile,
+ developmentStatus="beta",
classifiers=[
- "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows :: Windows 10",
"Operating System :: POSIX :: Linux",
- "Programming Language :: Python :: 3 :: Only",
- "Programming Language :: Python :: 3.6",
- "Programming Language :: Python :: 3.7",
- "Programming Language :: Python :: 3.8",
- "Programming Language :: Python :: 3.9",
- "Development Status :: 4 - Beta",
- # "Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
"Topic :: Software Development :: Code Generators",
"Topic :: Software Development :: Compilers",
"Topic :: Software Development :: Testing",
"Topic :: Utilities",
- ],
+ ]
)