File: get_info.py

package info (click to toggle)
pypy3 7.3.19%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 212,236 kB
  • sloc: python: 2,098,316; ansic: 540,565; sh: 21,462; asm: 14,419; cpp: 4,451; makefile: 4,209; objc: 761; xml: 530; exp: 499; javascript: 314; pascal: 244; lisp: 45; csh: 12; awk: 4
file content (37 lines) | stat: -rw-r--r-- 1,256 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
"""
Dump some translation information to stdout as JSON. Used by buildbot.
"""
from __future__ import print_function
import sys
import os
import json
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
from pypy.module.sys.version import CPYTHON_VERSION

BASE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
if sys.platform.startswith('win'):
    TARGET_NAME = r'pypy%d.%d-c.exe' % CPYTHON_VERSION[:2]
    VENV_TARGET = 'pypy3.exe'
    TARGET_DIR = 'Scripts'
else:
    TARGET_NAME = 'pypy%d.%d-c' % CPYTHON_VERSION[:2]
    VENV_TARGET = 'pypy3'  # virtualenv does not create pypy3.9
    TARGET_DIR = 'bin'
VENV_DIR = 'pypy-venv'

def make_info_dict():
    target_path = os.path.join(BASE_DIR, 'pypy', 'goal', TARGET_NAME)
    return {'target_path': target_path,
            'virt_pypy': os.path.join(VENV_DIR, TARGET_DIR, VENV_TARGET),
            'venv_dir': VENV_DIR,
            'project': 'PyPy%d.%d' % CPYTHON_VERSION[:2], # for benchmarks
            # disabled, see https://github.com/python-cffi/cffi/issues/134
            'xdist_arg': '-n', 'xdist_n': '0',  # for extra_tests
           }

def dump_info():
    return json.dumps(make_info_dict())

if __name__ == '__main__':
    print(dump_info())