Skip to content
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

Add support for Python 3.12 #2119

Merged
merged 8 commits into from
Apr 23, 2024
Merged

Add support for Python 3.12 #2119

merged 8 commits into from
Apr 23, 2024

Conversation

hartwork
Copy link
Member

@hartwork hartwork commented Oct 6, 2023

No description provided.

@hartwork hartwork added this to the 1.0.5 milestone Oct 6, 2023
@hartwork hartwork marked this pull request as draft October 6, 2023 14:34
@gbtami
Copy link
Member

gbtami commented Apr 19, 2024

Seems this needs marcelotduarte/cx_Freeze#2153

@hartwork
Copy link
Member Author

Seems this needs marcelotduarte/cx_Freeze#2153

I'm not sure I want to vote for --extra-index-url https://marcelotduarte.github.io/packages/ to use their own versions of third party wheels. It will have fewer eyes using and auditing than ideal.

@gbtami
Copy link
Member

gbtami commented Apr 20, 2024

Yea, we better to wait for official pypi releases.

@gbtami gbtami marked this pull request as ready for review April 22, 2024 14:52
@gbtami gbtami marked this pull request as draft April 22, 2024 19:51
@gbtami
Copy link
Member

gbtami commented Apr 22, 2024

https://pypi.org/project/cx-Freeze/ 7.0.0 is out now.

@hartwork hartwork force-pushed the python-3-12 branch 7 times, most recently from c4d8417 to b47bee4 Compare April 23, 2024 00:06
Precise warning was:
> lib/pychess/widgets/BoardControl.py:257:29: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
Precice warning was:
> lib/pychess/widgets/gamenanny.py:160:17: F811 redefinition of unused 'callback' from line 152
@hartwork hartwork marked this pull request as ready for review April 23, 2024 00:16
@hartwork
Copy link
Member Author

@gbtami finally green CI, please merge without squashing if happy with the changes, semantic commit cuts really matter here. Thanks!

@gbtami gbtami merged commit 416c153 into pychess:master Apr 23, 2024
10 checks passed
@hartwork
Copy link
Member Author

hartwork commented Apr 23, 2024

@gbtami thanks for the merge! Should we release 1.0.5 off master with Python 3.12 support?

@gbtami
Copy link
Member

gbtami commented Apr 23, 2024

Haha, I never noticed this private/public thing is exists at all. Possible this is the case for the other members as well idk :)
Anyhow, I changed mine to public in pychess and in Fairy-Stockfish as well now.
Thx for noticing it.

@hartwork
Copy link
Member Author

@gbtami okay, I changed mine back to public now too. For 1.0.5, what we need more: a simple Git tag (if we want to match 1.0.4), a GitHub release page, with binaries from the CI added. I think you did all of that for 1.0.4 but I could mis-remember. How should we continue?

@gbtami
Copy link
Member

gbtami commented Apr 24, 2024

