Skip to content

Commit

Permalink
docs(installation): improve installing development instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
ns-rse committed Jun 6, 2024
1 parent 441ca1e commit 87b998b
Showing 1 changed file with 40 additions and 26 deletions.
66 changes: 40 additions & 26 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pip install topostats==2.0.0
For more information on using `pip` to install and manage packages please refer to the [pip
documentation](https://pip.pypa.io/en/stable/user_guide/).

### Cloning from GitHub
### Installing from GitHub

You may wish to consider cloning and installing TopoStats from GitHub if...

Expand All @@ -73,42 +73,45 @@ You may wish to consider cloning and installing TopoStats from GitHub if...
- If you have found an issue in a released version and want to see if it has been fixed in the unreleased version.
- If you wish to develop and extend TopoStats with new features yourself.

If you do not have Git already installed please see [Git](installation#git). If you intend to contribute to the
development of TopoStats please read through the [contributing](contributing) section.
There are two options to install from GitHub, which you use will depend on what you want to do.

If you are familiar with the command line then you can clone and install TopoStats with the following _after_ activating
your virtual environment.
1. Using PyPI to install directly.
2. Clone the repository and install from there.

If all you want to do is use the development version of TopoStats then you can use option 1. If you wish to change the
underlying code you should use option 2.

#### Installing from GitHub using PyPI

[`pip`][pip] supports [installing packages from GitHub][pip_github]. To install the `main` branch of TopoStats use the
following in your Virtual Environment.

```bash
git clone https://github.com/AFM-SPM/TopoStats.git
# If you have SSH access configured to GitHub then you can use
git clone git@github.com:AFM-SPM/TopoStats.git
pip install git+https://github.com/AFM-SPM/TopoStats.git@main
```

#### Cloning Using GitKraken

If you are using GitKraken you can clone the repository by selecting "Clone" and then "GitHub.com" and typing
`TopoStats` into the box next to "Repository to Clone" and you should be presented with the option of selecting
"TopoStats" from the AFM-SPM organisation.
You can install any branch on GitHub by modifying the last argument (`@main`) to the branch you wish to install,
e.g. `@another_branch` would install the `another_branch` (if it existed).

Alternatively you can "Clone with URL" and enter `https://github.com/AFM-SPM/TopoStats.git` as the URL to clone from,
selecting a destination to clone to.
#### Cloning the Repository and installing

#### Installing TopoStats from the Cloned Repository
If you do not have Git already installed please see [Git](installation#git). If you intend to contribute to the
development of TopoStats please read through the [contributing](contributing) section.

Once cloned you will have to open a Terminal and navigate to the directory you cloned and _after_ activating your
virtual environment install TopoStats with the following.
If you are familiar with the command line then you can clone and install TopoStats with the following _after_ activating
your virtual environment. By installing in editable mode (with the `-e` flag) switching branches will make the branch
available.

```bash
cd /path/to/where/topostats/was/cloned/TopoStats
pip install .
cd ~/where/to/clone
git clone git@github.com:AFM-SPM/TopoStats.git
cd TopoStats
pip install -e .
```

If you wish to make changes to the code and test then make a `git branch`, make your changes and install in editable mode,
i.e. `pip install -e .`.

If you plan to contribute to development by adding features or address an existing
[issue](https://github.com/AFM-SPM/TopoStats/issues) please refer to the [contributing](contributing) section.
[issue](https://github.com/AFM-SPM/TopoStats/issues) please refer to the [contributing](contributing) section and pay
particular attention to the section about installing additional dependencies.

We include [notebooks](notebooks) which show how to use different aspects of TopoStats. If you wish to try these out the
[Jupyter Noteooks](https://jupyter.org/) then you can install the dependencies that are required from the cloned
Expand All @@ -118,12 +121,19 @@ TopoStats repository using...
pip install ".[notebooks]"
```

#### Cloning Using GitKraken

If you are using GitKraken you can clone the repository by selecting "Clone" and then "GitHub.com" and typing
`TopoStats` into the box next to "Repository to Clone" and you should be presented with the option of selecting
"TopoStats" from the AFM-SPM organisation. Once cloned follow the above instructions to install with `pip` under your
virtual environment.

## Tests

One of the major changes in the refactoring is the introduction of unit tests. These require certain packages to be
installed which are not installed to your virtual environment by
[setuptools](https://setuptools.pypa.io/en/latest/setuptools.html) in the above steps. If you are intending to modify or
contribute to the development of TopoStats and making changes to the code base you will likely want to be able to run
contribute to the development of TopoStats or make changes to the code base you will likely want to be able to run
the tests. Install the necessary dependencies to do so with...

```bash
Expand All @@ -135,9 +145,13 @@ pytest

## Git

[Git](https://git.vc) is a version control system for managing software development and is required to be installed on
[Git][git] is a version control system for managing software development and is required to be installed on
your computer in order to clone the TopoStats repository. Instructions on installing Git can be found at [Git Guides -
install git](https://github.com/git-guides/install-git).

A nice Graphical User Interface for working with Git is [GitKraken](https://www.gitkraken.com/) which includes
everything you need.

[git]: https://git.vc
[pip]: https://pypi.org/project/pip/
[pip_github]: https://pip.pypa.io/en/stable/getting-started/#install-a-package-from-github

0 comments on commit 87b998b

Please sign in to comment.