-
Notifications
You must be signed in to change notification settings - Fork 32
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.12 #370
Comments
Thank you for your report. With the amount of information you provided, I'm tempted to say "this is an issue with the coverage lib". |
Coverage works fine. This happends due to the fact that the action runs on python3.11 Error: Critical error. This error possibly occurred because the permissions of the workflow are set incorrectly. You can see the correct setting of permissions here: https://github.com/py-cov-action/python-coverage-comment-action#basic-usage
Otherwise please look for open issues or open one in https://github.com/py-cov-action/python-coverage-comment-action/
Traceback (most recent call last):
File "/workdir/coverage_comment/subprocess.py", line 22, in run
return subprocess.run(
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('coverage', 'json', '-o', '-')' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/workdir/coverage_comment/main.py", line 44, in main
exit_code = action(
^^^^^^^
File "/workdir/coverage_comment/main.py", line 88, in action
return save_coverage_data_files(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workdir/coverage_comment/main.py", line [33](https://github.com/tzevet5/Backend/actions/runs/8040223520/job/21958246919#step:8:34)8, in save_coverage_data_files
raw_coverage_data, coverage = coverage_module.get_coverage_info(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workdir/coverage_comment/coverage.py", line 99, in get_coverage_info
subprocess.run("coverage", "json", "-o", "-", path=coverage_path)
File "/workdir/coverage_comment/subprocess.py", line [36](https://github.com/tzevet5/Backend/actions/runs/8040223520/job/21958246919#step:8:37), in run
raise SubProcessError("\n".join([exc.stderr, exc.stdout])) from exc
coverage_comment.subprocess.SubProcessError:
Couldn't parse 'src/core/dto.py' as Python source: 'invalid syntax' at line 18 |
I don't agree with this. This happens because This could be fixed in multiple ways:
I'm not a huge fan of tying the Python version this lib runs on to the Python version of the code it analyses. Though that's probably the best solution in the short term (assuming it doesn't break on older python codebases). I'll see what I can do. On a personal note, the tone of interactions in this ticket have been unpleasant so far. This isn't helping my will to prioritize spending my own personal time fixing the project I made so that it works for your case. You might want to reassess how limiting your communication to the bare minimum, including peremptory assertions and contradicting your interlocutor's hypothesis without supporting claims works for convincing people to do free work for you :) Still, you're probably not the only 3.12 user out there, so I'll consider doing it. |
I am truly sorry that you were hearing that tone from me 😞. As for the notes you left I generally agree though
Correct me if I'm wrong, but the workflow uses a docker image to do the work instead of setting up it's dependencies |
Maybe I read too much on this. Communication is hard. I appreciate your acknowledgement, thank you. Back to the topic.
Well we use both. Docker and poetry inside docker, I'm not sure to follow your train of thought
It all depends on coverage. I didn't think we needed the notion of "supported version" at all, I thought the coverage datafile was all we needed. Now I discover that if we run with py3.12, because of coverage, we need the code to be py3.12 compatible. While Python regularily adds new syntax features, they haven't made backwards incompatible changes lately (the last one being The more I think about it, the more replacing coverage with coberturapy (#347) sounds like a solution to many problems. Of course, that would mean a new major version, breaking compat ourselves etc. |
Thanks for the quick fix! |
Yep. It was still the right thing to do in this case, it's just that this issue made me realize that until we make bigger changes, I'll need to stay on top of python versions, I can't decide completely on my own when I want to upgrade while keeping compatibility for everyone. |
If you use 3.12 generics the action would fail.
i.e
The text was updated successfully, but these errors were encountered: