git: de7db561b1a8 - main - devel/py-lazy_imports: Add new ports
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 15 Sep 2025 07:49:42 UTC
The branch main has been updated by otis:
URL: https://cgit.FreeBSD.org/ports/commit/?id=de7db561b1a83bc6c384b23e5e534559e86be5c3
commit de7db561b1a83bc6c384b23e5e534559e86be5c3
Author: Juraj Lutter <otis@FreeBSD.org>
AuthorDate: 2025-09-15 07:47:50 +0000
Commit: Juraj Lutter <otis@FreeBSD.org>
CommitDate: 2025-09-15 07:49:11 +0000
devel/py-lazy_imports: Add new ports
This python utility package helps to create lazy modules. A lazy module
defers loading (some of) its attributes until these attributes are first
accessed.
This also fixes fa6125eec57
Sponsored by: resulta.tech
---
devel/Makefile | 1 +
devel/py-lazy_imports/Makefile | 21 +++++++++++++++++++++
devel/py-lazy_imports/distinfo | 3 +++
devel/py-lazy_imports/pkg-descr | 11 +++++++++++
4 files changed, 36 insertions(+)
diff --git a/devel/Makefile b/devel/Makefile
index 8afd8c7e81d4..cb06ab0341ff 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -5189,6 +5189,7 @@
SUBDIR += py-lazr.uri
SUBDIR += py-lazy
SUBDIR += py-lazy-object-proxy
+ SUBDIR += py-lazy_imports
SUBDIR += py-lazy_loader
SUBDIR += py-legacy-api-wrap
SUBDIR += py-libcst
diff --git a/devel/py-lazy_imports/Makefile b/devel/py-lazy_imports/Makefile
new file mode 100644
index 000000000000..612dcd97ad8b
--- /dev/null
+++ b/devel/py-lazy_imports/Makefile
@@ -0,0 +1,21 @@
+PORTNAME= lazy_imports
+PORTVERSION= 1.0.1
+CATEGORIES= devel python
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= otis@FreeBSD.org
+COMMENT= Python package helps to create lazy modules
+WWW= https://github.com/bachorp/lazy-imports
+
+LICENSE= APACHE20
+
+BUILD_DEPENDS= ${PY_SETUPTOOLS} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>=0.42.0:devel/py-wheel@${PY_FLAVOR}
+
+USES= python
+USE_PYTHON= autoplist concurrent pep517
+
+NO_ARCH= yes
+
+.include <bsd.port.mk>
diff --git a/devel/py-lazy_imports/distinfo b/devel/py-lazy_imports/distinfo
new file mode 100644
index 000000000000..f0e7da94f5b9
--- /dev/null
+++ b/devel/py-lazy_imports/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1757922333
+SHA256 (lazy_imports-1.0.1.tar.gz) = 7d3e4b1547cb574ec7ef3c47a074673e2612330b2b50bf7eec939f2c393fc261
+SIZE (lazy_imports-1.0.1.tar.gz) = 24484
diff --git a/devel/py-lazy_imports/pkg-descr b/devel/py-lazy_imports/pkg-descr
new file mode 100644
index 000000000000..665fa0186f94
--- /dev/null
+++ b/devel/py-lazy_imports/pkg-descr
@@ -0,0 +1,11 @@
+This python utility package helps to create lazy modules. A lazy module defers
+loading (some of) its attributes until these attributes are first accessed. The
+module's lazy attributes in turn are attributes of other modules. These other
+modules will be imported/loaded only when (and if) associated attributes are
+used. A lazy import strategy can drastically reduce runtime and memory
+consumption.
+
+Additionally, this package provides a utility for optional imports with which
+one can import a module globally while triggering associated import errors only
+at use-sites (when and if a dependency is actually required, for example in the
+context of a specific functionality).