Closed fhg-isi closed 8 months ago
Updating Pynguin to Python 3.11 is considerable effort, because it would require to revisit and rework the instrumentation of Python's bytecode. Unfortunately, I currently do not have capacity to do this, although I am happy to accept pull requests for this.
Besides, I think that if I invest the time to support a newer Python version, I'd go with the current Python 3.12, using its new sys.monitoring
API.
I hope you can understand this decision and use Pynguin on Python 3.10.
Sure, many thanks for quick clarification and your efforts. For others looking for a unit test generation solution also see related SO question: https://stackoverflow.com/questions/77409726/ho-to-generate-unit-tests-for-python-in-pycharm-using-src-and-test-folder-stru
@stephanlukasczyk May this project help you to upgrade to python 3.12 ~
@ghostbody I know about pyupgrade
, it's already being used as a pre-commit hook in Pynguin. However, migrating is not that easy. I am pretty sure that most of the code of Pynguin will run on Python 3.12 without any changes. But I know one, central, module that requires changes; changes that pyupgrade
will not be helpful: the instrumentation of the Python bytecode to measure coverage and the like. It changes the bytecode of Python directly and the bytecode is an implementation detail of the CPython interpreter (one of the reasons why Pynguin does not run on other interpreters, e.g., PyPy), which changes with almost every version. I know of bytecode changes between Python 3.10, 3.11, and 3.12. These need to be addressed manually, for which I currently do not have time (though I am happy to accept pull requests).
Besides, for Python 3.12 and the future it might be wise to use the aforementioned sys.monitoring
API instead of manipulating the bytecode directly. My hope would be that such an approach could be more stable and also would work in Python 3.13 without any changes. Again, I am happy to accept pull requests for this, but I cannot do it by myself currently. Finishing my PhD first is required :wink:
If I try to use pynguin with following command and Python 3.11.1 on Windows:
pynguin --project-path ./src --output-path ./test --module-name example
I get following error:
=> Could you please update pynguin to work with Python 3.11?