| 1 |
|
| 2 |
""" |
| 3 |
Dump some translation information to stdout as JSON. Used by buildbot. |
| 4 |
""" |
| 5 |
from __future__ import print_function |
| 6 |
import sys |
| 7 |
import os |
| 8 |
import json |
| 9 |
sys.path.append(os.path.dirname(os.path.dirname(__file__))) |
| 10 |
from pypy.module.sys.version import CPYTHON_VERSION |
| 11 |
|
| 12 |
BASE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) |
| 13 |
if sys.platform.startswith('win'): |
| 14 |
TARGET_NAME = r'pypy%d.%d-c.exe' % CPYTHON_VERSION[:2] |
| 15 |
VENV_TARGET = 'pypy3.exe' |
| 16 |
TARGET_DIR = 'Scripts' |
| 17 |
else: |
| 18 |
TARGET_NAME = 'pypy%d.%d-c' % CPYTHON_VERSION[:2] |
| 19 |
VENV_TARGET = 'pypy3' |
| 20 |
TARGET_DIR = 'bin' |
| 21 |
VENV_DIR = 'pypy-venv' |
| 22 |
|
| 23 |
def make_info_dict(): |
| 24 |
target_path = os.path.join(BASE_DIR, 'pypy', 'goal', TARGET_NAME) |
| 25 |
return {'target_path': target_path, |
| 26 |
'virt_pypy': os.path.join(VENV_DIR, TARGET_DIR, VENV_TARGET), |
| 27 |
'venv_dir': VENV_DIR, |
| 28 |
'project': 'PyPy%d.%d' % CPYTHON_VERSION[:2], |
| 29 |
|
| 30 |
'xdist_arg': '-n', 'xdist_n': '0', |
| 31 |
} |
| 32 |
|
| 33 |
def dump_info(): |
| 34 |
return json.dumps(make_info_dict()) |
| 35 |
|
| 36 |
if __name__ == '__main__': |
| 37 |
print(dump_info()) |