We always welcome contributions to AlmKanal.
We have decided to use the following tools:
- Pixi for dependency management.
- Ruff for linting and formatting.
- Hatch for packaging and distribution.
The first thing to do is to install Pixi which manages all the rest for us.
Check the installation guide on their website
Afterwards, just run pixi install
in the root folder of the repository and
it's going to take care of the rest.
This is going to create a so-called "environment", i.e. a folder in which all
the dependencies are installed. To use the environment, you need to run pixi shell
.
We have a precommit hook that runs the linter and the formatter before every commit.
To install it, run pre-commit install
.
There are two kinds of dependencies: runtime and development dependencies. Both
are managed in the pyproject.toml
file.
- Runtime dependencies are added to the
[project]
->dependencies
section. - Development dependencies can be found in the
[tool.pixi.dependencies]
section.- You can use the
pixi add
command to add a new development dependency.
- You can use the
After you have edited the pyproject.toml
file, run pixi install
to install the new dependencies.
Linting and formatting are done with Ruff. These rules are going to be enforced by CI in the future.
If you want to check your code manually, just run pixi run lint
.
We use Hatch to build and distribute the package. It is also used to manage the versioning of the package.
Eventually, building and distributing the package will be done automatically by CI.
But if you want to test it, you can just use hatch build
and it is going to
create a wheel file in the dist
folder.
We use Hatch to manage the version of the package.
The single source of truth for the version is found in the almkanal/__version__.py
file.
You can use hatch to view the current version with hatch version
. If you want
to create a new version, hatch increments the version number for you and also creates
a tag for you.
hatch version dev
creates a new development version.hatch version fix
creates a new patch version.hatch version minor
creates a new minor version.
Just make sure to also push the tag to the repository with git push --tags
.