From 65c3d535c9d999eb3ee6251f2228c16f8a3a83f4 Mon Sep 17 00:00:00 2001 From: ArneBinder Date: Sat, 11 Nov 2023 18:44:56 +0100 Subject: [PATCH] fix and improve readme (#375) --- README.md | 67 +++++++++++++------------------------------------------ 1 file changed, 16 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index f7c63965..cf9a2117 100644 --- a/README.md +++ b/README.md @@ -551,61 +551,24 @@ that are already converted to the PIE format. -✨📚✨ [Read the full documentation](https://pytorch-ie.readthedocs.io/) + ## 🔧 Project Development ### Setup -This project is build with [Poetry](https://python-poetry.org/). It is recommended, to install Poetry via -[pipx](https://pypa.github.io/pipx/). +This project is build with [Poetry](https://python-poetry.org/). If not yet done, follow the +[Poetry installation guide](https://python-poetry.org/docs/#installation) to install it. Then, install all +dependencies (including for development) for PyTorch-IE by calling the following command from the root of the +repository: -0. To install `pipx`, execute the following (taken from - [pipx installation instructions](https://pypa.github.io/pipx/installation/)): - - ```bash - # [IF PIP IS NOT AVAILABLE] install pip - python -m ensurepip --upgrade - # [OPTIONAL] update pip - python -m pip install --upgrade pip - - # install pipx (requires pip 19.0 or later) - python3 -m pip install --user pipx - python3 -m pipx ensurepath - ``` - - NOTE: This installs `pipx` globally! - -1. Install Poetry via `pipx` (or see [Poetry installation guide](https://python-poetry.org/docs/#installation)): - - ```bash - pipx install poetry - ``` - - NOTE: This installs `pipx` globally! - -2. [IF REQUIRED PYTHON VERSION IS NOT AVAILABLE] install required python: - - ```bash - # for instance, to install python3.9 on Ubuntu: - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt update - sudo install python3.9 - - # or via conda: - conda create -n python3.9=python3.9 -y - conda activate python3.9 - ``` - -3. Finally, install the dependencies (including for development) for PyTorch-IE: - - ```bash - poetry install --with dev - ``` +```bash +poetry install --with dev +``` - NOTE: If the installation gets stuck, try if disabling experimental parallel installer helps - ([source](https://github.com/python-poetry/poetry/issues/3352#issuecomment-732761629)): - `poetry config experimental.new-installer false` +NOTE: If the installation gets stuck, try if disabling experimental parallel installer helps +([source](https://github.com/python-poetry/poetry/issues/3352#issuecomment-732761629)): +`poetry config experimental.new-installer false` ### Testing and code quality checks @@ -638,12 +601,14 @@ To run all commands that also run on GitHub CI, call: poetry run nox ``` -To run more tests (also tests marked with `@pytest.mark.slow`, but without tests for all datasets which would take forever), call: +You can also start a shell with Poetry's virtual environment activated by calling: ```bash -poetry run nox -s tests_no_local_datasets-3.9 +poetry shell ``` +This allows you to run above commands without the `poetry run` prefix. + ### Updating Dependencies Call this to update individual packages: @@ -671,7 +636,7 @@ Since this project is based on the [Cookiecutter template](https://cookiecutter- `git push origin release` 5. Create a PR for that `release` branch on GitHub. 6. Wait until checks passed successfully. -7. Integrate the PR into the main branch (use `rebase` to have a linear history). This triggers the GitHub Action that +7. Integrate the PR into the main branch. This triggers the GitHub Action that creates all relevant release artefacts and also uploads them to PyPI. 8. Cleanup: Delete the `release` branch.