Installation

The recommended way to install the unitpackage is to use your package manager, (e.g., apt-get on Debian or Ubuntu, pacman on Arch Linux, brew on macOS.)

You can consult repology to see if the unitpackage is available for your package manager.

Alternatively, the unitpackage can be installed by one of the following approaches.

Install with pip from PyPI

The latest stable version of the unitpackage is available on PyPI for all platforms and can be installed if you have Python and pip installed already:

pip install unitpackage

This command downloads and installs the unitpackage and its dependencies into your local Python installation.

If the above command fails because you do not have permission to modify your Python installation, you can install the unitpackage into your user account:

pip install --user unitpackage

You can instead also install the latest unreleased version of the unitpackage from our GitHub Repository with

pip install git+https://github.com/echemdb/unitpackage@main

Install with conda from conda-forge

The unitpackage is available on conda-forge for all platforms.

If you don’t have conda yet, we recommend to install Miniforge.

Miniforge is already pre-configured for conda-forge. If you already had another release of conda installed, make sure the conda-forge channel is configured correctly

Once your conda setup is ready, create a new unitpackage environment with the latest stable version of the unitpackage:

conda create -n unitpackage unitpackage

To use the unitpackage, activate the unitpackage environment:

conda activate unitpackage

To install the unitpackage into an existing environment, activate that environment and then

conda install unitpackage

Install with pixi for development

We recommend pixi for developers of unitpackage to use a curated list of dependencies that are tested to work on all platforms. These are also exactly the dependencies that are used in our CI, which makes it easier to test things locally.

If you don’t have pixi yet, follow the pixi installation instructions.

Once pixi is installed, get a copy of the latest unitpackage and install the dependencies:

git clone https://github.com/echemdb/unitpackage.git
cd unitpackage
pixi install

Running tests

Run the full test suite (doctests) with:

pixi run test

This is equivalent to running the doctests directly:

pixi run doctest

To run the tests against a specific Python version, use one of the python-3XX environments:

pixi run -e python-312 doctest

Available test environments are: python-310, python-311, python-312, python-313, and python-314.

Linting

Run all linters (pylint, black, isort) at once:

pixi run lint

Or run them individually:

pixi run black
pixi run isort
pixi run pylint

Building the documentation

Rebuild the documentation with:

pixi run doc

Check for broken links in the documentation with:

pixi run linkcheck

Interactive development

You can explore unitpackage in an interactive IPython session:

pixi run -e dev ipython

Or launch a Jupyter notebook:

pixi run -e dev jupyter lab

You can also drop into an interactive shell with all development dependencies available:

pixi shell -e dev

Note that any changes you make to the files in your local copy of unitpackage should be immediately available when you restart your Python kernel.

We would love to see your contribution to unitpackage.