Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python -VV should display whether the build is default build or free-threading. #119132

Closed
corona10 opened this issue May 17, 2024 · 3 comments
Closed

Comments

@corona10
Copy link
Member

corona10 commented May 17, 2024

Currently, there is no way to identify whether the build is free-threaded or not through python -VV
See the pyperf and pyperformance case

The following display would be great.

Python 3.14.0a0 (heads/main-dirty:31a28cbae0, May 17 2024, 17:30:32, default) [GCC 14.1.1 20240507 (Red Hat 14.1.1-1)]

Python 3.14.0a0 (heads/main-dirty:31a28cbae0, May 17 2024, 17:30:32, free-threading) [GCC 14.1.1 20240507 (Red Hat 14.1.1-1)]

Linked PRs

@corona10
Copy link
Member Author

cc @hugovk @vstinner @colesbury

@vstinner
Copy link
Member

vstinner commented May 18, 2024

If we cannot agree on changing sys.version, at least, python -VV can be modified in Python/initconfig.c:

    if (print_version) {
        printf("Python %s\n",
                (print_version >= 2) ? Py_GetVersion() : PY_VERSION);
        return _PyStatus_EXIT(0);
    }

The code can be modified to log if Python is built with free-threading or not.

miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 18, 2024
…GH-119140)

(cherry picked from commit 74072a3)

Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this issue May 18, 2024
…9140) (#119143)

gh-119132: Log sys._is_gil_enabled() in test.pythoninfo (GH-119140)
(cherry picked from commit 74072a3)

Co-authored-by: Victor Stinner <vstinner@python.org>
@corona10
Copy link
Member Author

If we cannot agree on changing sys.version, at least, python -VV can be modified in Python/initconfig.c:

It's better!

corona10 added a commit to corona10/cpython that referenced this issue May 18, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 18, 2024
…pythongh-119134)

(cherry picked from commit c141d43)

Co-authored-by: Donghee Na <donghee.na@python.org>
corona10 added a commit that referenced this issue May 18, 2024
gh-119134) (#119153)

gh-119132: Update sys.version to identify free-threaded or not. (gh-119134)
(cherry picked from commit c141d43)

Co-authored-by: Donghee Na <donghee.na@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants