exercism / python

Exercism exercises in Python.
https://exercism.org/tracks/python
MIT License
1.92k stars 1.29k forks source link

[Supported Language Versions] Possible Move to Python >= 3.10 for Tooling and Exercises #2656

Closed AdamJel closed 2 years ago

AdamJel commented 3 years ago

Hi,

using match case syntax from python 3.10 raises errors and causes solution to fail.

Please, bump python version.

BethanyG commented 3 years ago

@AdamJel --

Bumping the version would be a hard no at this time. Python 3.10 is still brand-new. We would have to upgrade all of our CI and tooling, as well as review multiple exercises and test files. That is neither practical nor possible. We're sorry, but you will have to practice match case and other 3.10 goodies locally for now. Python 3.10 support is (at minimum) 6 months or more away.

AdamJel commented 3 years ago

I see. That is understandable.

If a new installation of python is done, then at least on Windows, it is installed in version 3.10. I can imagine, thanks to the mess in python virtual managemenet tooling, that this could be a little unpleasant for new commers.

What about @BethanyG , as a temp solution, make a file check, that catches 3.10 syntax and gives a user a warning, that he should not use this version. It could be triggered by exercism submit, so that invalid python never reaches servers. It could either control the source code for syntax if no venv is present, or just take a look at venv what version is used.

It would be somewhat better then throwing a syntax error.

BethanyG commented 3 years ago

Hi @AdamJel

That's interesting. I was unaware the "default" now for Windows was Python 3.10. That certainly sets them up for a lot of issues in the next few months. Especially if they are using any scientific or data libraries. Or any databases like Postgres. There are also bound to be bugs in the Python language itself, so that feels like a bad idea.

In any case, it shouldn't cause issues here on exercism unless a student were to use a feature that the Python runtime (we're on 3.9 for tooling) or our tests (most tests target features in 3.6 - 3.8) didn't understand -- like you did with match case.

For a little more on the logic of why we're not on the bleeding edge, see this write up from Itamar Turner-Trauring

As for adjusting our CLI -- yes -- that would be a good idea. The CLI repo here is in the process of being re-vamped for V3. I think they may be re-working it in NIM. Currently it's written in Go-lang.

So you may want to raise an issue there about detecting and warning when there are version incompatibilities for the programming languages that exercism supports.

MatthijsBlom commented 2 years ago

I understand last october was not the time to upgrade to 3.10. However, perhaps now is the time?

Can I help?

By the way: I feel like this issue should be reopened and the label wontfix removed, as at present it gives the impression this wil never be fixed – which I do not think is the intention.

BethanyG commented 2 years ago

@MatthijsBlom - I wouldn't expect a discussion on 3.10 before June, or possibly later. There is just too much other work for the track and the tooling. It's far more important that we get content, tests, and analysis in place for the track than it is we support the "latest" version of the language. And given that the Python 3.10.2 was expedited because 3.10 had some unfortunate bugs...well...things need to settle a bit.

If you would like to help, the best way to do so at this time is to create or improve track exercises, tests, and concepts -- or mentor.

As for the won't fix -- while it is fair to bring up the issue, it is not fair to imply that we'll be starting discussions or work on it on it any time soon. So in re-opening this, I will be tagging it hold and discussion.

BethanyG commented 2 years ago

@MatthijsBlom @AdamJel -- It's now July, and Python 3.11 is in beta. Time flies!

I think we might be ready to take the plunge and start upgrading our tooling to 3.10. This (mostly) means testing the tooling, CI, and exercises to make sure everything works with 3.10 and doesn't explode. The CI for the Python track in particular might need a good looking over. Would either of you still be interested in helping out with this? Let me know. 😄

BethanyG commented 2 years ago

Once I hear back, we can put together a checklist of what needs to happen and log a tracking issue either here or in the tooling repos.

MatthijsBlom commented 2 years ago

Sure, I'm in.

BethanyG commented 2 years ago

@MatthijsBlom - we went ahead and bit the bullet, but would LOVE more testing/attention on Python 3.10.6 - specific features, so if you'd like to go to town on your favorite practice or concept exercise using 3.10.6 features and report any weird things you see, that would be much appreciated! 😄

MatthijsBlom commented 2 years ago

The solution I suspect brought this issue to my attention is now accepted. I remember trying to use PEP 618's optional length-checking in zip, and even wishing for its extension to map, but I cannot find the relevant exercises now. Not sure what else there is to test.