Files
revng-revng/python/scripts/revng
T
Giacomo Vercesi 942cf50735 python: create python wheels
Package revng's python code in two wheels: `revng` and `revng_internal`.
The revng wheel contains the
`revng.{pipeline_description,model,tupletree}` modules, while the
`revng_internal` one everything under `revng.internal`.
2023-12-12 14:52:22 +01:00

26 lines
686 B
Python
Executable File

#!/usr/bin/env python3
#
# This file is distributed under the MIT License. See LICENSE.md for details.
#
import os
import sys
import sysconfig
from pathlib import Path
libpath = Path(sysconfig.get_path("purelib")).relative_to(sysconfig.get_config_var("base"))
new_path = (Path(__file__) / "../.." / libpath).resolve()
assert new_path.is_dir()
if str(new_path) not in sys.path:
if "PYTHONPATH" in os.environ:
os.environ["PYTHONPATH"] = f"{new_path!s}:{os.environ['PYTHONPATH']}"
else:
os.environ["PYTHONPATH"] = str(new_path)
sys.path.insert(0, str(new_path))
if __name__ == "__main__":
from revng.internal.cli.revng import main
sys.exit(main())