Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 4cf7273

Browse files
committed
fix mpy-cross build
1 parent d6a17b1 commit 4cf7273

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

py/makeversionhdr.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,20 @@ def get_version_info_from_docs_conf():
5757
return git_tag, "<no hash>"
5858
return None
5959

60+
def get_version_info_from_pycom_version():
61+
with open(os.path.join(os.path.dirname(sys.argv[0]), "..", "esp32", "pycom_version.h")) as f:
62+
for line in f:
63+
if line.startswith("#define SW_VERSION_NUMBER"):
64+
ver = line.strip().split('"')[1]
65+
git_tag = "v" + ver
66+
return git_tag, "<no hash>"
67+
return None
68+
6069
def make_version_header(filename):
6170
# Get version info using git, with fallback to docs/conf.py
6271
info = get_version_info_from_git()
6372
if info is None:
64-
info = get_version_info_from_docs_conf()
73+
info = get_version_info_from_pycom_version()
6574

6675
git_tag, git_hash = info
6776

0 commit comments

Comments
 (0)