]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
simplify complicate requirements when generating features
authorBob Halley <halley@dnspython.org>
Sat, 23 Aug 2025 19:46:35 +0000 (12:46 -0700)
committerBob Halley <halley@dnspython.org>
Sat, 23 Aug 2025 19:46:35 +0000 (12:46 -0700)
dns/_features.py
util/generate-features

index 4447ff995206d574ca3ee9468eb4fce560c25815..65a9a2a35a23395b6fbb34a2e47ee9405280019c 100644 (file)
@@ -90,6 +90,6 @@ _requirements: Dict[str, List[str]] = {
     "doq": ["aioquic>=1.2.0"],
     "idna": ["idna>=3.10"],
     "trio": ["trio>=0.30"],
-    "wmi": ["wmi>=1.5.1; platform_system=='Windows'"],
+    "wmi": ["wmi>=1.5.1"],
     ### END generated requirements
 }
index 6c6c8bc5324fcbb35db2e0e3b1aab1bd5de6783c..57925a91a8e865f7a7dc91c29aebfb1418c3b4e7 100755 (executable)
@@ -8,6 +8,15 @@ import tomllib
 with open("pyproject.toml", "rb") as pp:
     pyproject = tomllib.load(pp)
 
+
+def maybe_simplify(dep: str):
+    i = dep.find(";")
+    if i >= 0:
+        return dep[:i]
+    else:
+        return dep
+
+
 FEATURES = "dns/_features.py"
 NEW_FEATURES = FEATURES + ".new"
 skip = False
@@ -20,6 +29,7 @@ with open(FEATURES, "r") as input:
                 for name, deps in pyproject["project"]["optional-dependencies"].items():
                     if name == "dev":
                         continue
+                    deps = [maybe_simplify(dep) for dep in deps]
                     print(
                         f"    {repr(name)}: {repr(deps)},",
                         file=output,