codewars / runner

Issue tracker for Code Runner
34 stars 8 forks source link

Add Python 3.10 #148

Closed namedots closed 2 years ago

namedots commented 3 years ago

Python 3.10 released today.

A new and exciting feature in 3.10 is structural pattern matching:

match [4]:
    case []:
        print('empty!')
    case [x]:
        print(f'single value: {x}')
    case _:
        print('more than one value!')
FArekkusu commented 3 years ago

@kazk any progress on this? I was thinking that, assuming there're no breaking performance-related changes, 3.8 could be replaced with 3.10 which shouldn't be very hard (at least, I believe changing the docker configuration to use an image with Python 3.10 installed is, but idk how much extra work is required to update everything on the backend), so I was wondering why there hasn't been any news for almost a month already.

kazk commented 3 years ago

I was thinking that, assuming there're no breaking performance-related changes, 3.8 could be replaced with 3.10 which shouldn't be very hard

You're right, adding a new version of an existing language usually isn't very hard to do, unless something fundamentally changed. For Python, I mostly just need to change the base Docker image to the new version, and update packages to the latest. However, I won't add new language versions just because it's possible. It increases the operational cost, and it's also more confusing for the users.

I've been trying to avoid having more than 2 versions at a time. You can help by updating the rest of 3.6 to 3.8. There are 246 left. See the List-of-Python-Kata-to-Update:

  • Update to Python 3.8 List of kata stuck in older Python version. Should be prioritized so we can get rid of the older version. Note that updating to decorator syntax is not required.
FArekkusu commented 3 years ago

@kazk could you run a script to replace every instance of /home/codewarrior/solution.txt with /workspace/solution.txt across all the Python katas? I've encountered some katas with this problem, and I think doing this could reduce the number of entries in the "failed to update to Python 3.8 automatically" list.

I've also stumbled upon katas which: 1) were updated but not removed from the list; 2) weren't updated but worked fine after switching to 3.8. I wonder if you could also rerun the autoupdater and replace that list with a fresh version?

kazk commented 3 years ago

Sure, I'll try it and update the list. I thought I had replaced /home/codewarrior/solution.txt already. I'll check again.

kazk commented 3 years ago

Updated the list.

uriyyo commented 2 years ago

Hi @kazk, Any updates? When we can expect python 3.10 support?

Madjosz commented 2 years ago

There is one kata left which fails to update to 3.8 (which is perceived as "probably the hardest kata on Codewars" by some). When this kata is fixed to run with Python 3.8, the upgrade can be done.

EloiseRosen commented 2 years ago

Mine Sweeper only works in 3.6, just added it to that list

Blind4Basics commented 2 years ago

Mine Sweeper only works in 3.6, just added it to that list

not anymore (thx for reminding me about that one...)

I just hope I didn't break anything silently... :/

Kacarott commented 2 years ago

@kazk I have just completed and updated "To BF Transpiler", which was the last kata on the list to be updated. Unless there are more which are missing from the list, then all kata should now support 3.8.

kazk commented 2 years ago

(I've been on vacation and will be back tomorrow.)

Looks like we have 3 more added since the last lookup. I'll update the list.

Kacarott commented 2 years ago

Those 3 were all actually on the correct version, but were "confused" and were claiming to have no valid version. Simply making a trivial change and republishing was enough to fix. (All three are fixed now)

kazk commented 2 years ago

Deployed

Background jobs to update compatible kata are in progress for Go, C#, and Python. I'll update the wiki page later.

kazk commented 2 years ago

38 kata need to be updated. https://github.com/codewars/content-issues/wiki/List-of-Python-Kata-to-Update