Skip to content

Conversation

@bittner
Copy link

@bittner bittner commented Sep 12, 2025

Adds an initial Python packaging setup.

  • Renames the bin/ folder to src/ (to match the src layout recommended by Python packaging)
  • Renames the LucasR.py module to main.py
  • Adds a __name__ == "__main__"´ name guard to the main.py module (to allow launching the app via an entrypoint script lucas-chess)
  • Makes the package build pick up all engines, Windows and Linux, to create a giant Python package.

Usage

Build the wheel and source distribution:

uv build

This will create 2 large files (a wheel and a source distribution) as a Python package:

$ ls -l dist/
-rw-r--r-- 1 peter users 407M 14. Sep 17:26 lucas_chess-2.20.0.dev0-py3-none-any.whl
-rw-r--r-- 1 peter users 405M 14. Sep 17:25 lucas_chess-2.20.0.dev0.tar.gz

Both resulting package files can directly be installed (in a virtual environment) via

uv pip install <package-filename>

Alternatively, you can install them from source off the GitHub repository directly via

uv pip install git+https://github.com/<username>/lucaschessR2@<branch>#egg=lucas-chess

Once the package is installed, the application can be run from the terminal via

lucas-chess

Alternatively, the application can still be run from source code like this:

uv run src/main.py

Notes

Lucas Chess can now be run via `uv run bin/LucasR.py`.

Python dependencies are installed automatically, venv activation is handled by uv.
@lukasmonk
Copy link
Owner

Thanks for the information, I will see if it is possible when the development of LucasChessR6 starts.
In LucasChessR2 I'm not going to make structural changes, first of all for fear of side effects.

@bittner bittner force-pushed the feature/python-package branch from 28715a4 to 30bdcdd Compare September 14, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants