Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

setup.py still declares Python 2.7 support

未关闭
#436 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

Start with python_requires and the classifiers in setup.py, then compare them with the CI matrix in main.yml, tests.yml and tox.ini. The Python 2 shims to remove are in nodeenv.py: the pipes.quote fallback, the py2 import block, is_PY3, to_utf8() and its call sites. Check whether PR #429 or #434 has already changed the same lines. Done means the metadata matches the CI-tested versions and no Python 2 compatibility code remains.

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

描述

setup.py still declares Python 2.7 and 3.7+ (master, ecb4b74):

    python_requires=(
        ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*"
    ),

The classifiers list 2, 2.7, 3.7, 3.8, 3.9, 3.10 and PyPy, and nothing after 3.10.

CI (main.yml, tests.yml) and tox.ini (envlist = py310,py311,py312,py313,py314) only test CPython 3.10-3.14.

Python 2.7 is already broken. Since 1.10.0 (e868dbe, #355), find_system_node() calls shutil.which, which 2.7 doesn't have, so --node=system and --prefer-system fail with AttributeError.

PR #434 changes the README to "Python 3 (CI tests CPython 3.10 through 3.14)". Once it is merged, the README and the package metadata will disagree.

To do:

  • pick the minimum supported version and update python_requires
  • update the classifiers to match it (they stop at 3.10)
  • drop the Python 2 compatibility code in nodeenv.py:
    • the pipes.quote fallback for Python < 3.3
    • the try/except ImportError block with the py2 imports (ConfigParser, urllib2, urlparse, urllib.unquote, httplib) and the iteritems helper; urllib.request is still imported as urllib2
    • is_PY3 and to_utf8(), which returns the text unchanged on Python 3 (7 call sites)
    • the sys.version_info major check in build_node_from_src; PR #429 already rewrites it
主要语言
Python
星标
1.8k
派生
225
平均合并
17 小时 18 分钟
30 天内合并 PR
26

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

ekalinin/nodeenv 的其他 Issue

查看 ekalinin/nodeenv 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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