git: f904e024f146 - main - devel/py-pycomplete: Add py-pycomplete 0.3.2

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sun, 05 Feb 2023 15:53:47 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f904e024f146c8853e8a6fb51c1b599b7894bf09

commit f904e024f146c8853e8a6fb51c1b599b7894bf09
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-02-05 15:15:13 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-02-05 15:47:38 +0000

    devel/py-pycomplete: Add py-pycomplete 0.3.2
    
    With pycomplete, one can generate a completion script for CLI application that
    is compatible with a given shell. The script outputs the result onto stdout,
    allowing one to re-direct the output to the file of their choosing.
    
    pycomplete accepts different types of objects depending on which CLI framework
    you are using. For argparse, argparse.ArgumentParser is expected while for
    click, either click.Command or click.Context is OK. pycomplete knows what to do
    smartly.
    
    Where you place the file will depend on which shell, and which operating system
    you are using. Your particular configuration may also determine where these
    scripts need to be placed.
    
    Note that pycomplete needs to be installed in the same environment as the target
    CLI app to work properly.
---
 devel/Makefile                     |  1 +
 devel/py-pycomplete/Makefile       | 23 ++++++++++++++++++
 devel/py-pycomplete/distinfo       |  3 +++
 devel/py-pycomplete/files/setup.py | 49 ++++++++++++++++++++++++++++++++++++++
 devel/py-pycomplete/pkg-descr      | 15 ++++++++++++
 5 files changed, 91 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index d11cde2b9934..7ab7ff9a8c54 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -5107,6 +5107,7 @@
     SUBDIR += py-pycodestyle
     SUBDIR += py-pycognito
     SUBDIR += py-pycompilation
+    SUBDIR += py-pycomplete
     SUBDIR += py-pycparser
     SUBDIR += py-pydantic
     SUBDIR += py-pydash
diff --git a/devel/py-pycomplete/Makefile b/devel/py-pycomplete/Makefile
new file mode 100644
index 000000000000..12707fdc9335
--- /dev/null
+++ b/devel/py-pycomplete/Makefile
@@ -0,0 +1,23 @@
+PORTNAME=	pycomplete
+PORTVERSION=	0.3.2
+CATEGORIES=	devel python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	sunpoet@FreeBSD.org
+COMMENT=	Python library to generate static completion scripts for your CLI app
+WWW=		https://github.com/frostming/pycomplete
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USES=		python:3.7+
+USE_PYTHON=	autoplist concurrent distutils
+
+NO_ARCH=	yes
+
+post-patch:
+	@${RM} ${WRKSRC}/pyproject.toml
+	@${SED} -e 's|%%PORTVERSION%%|${PORTVERSION}|' ${FILESDIR}/setup.py > ${WRKSRC}/setup.py
+
+.include <bsd.port.mk>
diff --git a/devel/py-pycomplete/distinfo b/devel/py-pycomplete/distinfo
new file mode 100644
index 000000000000..ab5b3b109ecd
--- /dev/null
+++ b/devel/py-pycomplete/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1675190913
+SHA256 (pycomplete-0.3.2.tar.gz) = 671bfba70b6f2eecedad6b6daabac2aa3f1573cd790cc56ccd48b8067f584391
+SIZE (pycomplete-0.3.2.tar.gz) = 12468
diff --git a/devel/py-pycomplete/files/setup.py b/devel/py-pycomplete/files/setup.py
new file mode 100644
index 000000000000..16ebe8808b52
--- /dev/null
+++ b/devel/py-pycomplete/files/setup.py
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+from setuptools import setup
+
+import codecs
+
+with codecs.open('README.md', encoding="utf-8") as fp:
+    long_description = fp.read()
+INSTALL_REQUIRES = [
+]
+EXTRAS_REQUIRE = {
+    'dev': [
+        'pytest<7.0.0,>=6.1.1',
+        'click<8.0.0,>=7.1.2',
+    ],
+}
+ENTRY_POINTS = {
+    'console_scripts': [
+        'pycomplete = pycomplete.__main__:main',
+    ],
+}
+
+setup_kwargs = {
+    'name': 'pycomplete',
+    'version': '%%PORTVERSION%%',
+    'description': 'A Python library to generate static completion scripts for your CLI app',
+    'long_description': long_description,
+    'license': 'BSD-3-Clause',
+    'author': '',
+    'author_email': 'Frost Ming <mianghong@gmail.com>',
+    'maintainer': None,
+    'maintainer_email': None,
+    'url': '',
+    'packages': [
+        'pycomplete',
+        'pycomplete.templates',
+    ],
+    'package_data': {'': ['*']},
+    'long_description_content_type': 'text/markdown',
+    'keywords': ['cli', 'shell'],
+    'classifiers': [
+        'Development Status :: 3 - Alpha',
+    ],
+    'install_requires': INSTALL_REQUIRES,
+    'extras_require': EXTRAS_REQUIRE,
+    'python_requires': '>=3.6',
+    'entry_points': ENTRY_POINTS,
+}
+
+setup(**setup_kwargs)
diff --git a/devel/py-pycomplete/pkg-descr b/devel/py-pycomplete/pkg-descr
new file mode 100644
index 000000000000..d6d2f1db0103
--- /dev/null
+++ b/devel/py-pycomplete/pkg-descr
@@ -0,0 +1,15 @@
+With pycomplete, one can generate a completion script for CLI application that
+is compatible with a given shell. The script outputs the result onto stdout,
+allowing one to re-direct the output to the file of their choosing.
+
+pycomplete accepts different types of objects depending on which CLI framework
+you are using. For argparse, argparse.ArgumentParser is expected while for
+click, either click.Command or click.Context is OK. pycomplete knows what to do
+smartly.
+
+Where you place the file will depend on which shell, and which operating system
+you are using. Your particular configuration may also determine where these
+scripts need to be placed.
+
+Note that pycomplete needs to be installed in the same environment as the target
+CLI app to work properly.