Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Aug 2022 04:17:36 GMT
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 76f62188eb67 - main - devel/py-ubelt: New port: Python utility belt containing simple tools
Message-ID:  <202208100417.27A4Haga007786@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by yuri:

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

commit 76f62188eb671d239e390282e57ef781df0d1616
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-08-10 02:00:56 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-08-10 04:17:31 +0000

    devel/py-ubelt: New port: Python utility belt containing simple tools
---
 devel/Makefile                                     |  1 +
 devel/py-ubelt/Makefile                            | 29 ++++++++++++++
 devel/py-ubelt/distinfo                            |  3 ++
 devel/py-ubelt/files/patch-ubelt_util__platform.py | 46 ++++++++++++++++++++++
 devel/py-ubelt/pkg-descr                           |  8 ++++
 5 files changed, 87 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 4c58f21a3ecb..e0cb3887c2f7 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -5393,6 +5393,7 @@
     SUBDIR += py-tzlocal
     SUBDIR += py-u-msgpack-python
     SUBDIR += py-ua_parser
+    SUBDIR += py-ubelt
     SUBDIR += py-uhid-freebsd
     SUBDIR += py-ujson
     SUBDIR += py-unearth
diff --git a/devel/py-ubelt/Makefile b/devel/py-ubelt/Makefile
new file mode 100644
index 000000000000..4824c16b2352
--- /dev/null
+++ b/devel/py-ubelt/Makefile
@@ -0,0 +1,29 @@
+PORTNAME=	ubelt
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.2.1
+CATEGORIES=	devel python
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Python utility belt containing simple tools
+
+LICENSE=	APACHE20
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}scikit-build>0:devel/py-scikit-build@${PY_FLAVOR} \
+		cmake:devel/cmake
+TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}codecov>=2.0.15:devel/py-codecov@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}coverage>0:devel/py-coverage@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pytest-cov>0:devel/py-pytest-cov@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}requests>=2.25.1:www/py-requests@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}xdoctest>=0.14.0:devel/py-xdoctest@${PY_FLAVOR}
+
+USES=		python:3.6+
+USE_PYTHON=	distutils autoplist pytest # 23 errors in tests, see https://github.com/Erotemic/ubelt/issues/127
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	Erotemic
+
+NO_ARCH=	yes
+
+.include <bsd.port.mk>
diff --git a/devel/py-ubelt/distinfo b/devel/py-ubelt/distinfo
new file mode 100644
index 000000000000..d06fb4fd4501
--- /dev/null
+++ b/devel/py-ubelt/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1660092196
+SHA256 (Erotemic-ubelt-v1.2.1_GH0.tar.gz) = 3a6af50981b738291d52cddd400d34828ade774445c585dc394925e2279b9fe1
+SIZE (Erotemic-ubelt-v1.2.1_GH0.tar.gz) = 294026
diff --git a/devel/py-ubelt/files/patch-ubelt_util__platform.py b/devel/py-ubelt/files/patch-ubelt_util__platform.py
new file mode 100644
index 000000000000..23f3cecb0861
--- /dev/null
+++ b/devel/py-ubelt/files/patch-ubelt_util__platform.py
@@ -0,0 +1,46 @@
+--- ubelt/util_platform.py.orig	2022-08-10 01:18:14 UTC
++++ ubelt/util_platform.py
+@@ -42,7 +42,7 @@ from os.path import exists, join, isdir, expanduser, n
+ 
+ 
+ __all__ = [
+-    'WIN32', 'LINUX', 'DARWIN', 'POSIX',
++    'WIN32', 'FREEBSD', 'LINUX', 'DARWIN', 'POSIX',
+     'find_exe', 'find_path',
+     'ensure_app_cache_dir', 'ensure_app_config_dir', 'ensure_app_data_dir',
+     'get_app_cache_dir', 'get_app_config_dir', 'get_app_data_dir',
+@@ -52,6 +52,7 @@ __all__ = [
+ # References:
+ # https://stackoverflow.com/questions/446209/possible-values-from-sys-platform
+ WIN32  = sys.platform == 'win32'  # type: bool
++FREEBSD  = sys.platform.startswith('freebsd')  # type: bool
+ LINUX  = sys.platform.startswith('linux')  # type: bool
+ DARWIN = sys.platform == 'darwin'  # type: bool
+ POSIX = 'posix' in sys.builtin_module_names  # type: bool
+@@ -66,6 +67,8 @@ def platform_data_dir():
+     """
+     if LINUX:  # nocover
+         dpath_ = os.environ.get('XDG_DATA_HOME', '~/.local/share')
++    elif FREEBSD:  # nocover
++        dpath_ = os.environ.get('XDG_DATA_HOME', '~/.local/share')
+     elif DARWIN:  # nocover
+         dpath_  = '~/Library/Application Support'
+     elif WIN32:  # nocover
+@@ -86,6 +89,8 @@ def platform_config_dir():
+     """
+     if LINUX:  # nocover
+         dpath_ = os.environ.get('XDG_CONFIG_HOME', '~/.config')
++    elif FREEBSD:  # nocover
++        dpath_ = os.environ.get('XDG_CONFIG_HOME', '~/.config')
+     elif DARWIN:  # nocover
+         dpath_  = '~/Library/Application Support'
+     elif WIN32:  # nocover
+@@ -105,6 +110,8 @@ def platform_cache_dir():
+         str : path to the cache dir used by the current operating system
+     """
+     if LINUX:  # nocover
++        dpath_ = os.environ.get('XDG_CACHE_HOME', '~/.cache')
++    elif FREEBSD:  # nocover
+         dpath_ = os.environ.get('XDG_CACHE_HOME', '~/.cache')
+     elif DARWIN:  # nocover
+         dpath_  = '~/Library/Caches'
diff --git a/devel/py-ubelt/pkg-descr b/devel/py-ubelt/pkg-descr
new file mode 100644
index 000000000000..79dc85afe28c
--- /dev/null
+++ b/devel/py-ubelt/pkg-descr
@@ -0,0 +1,8 @@
+Ubelt is a small library of robust, tested, documented, and simple functions
+that extend the Python standard library. It has a flat API that all behaves
+similarly on Windows, Mac, and Linux (up to some small unavoidable differences).
+Almost every function in ubelt was written with a doctest. This provides helpful
+documentation and example usage as well as helping achieve 100% test coverage
+(with minor exceptions on Windows).
+
+WWW: https://github.com/Erotemic/ubelt



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202208100417.27A4Haga007786>