3.6.3 (27 September 2024) - hotfix:
Fixed
- Fix interactive console failing on macro imports.
- Now
__init__.py
importsmcpyrate.activate
as soon as possible. - Neither in-tree tests nor the CI automation detected this. It was only when running
macropython -i
(or IPython with themcpyrate.repl.iconsole
extension) in a separate terminal window, against an installedmcpyrate
, that this error came up. - For those arriving from Google, the error message was:
ImportError: cannot import name 'macros' from 'mcpyrate.quotes'
- Now
No other changes to 3.6.2, original announcement below.
3.6.2 (27 September 2024) - New tree snakes edition:
IMPORTANT:
- Minimum Python language version is now 3.8.
- We support 3.8, 3.9, 3.10, 3.11, 3.12, and PyPy3 (language versions 3.8, 3.9, and 3.10).
- Python 3.6 and 3.7 support dropped, as these language versions have officially reached end-of-life. If you need
mcpyrate
for Python 3.6 or 3.7, use version 3.6.1.
New:
-
Python 3.12 support.
- Support the
type
statement (Python 3.12 type alias) when fixingctx
attributes in the global postprocess pass. - The unparser now supports the
type
statement (Python 3.12 type alias).- Please note that I pretty much don't use the static typing features of Python myself. This is implemented following the spec, but testing has been rather minimal, so bug reports are welcome!
- For the curious, the relevant parts of the official Python documentation are:
- https://docs.python.org/3/library/ast.html#type-parameters
- https://docs.python.org/3/library/ast.html#ast.TypeAlias
- https://docs.python.org/3/library/ast.html#ast.TypeVar
- https://docs.python.org/3/library/ast.html#ast.ParamSpec
- https://docs.python.org/3/library/ast.html#ast.TypeVarTuple
- https://docs.python.org/3/library/typing.html#typing.TypeVar
- https://docs.python.org/3/library/typing.html#typing.ParamSpec
- https://docs.python.org/3/library/typing.html#typing.TypeVarTuple
- Support the
-
Python 3.11 support.
- Consider also
end_lineno
andend_col_offset
when fixing AST locations in the global postprocess pass.- This is literally the only thing we currently do with
end_lineno
andend_col_offset
. - Python 3.11's AST validator (now part of the CPython compiler as of 3.11+) checks e.g. that
end_lineno >= lineno
.
- This is literally the only thing we currently do with
- The unparser now supports the
try
/except*
construct (Python 3.11 exception groups).
- Consider also
-
New module
mcpyrate.astcompat
, moved fromunpythonic.syntax.astcompat
. This module handles version differences in theast
module in various versions of Python.
Fixed:
- Fix #41. The unparser now supports
match
/case
(Python 3.10 pattern matching). - Fix bug in unparser: a class definition with no bases or keywords should not emit parentheses after the class name.
- Fix bug in
rename
: rename also inglobal
andnonlocal
declarations, and (Python 3.10+) inmatch
/case
captures. - Update links in relevant parts of
mcpyrate
documentation to point to Python's official AST documentation instead of GTS (Green Tree Snakes).- Nowadays Python has proper AST documentation.
- Thus the separate GTS resource is no longer needed, and is effectively dead as of September 2024.