From 252961f1593e409eacf666d707368e8a67440497 Mon Sep 17 00:00:00 2001 From: ebner Date: Mon, 1 Jul 2024 14:54:09 +0200 Subject: [PATCH 1/2] add config option --- services-user-guide/python.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/services-user-guide/python.md b/services-user-guide/python.md index b3dd246a..055ecfb8 100644 --- a/services-user-guide/python.md +++ b/services-user-guide/python.md @@ -13,3 +13,30 @@ The url to use the CachingProxy is: https://pypi.psi.ch/simple: You can manually specify the url while using the `pip` command as follows: pip install --index-url=https://pypi.psi.ch/simple pandas + + +To fix the default url for your user to the proxy you can create the following config file within your users home directory: + +```bash +% cat ~/.config/pip/pip.conf +[global] +timeout = 60 +index-url = https://pypi.psi.ch/simple +``` + +To check whether your pip client is using this address you can simply issue a: +``` +pip install -h +``` + +Check whats written in the descripiton of the option --index-url: + +``` +% pip install -h | grep -A5 index-url + -i, --index-url Base URL of the Python Package Index (default + https://pypi.psi.ch/simple). This should point + to a repository compliant with PEP 503 (the + simple repository API) or a local directory laid + out in the same format. +... +``` \ No newline at end of file From 956391f78c1db80fe481ee11d325c388a05ff4d3 Mon Sep 17 00:00:00 2001 From: ebner Date: Mon, 1 Jul 2024 15:00:08 +0200 Subject: [PATCH 2/2] add link --- services-user-guide/python.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/services-user-guide/python.md b/services-user-guide/python.md index 055ecfb8..903958dc 100644 --- a/services-user-guide/python.md +++ b/services-user-guide/python.md @@ -24,6 +24,9 @@ timeout = 60 index-url = https://pypi.psi.ch/simple ``` +To change the default for the whole system edit: `/etc/pip.conf` +(also see: https://pip.pypa.io/en/stable/topics/configuration/#location) + To check whether your pip client is using this address you can simply issue a: ``` pip install -h @@ -39,4 +42,12 @@ Check whats written in the descripiton of the option --index-url: simple repository API) or a local directory laid out in the same format. ... +``` + +or do a `pip config list` +``` +% pip config list +global.index-url='https://pypi.psi.ch/simple' +global.timeout='60' + ``` \ No newline at end of file