git: 06ef76ad4292 - main - devel/py-pytoolconfig: Add new port: Python Tool Configuration

From: Rainer Hurling <rhurlin_at_FreeBSD.org>
Date: Thu, 12 Jan 2023 13:35:38 UTC
The branch main has been updated by rhurlin:

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

commit 06ef76ad429207b98d35736e42feafb9feda123b
Author:     Rainer Hurling <rhurlin@FreeBSD.org>
AuthorDate: 2023-01-12 13:29:09 +0000
Commit:     Rainer Hurling <rhurlin@FreeBSD.org>
CommitDate: 2023-01-12 13:29:09 +0000

    devel/py-pytoolconfig: Add new port: Python Tool Configuration
    
    Project to manage configuration for python tools, such as black and
    rope and add support for a pyproject.toml configuration file.
    
    https://pypi.org/project/pytoolconfig/
---
 devel/Makefile                                     |  1 +
 devel/py-pytoolconfig/Makefile                     | 30 ++++++++++++++++++++++
 devel/py-pytoolconfig/distinfo                     |  3 +++
 .../files/patch-tests_test__pytoolconfig.py        | 11 ++++++++
 devel/py-pytoolconfig/pkg-descr                    |  3 +++
 5 files changed, 48 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 23fa72a00253..f4be22b289e9 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -5259,6 +5259,7 @@
     SUBDIR += py-pythonfinder
     SUBDIR += py-pythran
     SUBDIR += py-pytimeparse
+    SUBDIR += py-pytoolconfig
     SUBDIR += py-pytools
     SUBDIR += py-pytrie
     SUBDIR += py-pytvmaze
diff --git a/devel/py-pytoolconfig/Makefile b/devel/py-pytoolconfig/Makefile
new file mode 100644
index 000000000000..bff6a3668dca
--- /dev/null
+++ b/devel/py-pytoolconfig/Makefile
@@ -0,0 +1,30 @@
+PORTNAME=	pytoolconfig
+PORTVERSION=	1.2.4
+CATEGORIES=	devel python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	rhurlin@FreeBSD.org
+COMMENT=	Python Tool Configuration
+WWW=		https://pypi.org/project/pytoolconfig/
+
+LICENSE=	LGPL3+
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pdm-pep517>0:devel/py-pdm-pep517@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}setuptools_scm>0:devel/py-setuptools_scm@${PY_FLAVOR}
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}black>=0:devel/py-black@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}platformdirs>=2.2.0:devel/py-platformdirs@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pydantic>=1.7.4:devel/py-pydantic@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}sphinx>=4.5.0:textproc/py-sphinx@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}sphinx-autodoc-typehints>0:textproc/py-sphinx-autodoc-typehints@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}sphinx_rtd_theme>0:textproc/py-sphinx_rtd_theme@${PY_FLAVOR}
+TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}mypy>=0:devel/py-mypy@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}tabulate>0:devel/py-tabulate@${PY_FLAVOR}
+
+USES=		python:3.7+ pytest
+USE_PYTHON=	autoplist concurrent pep517
+
+NO_ARCH=	yes
+
+.include <bsd.port.mk>
diff --git a/devel/py-pytoolconfig/distinfo b/devel/py-pytoolconfig/distinfo
new file mode 100644
index 000000000000..9b1147c67805
--- /dev/null
+++ b/devel/py-pytoolconfig/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1672476705
+SHA256 (pytoolconfig-1.2.4.tar.gz) = 5e1a246f77970ddb5f3d8d06fbf162424b8a1adfc22c2eb51826b383bf293d1e
+SIZE (pytoolconfig-1.2.4.tar.gz) = 15910
diff --git a/devel/py-pytoolconfig/files/patch-tests_test__pytoolconfig.py b/devel/py-pytoolconfig/files/patch-tests_test__pytoolconfig.py
new file mode 100644
index 000000000000..1a9c50dfe191
--- /dev/null
+++ b/devel/py-pytoolconfig/files/patch-tests_test__pytoolconfig.py
@@ -0,0 +1,11 @@
+--- tests/test_pytoolconfig.py.orig	2022-06-28 03:43:15 UTC
++++ tests/test_pytoolconfig.py
+@@ -80,7 +80,7 @@ def test_global(cwd):
+ 
+ 
+ def test_global(cwd):
+-    if sys.platform != "linux":
++    if not (sys.platform.startswith("linux") | sys.platform.startswith("freebsd")):
+         pytest.skip()
+     os.environ["XDG_CONFIG_HOME"] = cwd.as_posix()
+     config = PyToolConfig("bogus", cwd, NestedModel, global_config=True)
diff --git a/devel/py-pytoolconfig/pkg-descr b/devel/py-pytoolconfig/pkg-descr
new file mode 100644
index 000000000000..3dcab4692800
--- /dev/null
+++ b/devel/py-pytoolconfig/pkg-descr
@@ -0,0 +1,3 @@
+The goal of this project is to manage configuration for python tools,
+such as black and rope and add support for a pyproject.toml
+configuration file.