diff --git a/_posts/2024-03-01-python-3-tools-i-use-for-my-python-2-projects-2024-edition.md b/_posts/2024-03-01-python-3-tools-i-use-for-my-python-2-projects-2024-edition.md index 32d8221..d4f9802 100644 --- a/_posts/2024-03-01-python-3-tools-i-use-for-my-python-2-projects-2024-edition.md +++ b/_posts/2024-03-01-python-3-tools-i-use-for-my-python-2-projects-2024-edition.md @@ -8,7 +8,7 @@ tags: - jython - python date: 2024-03-01 12:56 -0800 -last-updated: 2024-03-01 17:00 -0800 +last-updated: 2024-09-05 17:00 -0700 --- ## TOC @@ -88,7 +88,76 @@ The same thing happened when Python 3.12 was released, but I have recently teste ~~As of the time of the posting of this article, `mypy[python2]==0.971` fails to install on 3.13.0a4.~~ -Update: I just tried installing `mypy[python2]==0.971` using Python 3.13.0a4 and it worked. Securing my GitHub workflows and Azure Pipelines till October 2029. +~~Update (2024-03-01): I just tried installing `mypy[python2]==0.971` using Python 3.13.0a4 and it worked. Securing my GitHub workflows and Azure Pipelines till October 2029.~~ + +Update (2024-09-05): Unfortunately Python 3.13 does not allow `mypy[python2]==0.971` to be installed. + +Trying to install it results in the following error: + +```sh +$ python -m pip install 'mypy[python2]==0.971' +Collecting mypy==0.971 (from mypy[python2]==0.971) + Downloading mypy-0.971-py3-none-any.whl.metadata (1.8 kB) +Collecting typing-extensions>=3.10 (from mypy==0.971->mypy[python2]==0.971) + Downloading typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB) +Collecting mypy-extensions>=0.4.3 (from mypy==0.971->mypy[python2]==0.971) + Downloading mypy_extensions-1.0.0-py3-none-any.whl.metadata (1.1 kB) +Collecting typed-ast<2,>=1.4.0 (from mypy[python2]==0.971) + Downloading typed_ast-1.5.5.tar.gz (252 kB) + Preparing metadata (setup.py) ... done +Downloading mypy-0.971-py3-none-any.whl (2.6 MB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.6/2.6 MB 17.1 MB/s eta 0:00:00 +Downloading mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB) +Downloading typing_extensions-4.12.2-py3-none-any.whl (37 kB) +Building wheels for collected packages: typed-ast + Building wheel for typed-ast (setup.py) ... error + error: subprocess-exited-with-error + + × python setup.py bdist_wheel did not run successfully. + │ exit code: 1 + ╰─> [30 lines of output] + running bdist_wheel + running build + running build_py + creating build + creating build/lib.linux-x86_64-cpython-313 + creating build/lib.linux-x86_64-cpython-313/typed_ast + copying typed_ast/ast27.py -> build/lib.linux-x86_64-cpython-313/typed_ast + copying typed_ast/conversions.py -> build/lib.linux-x86_64-cpython-313/typed_ast + copying typed_ast/ast3.py -> build/lib.linux-x86_64-cpython-313/typed_ast + copying typed_ast/__init__.py -> build/lib.linux-x86_64-cpython-313/typed_ast + creating build/lib.linux-x86_64-cpython-313/typed_ast/tests + copying ast3/tests/test_basics.py -> build/lib.linux-x86_64-cpython-313/typed_ast/tests + running build_ext + building '_ast27' extension + creating build/temp.linux-x86_64-cpython-313 + creating build/temp.linux-x86_64-cpython-313/ast27 + creating build/temp.linux-x86_64-cpython-313/ast27/Custom + creating build/temp.linux-x86_64-cpython-313/ast27/Parser + creating build/temp.linux-x86_64-cpython-313/ast27/Python + gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -Iast27/Include -I/usr/local/include/python3.13 -c ast27/Custom/typed_ast.c -o build/temp.linux-x86_64-cpython-313/ast27/Custom/typed_ast.o + In file included from /usr/local/include/python3.13/pyport.h:358, + from /usr/local/include/python3.13/Python.h:50, + from ast27/Custom/typed_ast.c:1: + ast27/Custom/../Include/compile.h:12:12: error: unknown type name ‘PyFutureFeatures’ + 12 | PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *); + | ^~~~~~~~~~~~~~~~ + /usr/local/include/python3.13/exports.h:94:53: note: in definition of macro ‘PyAPI_FUNC’ + 94 | # define PyAPI_FUNC(RTYPE) Py_EXPORTED_SYMBOL RTYPE + | ^~~~~ + error: command '/usr/bin/gcc' failed with exit code 1 + [end of output] + + note: This error originates from a subprocess, and is likely not a problem with pip. + ERROR: Failed building wheel for typed-ast + Running setup.py clean for typed-ast +Failed to build typed-ast +ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (typed-ast) +``` + +This is because starting with version 3.13.0a6 `PyFutureFeatures` was moved to an internal header and made private. Breaking installation for all future releases. + +This means 3.12 is the last version to allow installation of `mypy[python2]==0.971`, so we will be covered till October 2028. ## Packaging and publishing