Update bundled test `setuptools.whl` file

未关闭 适合新手
#160,824 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
66/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
build-system

调研方向

从Lib/test/wheeldata/setuptools-79.0.1-py3-none-any.whl和所引用的setuptools变更入手,找出更新后的捆绑wheel版本,该版本不会导入已弃用的typing.AnyStr。检查issue中链接的CPython测试失败,以及PR #150190中的讨论;当捆绑wheel不再在受影响的测试中触发此弃用警告时,任务即告完成。

由索引模型根据 Issue 内容生成。

描述

dependencies infra topic-ensurepip

File: https://github.com/python/cpython/blob/main/Lib/test/wheeldata/setuptools-79.0.1-py3-none-any.whl

Why the update is needed?

======================================================================
ERROR: test_syntax_error_for_string (test.test_peg_generator.test_c_parser.TestCParser.test_syntax_error_for_string)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_peg_generator/test_c_parser.py", line 121, in setUp
    cmd = support.missing_compiler_executable()
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/support/__init__.py", line 2218, in missing_compiler_executable
    from setuptools._distutils import ccompiler, sysconfig
  File "/home/runner/work/cpython/cpython-builddir/build/test_python_61704æ/tempcwd/venv/lib/python3.16/site-packages/setuptools/_distutils/ccompiler.py", line 1, in <module>
    from .compat.numpy import (  # noqa: F401
    ...<2 lines>...
    )
  File "/home/runner/work/cpython/cpython-builddir/build/test_python_61704æ/tempcwd/venv/lib/python3.16/site-packages/setuptools/_distutils/compat/numpy.py", line 2, in <module>
    from ..compilers.C.base import _default_compilers, compiler_class  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython-builddir/build/test_python_61704æ/tempcwd/venv/lib/python3.16/site-packages/setuptools/_distutils/compilers/C/base.py", line 34, in <module>
    from ...util import execute, is_mingw, split_quoted
  File "/home/runner/work/cpython/cpython-builddir/build/test_python_61704æ/tempcwd/venv/lib/python3.16/site-packages/setuptools/_distutils/util.py", line 20, in <module>
    from typing import TYPE_CHECKING, AnyStr
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/typing.py", line 3950, in __getattr__
    warnings._deprecated(
    ~~~~~~~~~~~~~~~~~~~~^
        "typing.AnyStr",
        ^^^^^^^^^^^^^^^^
    ...<5 lines>...
        remove=(3, 21),
        ^^^^^^^^^^^^^^^
    )
    ^
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/_py_warnings.py", line 893, in _deprecated
    _wm.warn(msg, DeprecationWarning, stacklevel=stacklevel)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DeprecationWarning: 'typing.AnyStr' is deprecated and slated for removal in Python 3.21. Use PEP 695 type parameters with constraints instead

The other option is to ignore this warning in all places where we import setuptools.

Refs https://github.com/python/cpython/pull/150190#discussion_r4400346235
Refs https://github.com/python/cpython/issues/132415

CC @jaraco

主要语言
Python
星标
77.8k
派生
37.7k
平均合并
17 小时 24 分钟
30 天内合并 PR
716

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

python/cpython 的其他 Issue

查看 python/cpython 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。