|
|
PyRatThis repository contains the software used in the The course is available at this address: The documentation is available at this address: |
Prerequisites
-
This installation procedure assumes that you have basic knowledge about shell manipulation.
-
PyRat uses uv to manage Python and the libraries it needs.
You do not need to install Python yourself: uv takes care of it, and PyRat workspaces are configured to use Python 3.13 (Python 3.12 is also supported). -
Finally, we will test PyRat installation using Visual Studio Code (VSCode), as this is the main tool we use in the associated course. Please make sure it is already installed, or install it from the official website. Note that you can use a different tool if you want, but we just provide indications for that one here.
Install uv
If uv is not installed on your machine yet, install it as follows:
- Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh. - MacOS:
curl -LsSf https://astral.sh/uv/install.sh | sh. - Windows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex".
Other installation methods are described in the uv documentation.
Then, close and reopen your terminal, and check that uv is available by running uv --version.
Setup your PyRat workspace
We are now going to create a workspace for PyRat.
This is a directory that contains minimal working examples to get started, and in which PyRat is installed.
To do so, follow these steps:
- Open a terminal, and navigate (use the
cdcommand) to the directory where you want to create your PyRat workspace. - Run the following command (it is the same on all systems):
uvx --from pyrat-game pyrat-init.
You should see something like this:
Initialized project `pyrat-project` at `/path/to/pyrat_project`
Workspace initialized as a uv project using Python >=3.12,<3.14
Workspace created in /path/to/pyrat_project
Workspace configured to be installed in its virtual environment
Using CPython 3.13.13
Creating virtual environment at: .venv
Clean relocatable virtual environment created for the workspace
Resolved 20 packages in 178ms
Installed 19 packages in 45ms
PyRat added to the dependencies of the workspace
Your workspace is ready! You can now start coding your players and run games.
To run a game, go to the workspace using 'cd pyrat_project', then use for instance 'uv run pyrat_workspace/games/sample_game.py'.
You should have a new directory called pyrat_project in the directory where you ran the command.
It contains a pyrat_workspace directory, which is where your own programs live.
If you prefer another name for the workspace, pass it to the command, as in uvx --from pyrat-game pyrat-init my_project.
Check your installation
Now, we are going to verify that PyRat works properly.
To do so, follow these steps:
- Open a terminal, and navigate to your workspace using
cd pyrat_project. - Run the sample game as follows:
uv run pyrat_workspace/games/sample_game.py.
You can also run your games from VSCode.
To do so, follow these steps:
- Open VSCode, and add your
pyrat_projectdirectory in your VSCode workspace. - Open the file
sample_game.pyin directorypyrat_workspace/games/. - Make sure VSCode is using the interpreter located in the
.venvdirectory of your workspace. - Run
sample_game.py.
In both cases, you should see something like this:
Add other libraries to your workspace
Your workspace is a uv project, so you can add any library you need to it.
To do so, run uv add from your workspace, as in uv add numpy.
The library is then available in your players and games, with no need to activate anything.
Repair your workspace
A workspace describes everything it needs in its pyproject.toml and uv.lock files, so it can always be rebuilt.
If it is renamed or moved, or if one of its libraries goes missing, running uv sync from the workspace installs everything again and makes its programs importable from their new location.
If that is not enough, run the very same command that created the workspace, from the workspace itself:
uvx --from pyrat-game pyrat-init
Run from a workspace, this command does not create a new one inside it, and does not touch the programs it contains.
It replaces the .venv directory with a brand new one, in which everything the workspace declares is installed again, and it repairs the configuration of the workspace, should uv refuse to work in it.
This is also how a workspace obtained from a Git repository, which comes with no .venv directory, is prepared.
Troubleshooting
-
In case of a problem, please check the existing GitHub issues first.
-
If the problem persists, you can add an issue of your own.
-
For students at IMT Atlantique, you can also ask your questions on the Discord server of the course.
-
Finally, you can contact Bastien Pasdeloup directly.
Metadata
Release files for pyrat-game 6.4.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyrat_game-6.4.9.tar.gz | 4.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyrat_game-6.4.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.5 MB
Release files / pyrat_game-6.4.9.tar.gz
| Download URL | pyrat_game-6.4.9.tar.gz |
|---|---|
| Size | 4.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5dd91193af4b193e5dec00a21aeee3f768774246b765ccb9390d90cebb18e95
|
|
BLAKE2b-256 checksum How to use checksums |
e7cb6534d1f901bb71a3a4cdd9f953bfaa9405edf04b3452a4587b96827fc3fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / pyrat_game-6.4.9-py3-none-any.whl
| Download URL | pyrat_game-6.4.9-py3-none-any.whl |
|---|---|
| Size | 4.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f9e523bf9509308385f6042966e44271744347b8af58d4f69bd17f50990753ee
|
|
BLAKE2b-256 checksum How to use checksums |
7f34c27bf236859709e958ee629d6c77e8c6bf3552fefde1210c22c8393baa4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency log