def ci()

in ci.py [0:0]


def ci(show_env: bool = False) -> int:
    # Output exact python version
    cp = run(("python", "-V"), check=True, stdout=PIPE, universal_newlines=True)
    print(f"Using {cp.stdout}", file=sys.stderr)

    if show_env:
        print("- Environment:", file=sys.stderr)
        for key in sorted(environ.keys()):
            print(f"{key}: {environ[key]}", file=sys.stderr)

    # Azure sets CI_ENV=PTR_INTEGRATION
    # Travis sets PTR_INTEGRATION=1
    if "PTR_INTEGRATION" in environ or (
        "CI_ENV" in environ and environ["CI_ENV"] == "PTR_INTEGRATION"
    ):
        return integration_test()

    print("Running `ptr` unit tests", file=sys.stderr)
    return run(("python", "ptr_tests.py", "-v"), check=True).returncode