From 03f830b44469bad7cb4ca525c7f41c20bc1dc68d Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 28 Dec 2020 21:51:14 +0100 Subject: Added new package description for pyGHDL. --- setup.py | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 setup.py (limited to 'setup.py') diff --git a/setup.py b/setup.py new file mode 100644 index 000000000..d2f47dc06 --- /dev/null +++ b/setup.py @@ -0,0 +1,119 @@ +# EMACS settings: -*- tab-width: 2; indent-tabs-mode: t -*- +# vim: tabstop=2:shiftwidth=2:noexpandtab +# kate: tab-width 2; replace-tabs off; indent-width 2; +# ============================================================================= +# ____ _ _ ____ _ +# _ __ _ _ / ___| | | | _ \| | +# | '_ \| | | | | _| |_| | | | | | +# | |_) | |_| | |_| | _ | |_| | |___ +# | .__/ \__, |\____|_| |_|____/|_____| +# |_| |___/ +# ============================================================================= +# Authors: Tristan Gingold +# Patrick Lehmann +# +# Package installer: Python binding for GHDL and high-level APIs. +# +# License: +# ============================================================================ +# Copyright (C) 2019-2020 Tristan Gingold +# +# GHDL is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2, or (at your option) any later +# version. +# +# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with GHDL; see the file COPYING. If not, write to the Free +# Software Foundation, 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# +# SPDX-License-Identifier: GPL-2.0-or-later +# ============================================================================ +# +import setuptools +from re import compile as re_compile + +gitHubNamespace = "ghdl" +projectName = "ghdl" +packageName = "pyGHDL" + +# read (local) README for upload to PyPI +with open("README.md", "r") as file: + long_description = file.read() + +# Read requirements file and add them to package dependency list +requirements = [] +with open("requirements.txt") as file: + for line in file.readlines(): + requirements.append(line) + +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: + 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) + +# Assemble all package information +setuptools.setup( + name=packageName, + version=get_version(), + + author="Tristan Gingold", + author_email="tgingold@free.fr", + + description="Python binding for GHDL and high-level APIs (incl. LSP).", + long_description=long_description, + long_description_content_type="text/markdown", + + url=sourceCodeURL, + project_urls={ + 'Documentation': documentationURL, + 'Source Code': sourceCodeURL, + 'Issue Tracker': sourceCodeURL + "/issues" + }, + + packages=setuptools.find_packages(), + entry_points={ + 'console_scripts': [ + "ghdl-ls = pyGHDL.cli.lsp:main" + ] + }, + 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.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", + ], + keywords="Python3 VHDL Parser Compiler Simulator GHDL", + + python_requires='>=3.8', + install_requires=requirements, +) -- cgit v1.2.3 From 224f1fa0c327f3fa08a865d6ae79d9cdb1ba19c4 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 28 Dec 2020 22:19:37 +0100 Subject: Tiny improvements. --- setup.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index d2f47dc06..afb5bc241 100644 --- a/setup.py +++ b/setup.py @@ -36,22 +36,24 @@ # SPDX-License-Identifier: GPL-2.0-or-later # ============================================================================ # -import setuptools -from re import compile as re_compile +from pathlib import Path +from re import compile as re_compile +from setuptools import setup as setuptools_setup, find_packages as setuptools_find_packages gitHubNamespace = "ghdl" projectName = "ghdl" packageName = "pyGHDL" +packagePath = Path(packageName) -# read (local) README for upload to PyPI -with open("README.md", "r") as file: +# Read (local) README for upload to PyPI +readmeFile = packagePath / "README.md" +with readmeFile.open("r") as file: long_description = file.read() # Read requirements file and add them to package dependency list -requirements = [] -with open("requirements.txt") as file: - for line in file.readlines(): - requirements.append(line) +requirementsFile = packagePath / "requirements.txt" +with requirementsFile.open("r") as file: + requirements = [line for line in file.readlines()] def get_version(): # Try from version.py. Reads it to avoid loading the shared library. @@ -71,7 +73,7 @@ sourceCodeURL = "https://github.com/{namespace}/{projectName}".format(namesp documentationURL = "https://{namespace}.github.io/{projectName}/using/py/index.html".format(namespace=gitHubNamespace, projectName=projectName) # Assemble all package information -setuptools.setup( +setuptools_setup( name=packageName, version=get_version(), @@ -89,7 +91,7 @@ setuptools.setup( 'Issue Tracker': sourceCodeURL + "/issues" }, - packages=setuptools.find_packages(), + packages=setuptools_find_packages(), entry_points={ 'console_scripts': [ "ghdl-ls = pyGHDL.cli.lsp:main" -- cgit v1.2.3 From bfd38acc0c6f3f82823fa1a496e90ef1e64da997 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 28 Dec 2020 23:07:42 +0100 Subject: setup.py needs the license information twice ... --- setup.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index afb5bc241..7cbb0009e 100644 --- a/setup.py +++ b/setup.py @@ -79,7 +79,7 @@ setuptools_setup( author="Tristan Gingold", author_email="tgingold@free.fr", - + license="GPL-2.0-or-later", description="Python binding for GHDL and high-level APIs (incl. LSP).", long_description=long_description, long_description_content_type="text/markdown", @@ -91,12 +91,16 @@ setuptools_setup( 'Issue Tracker': sourceCodeURL + "/issues" }, - packages=setuptools_find_packages(), + python_requires='>=3.8', + install_requires=requirements, + packages=setuptools_find_packages(exclude=("tests",)), entry_points={ 'console_scripts': [ "ghdl-ls = pyGHDL.cli.lsp:main" ] }, + + keywords="Python3 VHDL Parser Compiler Simulator GHDL", classifiers=[ "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", "Operating System :: MacOS", @@ -113,9 +117,5 @@ setuptools_setup( "Topic :: Software Development :: Compilers", "Topic :: Software Development :: Testing", "Topic :: Utilities", - ], - keywords="Python3 VHDL Parser Compiler Simulator GHDL", - - python_requires='>=3.8', - install_requires=requirements, + ] ) -- cgit v1.2.3 From 3427a61b81b542bb683e8f1e5dd376aaa184e575 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 29 Dec 2020 01:38:54 +0100 Subject: Lowering required Python version to 3.7. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 7cbb0009e..47f41fbc6 100644 --- a/setup.py +++ b/setup.py @@ -91,7 +91,7 @@ setuptools_setup( 'Issue Tracker': sourceCodeURL + "/issues" }, - python_requires='>=3.8', + python_requires='>=3.7', install_requires=requirements, packages=setuptools_find_packages(exclude=("tests",)), entry_points={ @@ -107,6 +107,7 @@ setuptools_setup( "Operating System :: Microsoft :: Windows :: Windows 10", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Development Status :: 4 - Beta", -- cgit v1.2.3