diff --git a/README.md b/README.md index 8798365..8c884e1 100644 --- a/README.md +++ b/README.md @@ -2,44 +2,76 @@ Python interface to TopoToolbox. -## Guide +## Generating/Installing distribution archives -Temporary guide for the functionality of the package. For Windows replace "python3" with "py". +For any operating system, install the following: -### Generate distribution archives +- **Python** +- **pip** +- **Git** (only when _building_ the package yourself) -Before building the archive, make sure the `libtopotoolbox.so` has been added to `/pytopotoolbox/src/topotoolbox/`. -Generates a .whl and .tar.gz which then can be used to install package with pip. -These Files can be distributed with PyPi or downloaded directly. +### Linux -```bash -cd path/to/pytopotoolbox -python3 -m pip install --upgrade build -python3 -m build -``` +- **Installing from .whl file** -### Installing distribution archives + Make sure to choose the appropriate file for your OS. For Linux, the file name should contain something like: `linux_x86_64` -Use "--force-reinstall" to overwrite previous install. + ```bash + pip install dist_name.whl + ``` -```bash -pip install dist_name.whl -``` +- **Installing directly from the repository:** -### Installing from repository + ```bash + cd path/to/pytopotoolbox + pip install . + ``` -If want to install the package directly from the repository without first generating a ".whl" file. +- **Generating distribution archives** -```bash -cd path/to/pytopotoolbox -pip install . -``` + ```bash + cd path/to/pytopotoolbox + python3 -m pip install --upgrade build + python3 -m build + ``` -### Unittest +### Windows -How to run a single unittest: +- **Installing from .whl file** -```bash -cd path/to/pytopotoolbox -python3 -m tests.filename -``` + Make sure to choose the appropriate file for your OS. For Windows, the file name should contain something like: `win_amd64`. + + ```bash + pip install dist_name.whl + ``` + +- **Installing directly from the repository:** + + Since there are C/C++ files that need to be compiled in order to build the package, there are a few extra steps to take. + + 1. Install the [Developer Command Prompt for VS 2022](https://visualstudio.microsoft.com/downloads/). + - Scroll down to '_All Downloads_' + - open '_Tools for Visual Studio_' + - download '_Build Tools for Visual Studio 2022_' + - install it while including the '_Desktop development with C++_' workload + 2. To ensure the compiler is working with 64-bit architecture, that is necessary for python, **open 'x64 Native Tools Command Prompt for VS 2022'** instead of the '_Developer Command Prompt_' that defaults to 32-bit architecture. + 3. In the newly opened terminal, run: + + ```bash + cd path\to\pytopotoolbox + pip install . + ``` + +- **Generating distribution archives** + + Open the 'x64 Native Tools Command Prompt for VS 2022' Terminal and run: + + ```bash + cd path\to\pytopotoolbox + py -m pip install --upgrade build + py -m build + ``` + +### Mac + +[work in progress]