patkit

Setting PATKIT up for Development

NOTE:

As of PATKIT 0.14, these instructions are incorrect and only here in case someone wants to install PATKIT using mamba/conda etc. If you are that someone and would like to contribute, please get in touch. In any case you’ll need to fork PATKIT, update these instructions. A pull request for working instructions would be welcome.

On with the instructions

The most important steps for getting PATKIT installed in development mode are:

Preliminaries

Install the following:

If planning to fork the GitHub repository, you will also need a GitHub account.

Fork and clone the repository

First, fork the repository from https://github.com/giuthas/patkit.

Second, clone the repository to your local system.

Third, if not automatically done, setup the original repository as your upstream repo:

git remote add upstream https://github.com/giuthas/patkit
git fetch upstream
git merge upstream/main main

Here’s what this does in practice:

forking PATKIT

Clone directly from the PATKIT main

In a directory that you would like the clone to live in, run the following command optionally giving a name for the directory PATKIT will be cloned to.

git clone https://github.com/giuthas/patkit [optional directory]

Create the conda environments

Once you have a copy of PATKIT’s source code, run these commands on the command line:

cd [patkit root]
mamba env create -f patkit_stable_conda_env.yaml
mamba env create -f patkit_devel_conda_env.yaml

And to actually use the latter:

conda activate patkit-devel

Install PATKIT in development mode

This should work in the usual way for Python packages by just running pip install -e . in the root directory of PATKIT – NOT the patkit directory inside the package, but the root directory of the repository.

This will enable use of PATKIT as a library as if it were a regularly installed Python package, while waht actually gets used is the live code base in the local repository. This needs to be done separately for each Python conda/virtual environment in use.

Other topics

Other topics covered by this guide:

Rebuild and activate a conda environment after updating the environment

After either downloading a newer version or making local changes, run these commands on the command line:

conda activate base
conda env remove -n patkit-devel
mamba env create -f patkit_devel_conda_env.yaml
conda activate patkit-devel

Substitute patkit-stable for patkit-devel and patkit_stable_conda_env.yaml for patkit_devel_conda_env.yaml to update the stable environment.