From aa0cf69b6fa71f0876cdadf8d184900706c65269 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Sat, 7 Sep 2024 23:01:38 -0400 Subject: [PATCH] [ADD] doc poetry: proxy with poetry information - this guide explain how to configure a proxy to reduce downloading limitation --- doc/POETRY.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/doc/POETRY.md b/doc/POETRY.md index 8c3adc6..2f36110 100644 --- a/doc/POETRY.md +++ b/doc/POETRY.md @@ -44,3 +44,47 @@ Delete cache at root of the project ```bash rm -r cache ``` + +## Configure a proxy with poetry + +The proxy will create a cache of all downloads. + +https://github.com/EpicWink/proxpi + +Install and run the server + +```bash +pip3 install 'git+https://github.com/EpicWink/proxpi.git' +PROXPI_BINARY_FILE_MIME_TYPE=1 FLASK_APP=proxpi.server flask run +``` + +Or by docker-compose, add the environment +``` +services: + proxpi: + restart: unless-stopped + ports: + - '5000:5000' + image: epicwink/proxpi:latest + environment: + - PROXPI_BINARY_FILE_MIME_TYPE=1 +``` + +Add this configuration into the pyproject.toml + +```toml +[[tool.poetry.source]] +name = "proxpi" +url = "http://localhost:5000/index/" +default = true +secondary = false +``` + +TIPS, maybe before `poetry install` into installation script, need to do `poetry lock --no-update` + +In development, a solution without configuring pyproject.toml, update installation script like : + +```bash +${VENV_PATH}/bin/poetry self add git+https://github.com/mathben/poetry-plugin-pypi-proxy.git[plugin] +PIP_INDEX_URL=http://127.0.0.1:5000/index/ ${VENV_PATH}/bin/poetry install +```