Installation & Tooling#

Installation#

galaxy-graph is managed by git, and can be cloned from its git repository.

git clone https://git.linarphy.net/linarphy/galaxy-graph
cd galaxy-graph

Once in the created directory, you can now start editing the project.

Tooling#

Each tool can be automatically installed with mise. If mise is installed, run mise trust to trust the mise.toml file. Then running mise install will automatically install tools, that will be available in the current directory.

Caution

It is good practice to read the file before trusting it ! It’s not big.

just is the main development tools. It is a replacement of make, allowing executing a set of task like running test, generating stubs, etc. To list every commands and read their documentation, run just --list.

Package manager#

This project uses hatch as a package and environment manager. It also uses uv to quickly download all the dependencies.

To run a command with a given python environment, uses:

hatch run {env_name}:{command}

For example:

hatch run dev:nvim src/galaxy_graph/__init__.py

Note

All just commands needing a given environment will automatically uses hatch: There is no need to run hatch run test:just test.

Tip

Environment are stored in pyproject.toml, in the section tool.hatch.env. They can also be listed with hatch env show.

Test#

Tests use the unittest module, available by default on Python. Test coverage is computed with coverage.py. Running just test will run every tests and report the test coverage.

Linting and formatting#

Maintainer of this project use ruff to lint and format every python code.

Typing#

Maintainer of this project use ty to check for type hinting. Running just check will run every test and check linting or typing error. just fix will run every test, format the code and try to automatically safely fix every linting/typing error.

Stubs#

Stubs are automatically generated with mypy and its stubgen tool. Running just stubs will generate these stubs.

Warning

Automatically generated stubs have to be corrected each time because mypy have a hard time dealing with a module named setup (and there is a submodule connection.setup in this package). It consists of replacing the relative path .setup to galaxy_graph.connection.setup in typings/galaxy_graph/connection/__init__.pyi and typings/galaxy_graph/connection/state.pyi.