-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-127405: Emit a deprecation warning about a future change of sys.abiflags
availability on Windows
#131717
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
base: main
Are you sure you want to change the base?
Conversation
…ailability on Windows
sys.abiflags
availability on Windowssys.abiflags
availability on Windows
This reverts commit 143145f.
Given the alternative of using I don't feel particularly strongly about this, so if @zooba thinks this is a good approach, then it's fine with me. |
The The recent update of the export PYTHON_TAG="$(
echo 'import sys, sysconfig; print(
"{0.name[0]}p{1.major}{1.minor}{2}".format(
sys.implementation,
sys.version_info,
getattr(sys, "abiflags", "t" if sysconfig.get_config_var("Py_GIL_DISABLED") else ""),
).lower(),
)' | ${{ env.PYTHON }} -
)" This would benefit from a valid The incoming |
@@ -333,7 +334,12 @@ def get_makefile_filename(): | |||
if _PYTHON_BUILD: | |||
return os.path.join(_PROJECT_BASE, "Makefile") | |||
|
|||
if hasattr(sys, 'abiflags'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any details about the existence of sys.abiflags
for cross-compiling for Windows on Ubuntu? I found it might be non-trivial to replace the following with one another:
hasattr(sys, 'abiflags')
os.name == 'nt' # os.name != 'posix'
not sys.platform.startswith('win')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires a full-fledged What's New entry + possibly under the incompatible changes / porting to Python 3.14 code or something like that.
See the notes for :ref:`incoming change to sys.abiflags | ||
<whatsnew314-sys-abiflags-change>` on the *What's New in 3.14* | ||
page for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first beta version of Python 3.14 is out. Any comment on this?
I think we can still apply this to 3.14 during beta, but I'm still not convinced we need to. The So I still worry that we're effectively adding a new and unspecified API here when we ought to be trying to remove the same API from everywhere else (as in, I don't think POSIX users should be using |
Yes, this functionality can be covered by other APIs, such as However, as commented in #131799 (comment), variables in The rationale for keeping and making
PS: the incoming |
We can't make guarantees about this API as it stands. It needs a PEP and documentation to properly define it, including all possible values. Without that, it'll always have no compatibility guarantees.
The correct source of the information is
Perhaps true, but then you have hundreds to move from
It's up to mypy to figure that stuff out. It shouldn't have anything reliant on abiflags anyway, as abiflags don't impact the Python language at all. I don't think any of these reasons are good justifications. |
Emit a deprecation warning when accessing the
sys.abiflags
member if it is absent:See also:
sys.abiflags
on Windows #127405 (comment)sys.abiflags
on Windows #127405 (comment)📚 Documentation preview 📚: https://cpython-previews--131717.org.readthedocs.build/
sys.abiflags
on Windows #127405