Skip to content

Commit 164824d

Browse files
committed
Update hpy.devel PKG-INFO version during import update
1 parent 2e211df commit 164824d

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2053,13 +2053,33 @@ def remove_inexisting_files(hpy_dir, our_dir):
20532053
remove_inexisting_files(hpy_repo_test_dir, test_files_dest)
20542054

20552055
# 'version.py' goes to 'lib-graalpython/module/hpy/devel/'
2056-
import_file(join(hpy_repo_path, "hpy", "devel", "version.py"), join(_get_core_home(), "modules", "hpy", "devel", "version.py"))
2056+
dest_version_file = join(_get_core_home(), "modules", "hpy", "devel", "version.py")
2057+
import_file(join(hpy_repo_path, "hpy", "devel", "version.py"), dest_version_file)
2058+
2059+
# read version from 'version.py'
2060+
with open(dest_version_file, "r") as f:
2061+
dummy_globals = {}
2062+
exec(f.read(), dummy_globals)
2063+
imported_version = dummy_globals["__version__"]
20572064

20582065
SUITE.vc.git_command(SUITE.dir, ["add", header_dest, runtime_files_dest, test_files_dest])
20592066
raw_input("Check that the updated files look as intended, then press RETURN...")
20602067
SUITE.vc.commit(SUITE.dir, "Update HPy inlined files: %s" % import_version)
20612068
SUITE.vc.git_command(SUITE.dir, ["checkout", "-"])
20622069
SUITE.vc.git_command(SUITE.dir, ["merge", HPY_IMPORT_ORPHAN_BRANCH_NAME])
2070+
2071+
# update PKG-INFO version
2072+
pkg_info_file = join(_get_core_home(), "modules", "hpy.devel.egg-info", "PKG-INFO")
2073+
with open(pkg_info_file, "w") as f:
2074+
f.write("Metadata-Version: 2.1\n"
2075+
"Name: hpy.devel\n"
2076+
"Version: {}\n"
2077+
"Summary: UNKNOWN\n"
2078+
"Home-page: UNKNOWN\n"
2079+
"License: UNKNOWN\n"
2080+
"Description: UNKNOWN\n"
2081+
"Platform: UNKNOWN\n"
2082+
"Provides-Extra: dev".format(imported_version).strip())
20632083

20642084

20652085
def run_leak_launcher(input_args, out=None):

0 commit comments

Comments
 (0)