I downloaded the generated .msi to test it on my Win10, but unfortunately it failed to start :(
msi

Interestingly when I run
python setup.py bdist_msi
in my local MSYS2 install (it has older package versions of everything compared to current) it works OK.
I can imagine this is related to the new cx_freeze...

@gbtami
Copy link
Member

gbtami commented Apr 24, 2024

Also after my latest commit some github action were not successful :(

@hartwork
Copy link
Member Author

hartwork commented Apr 24, 2024

I downloaded the generated .msi to test it on my Win10, but unfortunately it failed to start :(

@gbtami I'm I cannot offer help with that beyond Googling for it.

Also after my latest commit some github action were not successful :(

@gbtami the Ubuntu mirror of Microsoft had issues of temporary nature apparent. I re-ran CI just now and your latest commit 67d048f is all green now.

@masoudd
Copy link
Contributor

masoudd commented Apr 24, 2024

I tested the msi installer from build artifacts of this ci run from commit e8e9c54
And it installs successfully but running it gives this error and terminates:
Screenshot 2024-04-24 225352
Using up to date windows 10

@hartwork
Copy link
Member Author

hartwork commented Apr 24, 2024

@masoudd @gbtami after a look at https://github.com/python/cpython/blame/main/Lib/asyncio/windows_events.py my impression is that the CPython 3.11 in use there is incomplete (and hence broken). Or it fails to find the file in the right place? Is that something that cx_Freeze would influence?

@masoudd
Copy link
Contributor

masoudd commented Apr 24, 2024

I think that is something wrong with cx_Freeze, I did some digging and came up with this:
add "_overlapped" to array in line 317 in setup.py

So line 317: "includes": ["gi", "_overlapped"],

I built an msi file on my local msys install and installed it. Now running pychess gives this error:
new_error

Which suggests something is wrong with either pygobject or cx_Freeze. I can run pychess from a copy of the master branch checked out in my msys install, so I think that would rule out pygobject.

@hartwork
Copy link
Member Author

hartwork commented Apr 24, 2024

@masoudd interesting, thanks for sharing! I hope that @gbtami can take that hint and figure something out, I don't have access to Windows myself outside of CI and MinGW, and have not have for 10+ years.

@gbtami
Copy link
Member

gbtami commented Apr 25, 2024

I opened marcelotduarte/cx_Freeze#2356

@hartwork
Copy link
Member Author

@gbtami that's great, thank you! And we have a fix from upstream and in MSYS already. Does the build at https://github.com/pychess/pychess/actions/runs/8837443869 happen to already have that fix and work?

@gbtami
Copy link
Member

gbtami commented Apr 25, 2024

Seems the fixed package is not available yet.
https://packages.msys2.org/package/mingw-w64-x86_64-python-cx-freeze?repo=mingw64

@hartwork
Copy link
Member Author

@gbtami I see! Let's check again in a few hours maybe.

@gbtami
Copy link
Member

gbtami commented Apr 25, 2024

I got this link to check :) https://packages.msys2.org/queue

@hartwork
Copy link
Member Author

@gbtami nice! It's past the queue now if I read the page right. I triggered a rebuild to latest master at https://github.com/pychess/pychess/actions/runs/8837952115 , let's see.

@hartwork
Copy link
Member Author

@gbtami you won't like it, I'm afraid:

running build_exe
Traceback (most recent call last):
  File "D:/a/pychess/pychess/setup.py", line 365, in <module>
    setup(
  [..]
    module.hook(self)
  File "D:/a/_temp/msys64/mingw64/lib/python3.11/site-packages/cx_Freeze/hooks/__init__.py", line 605, in load_subprocess
    module.exclude_names.update(exclude_names)
                                ^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'exclude_names' where it is not associated with a value

@gbtami
Copy link
Member

gbtami commented Apr 25, 2024

Opened marcelotduarte/cx_Freeze#2362

@masoudd
Copy link
Contributor

masoudd commented Apr 25, 2024

I don't fully understand cx_Freeze but this pull request seems to be the fix: marcelotduarte/cx_Freeze#2363

Edit: I used the change in the above pull request and it builds the msi file. But installing it and running pychess gives the error I posted above: assert g_type != TYPE_NONE.
new_error
They know about it: marcelotduarte/cx_Freeze#2361

@hartwork
Copy link
Member Author

@gbtami @masoudd the Windows CI is green again just now, could you try the artifact from the re-build at https://github.com/pychess/pychess/actions/runs/8855111639 ?

@gbtami
Copy link
Member

gbtami commented Apr 28, 2024

It produces the same AssertionError masoudd pasted above :(

@hartwork
Copy link
Member Author

@gbtami okay 😞

@hartwork
Copy link
Member Author

@gbtami should we tag and release 1.0.5 to https://github.com/pychess/pychess/releases without Windows binaries OR wait for working Windows binaries and then tag and release 1.0.5?

@gbtami
Copy link
Member

gbtami commented Apr 30, 2024

Yes, we can tag and release without github CI .msi I think. (Edit: done)
Possible I will upload .msi from my older (but working) local MSYS2 install.

@hartwork
Copy link
Member Author

@gbtami thanks for the tag and release! One key file seems missing still: pychess-1.0.5.tar.gz with eco.db pre-generated as with 1.0.4: https://github.com/pychess/pychess/releases/tag/1.0.4 .

@hartwork
Copy link
Member Author

@gbtami PS: I noticed when trying to bump the package in Gentoo.

@hartwork
Copy link
Member Author

hartwork commented Apr 30, 2024

@gbtami PPS: it's generated as pychess_1.0.5.orig.tar.gz as part of the Debian CI, if I remember correctly: https://github.com/pychess/pychess/actions/runs/8901837037 . The tarball is contained in that artifact zip.

@gbtami
Copy link
Member

gbtami commented Apr 30, 2024

Thx. Added.

@hartwork
Copy link
Member Author

hartwork commented May 1, 2024

Thx. Added.

@gbtami thank you! I dared renaming pychess_1.0.5.tar.gz (with underscore) to pychess-1.0.5.tar.gz (with hyphen) for consistency with 1.0.4, I hope that's in your interest also and that most packagers try packaging after the rename rather than in the time window before.

@hartwork
Copy link
Member Author

hartwork commented May 1, 2024

@gbtami PS: gentoo/gentoo@2068e50 just put PyChess 1.0.5 into Gentoo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants