We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f7f025 commit 5a68b0eCopy full SHA for 5a68b0e
setup.py
@@ -105,6 +105,18 @@ def git_describe_to_python_version(version):
105
except OSError:
106
pass
107
108
+if version == "unknown":
109
+ # get version from directory name (tarballs downloaded from tags)
110
+ # directories are named bpython-X.Y-release in this case
111
+ basename = os.path.basename(os.path.dirname(__file__))
112
+ basename_components = basename.split("-")
113
+ if (
114
+ len(basename_components) == 3
115
+ and basename_components[0] == "bpython"
116
+ and basename_components[2] == "release"
117
+ ):
118
+ version = basename_components[1]
119
+
120
with open(version_file, "w") as vf:
121
vf.write("# Auto-generated file, do not edit!\n")
122
vf.write(f"__version__ = '{version}'\n")
0 commit comments