We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6d2e953 commit 57810bbCopy full SHA for 57810bb
setup.py
@@ -66,6 +66,20 @@ def list2cmdline(cmd_list):
66
}
67
68
69
+# -----------------------------------------------------------------------------
70
+# Library Version
71
72
+
73
+pkg_root_init_file = package_dir / "__init__.py"
74
+for line in pkg_root_init_file.read_text().split("\n"):
75
+ if line.startswith("__version__ = "):
76
+ package["version"] = eval(line.split("=", 1)[1])
77
+ break
78
+else:
79
+ print(f"No version found in {pkg_root_init_file}")
80
+ sys.exit(1)
81
82
83
# -----------------------------------------------------------------------------
84
# Requirements
85
0 commit comments