Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| tips:pypi [2016/01/05 10:43] – created scipio | tips:pypi [2023/04/13 15:10] (current) – sscipioni | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== PYPI ====== | ====== PYPI ====== | ||
| - | ===== pip custom repo ===== | + | ===== pypiserver |
| - | ~/ | ||
| - | < | ||
| - | [global] | ||
| - | trusted-host = pypi.csgalileo.org | ||
| - | extra-index-url = https:// | ||
| - | </ | ||
| - | ===== setuptools with custom repo ===== | + | https:// |
| - | ~/.pypirc | ||
| - | < | ||
| - | [distutils] | ||
| - | index-servers = pypi | ||
| - | galileo | ||
| - | [pypi] | + | ===== authentication ===== |
| - | repository: http:// | + | |
| - | username: | + | |
| - | password: | + | |
| - | [galileo] | ||
| - | repository: https:// | ||
| - | username: | ||
| - | password: | ||
| - | </ | ||
| + | create | ||
| - | ===== PYPI repo with apache ===== | + | <code | download> |
| - | + | htpasswd -sc htpasswd.txt galileo | |
| - | ==== https ==== | + | |
| - | < | ||
| - | sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \ | ||
| - | | ||
| - | -out / | ||
| </ | </ | ||
| + | update | ||
| + | <code | download> | ||
| + | |||
| + | htpasswd -s htpasswd.txt < | ||
| - | < | ||
| - | a2enmod ssl | ||
| </ | </ | ||
| - | / | ||
| - | < | ||
| - | < | ||
| - | ServerName pypi.csgalileo.org | ||
| - | RewriteEngine On | + | ===== client ===== |
| - | | + | |
| - | RewriteRule (.*) https:// | + | |
| - | </ | + | |
| - | < | + | Client authentication use keyring and: |
| - | | + | - ~/.pip/pip.conf for install |
| - | | + | - ~/.pypirc for publish and eventually for clear password |
| - | SSLEngine On | + | ===== pip ===== |
| - | SSLCertificateFile / | + | |
| - | SSLCertificateKeyFile / | + | |
| - | < | ||
| - | AllowOverride None | ||
| - | Options +Indexes | ||
| - | IndexOptions SuppressColumnSorting | ||
| - | IndexIgnore .. | ||
| - | Order deny,allow | ||
| - | Allow from all | ||
| - | AuthType Basic | + | ~/ |
| - | | + | |
| - | | + | <code | download> |
| - | | + | [global] |
| - | | + | extra-index-url = http://localhost: |
| - | </ | + | https:// |
| + | trusted-host = localhost | ||
| - | LogLevel warn | ||
| - | ErrorLog / | ||
| - | CustomLog / | ||
| - | </ | ||
| </ | </ | ||
| - | ==== Users ==== | + | now it is possible to use install command like "pip install blabla" |
| - | create | + | ===== twine ===== |
| - | < | + | |
| - | sudo htpasswd | + | |
| - | </code> | + | ~/.pypirc |
| + | < | ||
| + | |||
| + | [distutils] | ||
| + | index-servers = | ||
| + | galileo | ||
| + | localhost | ||
| + | |||
| + | [localhost] | ||
| + | repository = http://localhost: | ||
| + | username = galileo | ||
| + | #password = <first-repository password> | ||
| + | |||
| + | |||
| + | [galileo] | ||
| + | repository = https:// | ||
| + | username = galileo | ||
| + | # not needed if keyring is used | ||
| + | #password = < | ||
| - | add user or change password | + | </code> |
| - | < | + | now it is possibile publish package like |
| - | sudo htpasswd / | + | <code | download> |
| + | twine upload -r galileo dist/* | ||
| </ | </ | ||
| + | ===== user keyring ===== | ||
| + | |||
| + | |||
| + | twine has keyring utility | ||
| + | add galileo user to keyring | ||
| + | |||
| + | < | ||
| + | keyring set http:// | ||
| + | </ | ||