Skip to content

Commit 8cc5630

Browse files
committed
Add __status__ metadata
1 parent 0ab62cb commit 8cc5630

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

‎lazyimports/__init__.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,29 @@
4646

4747
__version__ = "0.1.2"
4848

49+
# Lifecycle status marker for this package.
50+
#
51+
# Rationale for using a plain string: it offers maximum portability with zero extra dependencies,
52+
# allowing users and automation tooling to inspect the project lifecycle state at runtime
53+
# without relying on importlib.metadata, network requests, or platform-specific logic.
54+
# While a structured dictionary would support richer metadata, it would lock the project into
55+
# a rigid schema that becomes difficult to extend and revise later.
56+
#
57+
# String format: ``"<development-phase>;<maintenance-tier>;<eol-iso-date>"``
58+
# - ``development-phase`` follows PyPI's standard Development Status classifiers
59+
# (examples: "beta", "stable", "inactive"). Aligning with this shared vocabulary
60+
# ensures the value remains parsable by automated tooling.
61+
# - ``maintenance-tier`` accepts exactly four fixed values: "active", "maintenance",
62+
# "security-only", "retired". Scripts and tools may use this field for direct conditional logic.
63+
# - ``eol-iso-date`` denotes the scheduled end-of-life date in ISO‑8601 (YYYY‑MM‑DD).
64+
# This timeline is derived from the official EOL schedule of Python 3.15 (October 2031).
65+
# It is subject to revision if the upstream Python release timeline shifts.
66+
__status__ = "beta;active;2031-10-31"
67+
68+
4969
__all__ = [
5070
"__version__",
71+
"__status__",
5172
"NATIVE_LAZY_IMPORT",
5273
"SUPPORT_LAZY_IMPORT",
5374
"LazyModule",

‎test_lazyimports.py‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,34 @@ class TestVersionInfo(unittest.TestCase):
3939
def test_version_is_string(self):
4040
self.assertIsInstance(lazyimports.__version__, str)
4141

42+
def test_status_format(self):
43+
# ``__status__`` must follow the documented
44+
# ``"<development>;<maintenance>;<eol-iso-date>"`` format so
45+
# tooling can parse it reliably.
46+
self.assertIsInstance(lazyimports.__status__, str)
47+
parts = lazyimports.__status__.split(";")
48+
self.assertEqual(
49+
len(parts), 3,
50+
"__status__ must have exactly three ;-separated parts, got {!r}".format(
51+
lazyimports.__status__
52+
),
53+
)
54+
development, maintenance, eol = parts
55+
self.assertIn(
56+
development,
57+
{"alpha", "beta", "stable", "mature", "inactive"},
58+
)
59+
self.assertIn(
60+
maintenance,
61+
{"active", "maintenance", "security-only", "retired"},
62+
)
63+
# ISO-8601 date: YYYY-MM-DD.
64+
self.assertRegex(eol, r"^\d{4}-\d{2}-\d{2}$")
65+
# The EOL date must be after today — the project is still alive.
66+
import datetime
67+
eol_date = datetime.date.fromisoformat(eol)
68+
self.assertGreater(eol_date, datetime.date.today())
69+
4270
def test_native_lazy_import_flag(self):
4371
# Must be a boolean derived from the interpreter version.
4472
self.assertIsInstance(NATIVE_LAZY_IMPORT, bool)

0 commit comments

Comments
 (0)