-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support more (older) Python versions #61
Comments
Thank you for your interest and the feature request. I agree that supporting more Python versions would be a very valuable goal; unfortunately, as Pynguin as currently my PhD project, I have to finish my PhD, and I am basically the only person who's working on it, I cannot add support for further versions currently. So, let me explain what the underlying problem is: Pynguin heavily relies on two components of Python (or better CPython): one is the AST that got some changes over the years. While this might be a solvable issue, it still was a burden. The other, more crucial, issue is that Pynguin instruments the bytecode generated and executed by the CPython interpreter. This bytecode changes with (almost) every new version of Python. It is furthermore an implementation detail of the CPython interpreter—thus Pynguin is not portable to other interpreters, e.g., PyPy. Updating this instrumentation is cumbersome, error prone, and time consuming. This is the reason why we dropped support for Python 3.8 with Pynguin 0.18.0. Adding support for other Python versions than 3.10 is possible in theory; most work is related to the bytecode instrumentation (see pynguin.instrumentation.instrumentation). Some parts of the test-case execution (see pynguin.testcase.execution) might be affected, too. And, depending on the Python version(s) to support, changes in all AST-related parts might be necessary, too. While all this could be done, I unfortunately cannot do this, as mentioned before. While this is very disappointing for the usage of Pynguin there might still be hope: while executing Pynguin itself requires Python 3.10, there is no real requirement for the subject under test. Thus, it should totally be possible to let Pynguin generate tests for a project that runs, e.g., on Python 3.8. The resulting test cases are not tied to a specific Python version; nor do they use any very recent features from PyTest. I am happy to elaborate on this further if requested. |
Is your feature request related to a problem? Please describe.
Currently, the README states that only Python 3.10 is supported. Python 3.11 is not supported yet, and support for Python < 3.10 was apparently dropped.
Environments that cannot run Python 3.10 (typically banks and similar, large institutions) are hence unable to use Pynguin. Those organisations may need Pynguin, though, so that they can stop doing manual testing.
Describe the solution you'd like
I'd like to understand whether there is a hard technical reason for supporting only Python 3.10.
If that's not the case we should make the code as backward-compatible as possible, and have a test matrix that runs the test suite also against older Python versions.
Describe alternatives you've considered
I don't see any, for the moment.
Additional context
I work in a restricted corporate environment and try to beef up the test suite, so that we can demonstrate that automated tests actually make sense.
I run Pynguin 0.17.0 with Python 3.9 on Windows, and executing
pynguin
results in the following error:pynguin (click to expand)
I'd be willing to make the necessary contributions that make Pynguin run with older Pythons, once I understand the situation better.
The text was updated successfully, but these errors were encountered: