-
Notifications
You must be signed in to change notification settings - Fork 112
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 python 3.10+ #281
Comments
Blocked by davidhalter/parso#138 |
While waiting for the full support of Python 3.10, is there any recommended workaround that could be used for projects employing the match-case syntax? Any tips would be greatly appreciated. |
Sorry, I don't really have anything to say to that. Extracting code you need to be mutation tested and testing it in a separate project is one way at least.. not great but 🤷 |
Hello there! Any news? |
Read the linked issues for parso |
Last comment was 2 years ago. It looks like nobody cares about this problem. Maybe change the parser? For example, to libcst? |
Yea, that's one way to go for sure. I switched AST library for mutmut once before, and that wasn't as hard as one might expect. I'm very open to PRs, but I don't have much time for this myself. |
I've also thought about using whatever Ruff uses, or whatever black uses... |
FYI, there seems to be another issue which I've uncovered coming from parso. I'm not sure if it's the same or not, so please let me know if I should open up a new issue, instead. This seems to be a parso problem with $ mutmut run
- Mutation testing starting -
These are the steps:
1. A full test suite run will be made to make sure we
can run the tests successfully and we know how long
it takes (to detect infinite loops for example)
2. Mutants will be generated and checked
Results are stored in .mutmut-cache.
Print found mutants with `mutmut results`.
Legend for output:
🎉 Killed mutants. The goal is for everything to end up in this bucket.
⏰ Timeout. Test suite took 10 times as long as the baseline so were killed.
🤔 Suspicious. Tests took a long time, but not long enough to be fatal.
🙁 Survived. This means your tests need to be expanded.
🔇 Skipped. Skipped.
mutmut cache is out of date, clearing it...
1. Running tests without mutations
⠸ Running...Done
Failed to parse app/cli/commands/relay_events/relay_handlers.py. Internal error from parso follows.
----------------------------------
Traceback (most recent call last):
File "/virtualenvs/service-f1pOEzwg-py3.12/lib/python3.12/site-packages/parso/parser.py", line 180, in _add_token
plan = stack[-1].dfa.transitions[transition]
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: <PythonTokenTypes.NAME: TokenType(NAME)>
During handling of the above exception, another exception occurred: SNIP
Is this something new which needs a new issue or is this related to the same parso issue above? |
I think this is related to parso, any python file using the "type" keyword added in 3.12 errors: A minimal file is just: |
I'm surprised the workaround would have to be so painful / impractical. In particular I'm puzzled why excluding files with |
As it stands right now I am in the process of writing version 3.0 of mutmut which is a big rewrite basically. After this is released, the AST library can be replaced (again). I just have to guess and hope that any AST lib I choose to use will be kept up to date. This is the second time I've been burned by this specific problem. |
Mutmut 3 is released. I did not switch AST library, so maybe that's next on the agenda. |
nice! congrats. so just to be clear though that means if there are python 3.10+ keywords like |
Yea. It'll still crash on parsing that entire file. I guess it should be pretty simple to make mutmut just skip all files it can't parse. |
i would +1 that idea. would improve a major impediment to practical usage in an existing project |
3.0.2 released with this fix (and another tiny thing that was a showstopper too) |
I'm using mutmut in my work projects with python 3.10 and its working except for a single project that we are using the "new" syntax of match-case (PEP 634). In this case, mutmut broke and return 100% of mutants killeds
There's any planning to add full suport for python 3.10?
The text was updated successfully, but these errors were encountered: