Python package setup (initial approach) - #212
Open
bittner wants to merge 3 commits into
Open
Conversation
Lucas Chess can now be run via `uv run bin/LucasR.py`. Python dependencies are installed automatically, venv activation is handled by uv.
Owner
|
Thanks for the information, I will see if it is possible when the development of LucasChessR6 starts. |
bittner
force-pushed
the
feature/python-package
branch
from
September 14, 2025 15:32
28715a4 to
30bdcdd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an initial Python packaging setup.
bin/folder tosrc/(to match the src layout recommended by Python packaging)LucasR.pymodule tomain.py__name__ == "__main__"´name guard to themain.pymodule (to allow launching the app via an entrypoint scriptlucas-chess)Usage
Build the wheel and source distribution:
This will create 2 large files (a wheel and a source distribution) as a Python package:
Both resulting package files can directly be installed (in a virtual environment) via
Alternatively, you can install them from source off the GitHub repository directly via
Once the package is installed, the application can be run from the terminal via
Alternatively, the application can still be run from source code like this:
Notes
lucas-chesswill abort with a segmentation fault when executed. This is because theManager.pymodule loads theFasterCodelibrary, which is included as a pre-built library (apparently built with Python 3.8). With Python 3.8 aModuleNotFoundError: No module named 'FasterCode'stops the startup, reported by the shiboken2 module.pip install lucas-chess) #203 (comment) it makes sense to refactor how the engines are loaded. It would also make sense to distribute the engines independently from the Python application.