Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tips:pypi [2016/12/19 11:31] – [Users] 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 < | ||
- | < | ||
- | sudo a2enmod ssl | ||
</ | </ | ||
- | ==== apache virtualhost ==== | ||
- | / | + | ===== client ===== |
- | < | + | |
- | < | + | |
- | ServerName pypi.csgalileo.org | + | |
- | RewriteEngine On | + | Client authentication use keyring and: |
- | | + | - ~/.pip/pip.conf for install |
- | RewriteRule (.*) https:// | + | - ~/.pypirc for publish and eventually for clear password |
- | </VirtualHost> | + | |
- | < | + | ===== pip ===== |
- | ServerName pypi.csgalileo.org | + | |
- | DocumentRoot / | + | |
- | SSLEngine On | ||
- | SSLCertificateFile / | ||
- | SSLCertificateKeyFile / | ||
- | < | + | ~/.pip/pip.conf |
- | AllowOverride None | + | |
- | Options +Indexes | + | |
- | IndexOptions SuppressColumnSorting | + | |
- | IndexIgnore .. | + | |
- | Order deny, | + | |
- | Allow from all | + | |
- | AuthType Basic | + | <code | download> |
- | | + | [global] |
- | | + | extra-index-url = http://localhost: |
- | AuthUserFile | + | 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 -c / | + | |
- | </ | + | |
- | add user or change password | ||
- | < | ||
- | sudo htpasswd / | ||
- | </ | ||
- | generate | + | ~/.pypirc |
- | < | + | <code | download> |
- | openssl passwd | + | |
+ | [distutils] | ||
+ | index-servers = | ||
+ | galileo | ||
+ | localhost | ||
+ | |||
+ | [localhost] | ||
+ | repository = http:// | ||
+ | username = galileo | ||
+ | #password | ||
+ | |||
+ | |||
+ | [galileo] | ||
+ | repository = https:// | ||
+ | username = galileo | ||
+ | # not needed if keyring is used | ||
+ | #password = < | ||
+ | |||
+ | </ | ||
+ | now it is possibile publish package like | ||
+ | < | ||
+ | twine upload | ||
</ | </ | ||
+ | ===== user keyring ===== | ||
+ | |||
+ | |||
+ | twine has keyring utility | ||
+ | add galileo user to keyring | ||
+ | |||
+ | < | ||
+ | keyring set http:// | ||
+ | </ | ||