skf-mrt 1.0.1
Multi-Repository Tool
Requires Python: >=3.6,<4.0


# Multi-Repository Tool (`mrt`)

This is a simple tool for managing multiple repositories. That is, we should be able to keep a number of repositories up to date, create branches linked to some work-item on multiple branches, etc.

# A note about Poetry

This application is built using Poetry. Each application is installed in it's own virtual environment, i.e. it's run in isolation and always "works" (for some definition of works).

**NOTE:** Installing in Poetry is not the same as installing via `pip`/`pip3`.

**NOTE2:** It's highly recommended that you run a poetry version >= 1.0.0.

# Installing Poetry

The recommended way of installing Poetry is not entierly pretty, i.e.:

```sh
curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
```

**IMPORTANT:** The recommended installation doesn't seem to set the path correctly. Thus, either install via `pip` or `pip3` (see below) or manually add Poetry to your PATH-variable (left as an exercise for the user).

Poetry can also be installed via `pip` or `pip3`, but this might cause other problems (for some users).

```sh
pip3 install poetry
```

# Authentication for Azure DevOps package-feed

Since we're installing packages from the gateway-project feed, we need to setup authentication for that. Otherwise we will get some rather meaningless error messages about missing packages.

Setting up authentication for poetry requires the creation of the file `${HOME}/.config/pypoetry/auth.toml` with (at least) the following content:

```
[http-basic.skf-gateway]
password = "<PAT>"
username = "PAT"
```

Where `<PAT>` is your Personal Access Token. It's important that this token has at least `Read` access to `Packaging`. If you wish to publish new versions of mrt, you will of course need `Write` access as well.

# Installation

In order to install mrt, for either user or globally, we first need to build a wheel-file:

```sh
poetry build
```

And then installing the resulting wheel-file:

```sh
pip3 install dist/skf_mrt-X.Y.Z-py3-none-any.whl
```

# Publish

In order to publish a mrt-release (to default package-feed), we simply run the following command:

```sh
poetry publish -r skf-gateway
```
**NOTE:** Publish of course requires that we've built the release...

# Development

First install for development, i.e. link the package in the virtual environment:

```sh
poetry install
```

Then you can edit the files and any changes will be reflected immediately. You still need to run `mrt` in the virtual environment.

# Running development version of `mrt`

Since Poetry installs the package in a virtual environment, running it is a bit more involved than usual. That is, we can either start a shell within the environment, i.e.:

```sh
poetry shell
```

Or run a command, e.g. `mrt`, inside the environment:

```sh
poetry run mrt
```

# Building `mrt` documentation

Start by entering the virtual environment:

```sh
poetry shell
```

And build the documentation:
```sh
cd doc && make html
```

You can also get a list of possible targets, e.g., `html`, `dirhtml`, `singlehtml`, `latex`, `latexpdf`, etc., by running `make` without any arguments.