Closed teeworlds-mirror closed 8 months ago
Fuck yeah macOS-latest is passing.
As @MilkeeyCat reported. The windows pipeline suffered from the same issue. I was so tunnel visioned on fixing macOS make_release.py first. I forgot to think about copy_tree() being used in other places. One other place was download.py which then fails the windows pipeline if python 3.12 is used. So I moved the polyfill to twlib.py and now all pipelines are passing ✅✅✅✅✅✅✅ 🚀
Okay so thinking about this again. The code seems to work fully but it is quite some code and it has some weird parts. If the maintainers upstream request changes then our teeworlds-community code is different if we merge it before. So I would love to get in some feedback of the usual nitpickers before this gets merged here. If one of these: heinrich, robsti, dune or oy. Has a look and requests no changes I am okay with merging it here. But I would say its worth the wait for their feedback. Because their feedback will likely block the pr being merged upstream.
Things I would consider possible nitpicks:
from distutils.dir_util import copy_tree
and its imported copy_tree method is then imported again by import twlib
and then calling twlib.copy_tree
which now is basically distutils.dir_util.copy_tree
which I would consider non obvious.if sys.version_info[0] >= 3 and sys.version_info[1] >= 8:
Also the issue only starts appearing in 3.12 so this could be considered wrong or misleading. The reason why I chose 3.8 is because I am using a 3.8 python feature so thats the oldest possible version to use the new copy_tree. And the reason why I chose the oldest possible version is that we start using the new version as early as possible. And then at some point phase out the old version.- copy_tree(source_package_dir+"data", package_dir+"/data")
- copy_tree(languages_dir, package_dir+"/data/languages")
- copy_tree(maps_dir, package_dir+"/data/maps")
+ twlib.copy_tree(source_package_dir+"data", package_dir+"/data")
+ twlib.copy_tree(languages_dir, package_dir+"/data/languages")
+ twlib.copy_tree(maps_dir, package_dir+"/data/maps")
Something like import twlib.copy_tree as copy_tree
. I just couldn't make it work first try and then decided it is more obvious what is going on anyways if it is prefixed with twlib.
Any chance you could review this @heinrich5991, @Robyt3 that would be so cute of you :3
you can also use smth like
try:
from distutils.dir_util import copy_tree
except ModuleNotFoundError:
print("use smth else")
instead of if statement
you can also use smth like
try: from distutils.dir_util import copy_tree except ModuleNotFoundError: print("use smth else")
instead of if statement
I like that. Seems smoother than my code. Will probably force push that later.
Also about imports, i could make it work like
import twlib
from twlib import copy_tree
and it works just fine, so u dont need make make that many changes. if something doesn't work, lemme know.
Thanks @MilkeeyCat I applied all your suggestions. I also reduced the comment text. I personally could not find any nitpicks anymore. But still lets give robsti and heinrich a bit time to respond. If they have no time we just merge it.
Okay it has been a week. Heinrich had a quick look at it. I would say its time to finally get all pipelines passing and merge this :rocket:
upstream: https://www.github.com/teeworlds/teeworlds/pull/3229