aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2022-08-10 02:00:56 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2022-08-10 04:17:31 +0000
commit76f62188eb671d239e390282e57ef781df0d1616 (patch)
tree98d5dfba0d4cc814bfab4056a498e7cda3f39cdc
parent64b885ada496a6088fa49fd551875e2f374593b4 (diff)
downloadports-76f62188eb671d239e390282e57ef781df0d1616.tar.gz
ports-76f62188eb671d239e390282e57ef781df0d1616.zip
devel/py-ubelt: New port: Python utility belt containing simple tools
-rw-r--r--devel/Makefile1
-rw-r--r--devel/py-ubelt/Makefile29
-rw-r--r--devel/py-ubelt/distinfo3
-rw-r--r--devel/py-ubelt/files/patch-ubelt_util__platform.py46
-rw-r--r--devel/py-ubelt/pkg-descr8
5 files changed, 87 insertions, 0 deletions
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