Repository navigation
Align Python support metadata and runtime with Python 3.10+ - #439
Conversation
ekalinin
left a comment
There was a problem hiding this comment.
Thanks, this covers everything listed in #436. A few small things before merge.
-
setup.py:62still listsProgramming Language :: Python :: Implementation :: PyPy, but no CI job or tox env runs PyPy, and the description says it wasn't run locally either. Since #436 is about the metadata matching what is tested, please drop it. -
The new README line (
README.rst:118) says Python 2.7 is needed, butbuild_node_from_srclooks for apython2command (shutil.which('python2')). A Python 2.7 installed withmake altinstallhas onlypython2.7, and--sourcefor node 12 then fails withno python2 command (required for building node.js ...) was found(#435). Something like this would match the code:* Python 2.7 as a ``python2`` command when building Node.js versions older than 13 from source; this is separate from the Python 3.10+ interpreter that runs nodeenv. -
test4in theMakefilenow pinspython3.10(lines 80 and 82), so it fails on any machine without that exact interpreter, and the line has to change with every bump of the minimum version. #43 isn't about a Python version (it's-p --node=systeminside a virtualenv), so--python=python3tests the same thing. -
With
mock; python_version < '3.3'gone fromrequirements-dev.txt, the Python 2 fallbacks in the tests can go too:tests/nodeenv_test.py:1-8: the twofrom __future__imports and thepipes.quotebranch becomefrom shlex import quote as _quote(pipeswas removed in Python 3.13, and theimport systhere duplicates the one at line 18);- the
try: from unittest import mock / except ImportError: import mockblocks intests/nodeenv_test.py:25-28,tests/test_install_activate.py:5-8andtests/test_activate_shells.py:13-16becomefrom unittest import mock.
|
Thanks! |
Package metadata still declares Python 2.7 support and builds a py2.py3 universal wheel, while the code and CI have moved to Python 3. Choose Python 3.10 as the minimum to match the existing CI/tox floor, set Requires-Python >=3.10, and list CPython 3.10–3.14 classifiers. Drop the untested PyPy classifier and remove the universal-wheel flag so the build produces a py3 wheel.
Remove the Python 2 import/quote fallbacks, iteritems wrapper, is_PY3 and no-op to_utf8 conversions from nodeenv.py; keep urllib.request imported as urllib2. Update the README, unreleased changelog and legacy developer test targets/requirements. Strengthen the environment-path test with a non-ASCII text path. The separate Python 2.7 interpreter requirement for building Node.js before 13 remains intact; the README specifies that it must be available as a
python2command. The legacytest4target selects genericpython3, and the tests now importshlex.quoteandunittest.mockdirectly.Validation on macOS arm64:
The revised head repeated the Python 3.10/3.13 suites and full flake8 successfully, rebuilt the sdist/wheel, and verified that its metadata advertises CPython without PyPy.
make -n test4passed; an actualmake test4run in a disposable checkout passed withSETUPoverridden to install the newly built local wheel without network. The default pip-upgrade/setup.py-install recipe was not run.Python 3.11/3.12/3.14, PyPy, Linux/Windows and real Node download/compilation were not run locally. Historical Debian packaging was not modernized or exercised. Hosted CI remains separate from these local checks. No claim is made that those untested environments passed.
Closes #436. AI assistance: OpenAI Codex inspected the Issue, source and contribution rules, implemented the change, ran these checks and performed independent Standards/Spec reviews.