tips:pypi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tips:pypi [2016/01/05 10:43] – created scipiotips:pypi [2023/04/13 15:10] (current) sscipioni
Line 1: Line 1:
 ====== PYPI ====== ====== PYPI ======
  
-===== pip custom repo =====+===== pypiserver =====
  
-~/.pip/pip.conf 
-<code> 
-[global] 
-trusted-host = pypi.csgalileo.org 
-extra-index-url = https://user:password@pypi.csgalileo.org/simple 
-</code> 
  
-===== setuptools with custom repo =====+https://hub.docker.com/r/pypiserver/pypiserver
  
-~/.pypirc 
-<code> 
-[distutils] 
-index-servers = pypi 
-                galileo 
  
-[pypi] +===== authentication =====
-repository: http://pypi.python.org/pypi +
-username: +
-password:+
  
-[galileo] 
-repository: https://pypi.csgalileo.org 
-username:user 
-password:password 
-</code> 
  
 +create
  
-===== PYPI repo with apache ===== +<code | download> 
- +htpasswd -sc htpasswd.txt galileo
-==== https ====+
  
-<code> 
-sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \ 
- -keyout /etc/apache2/ssl/pypi.csgalileo.org.key \ 
- -out /etc/apache2/ssl/pypi.csgalileo.o.pem 
 </code> </code>
  
 +update
 +<code | download>
 +
 +htpasswd -s htpasswd.txt <user2>
  
-<code> 
-a2enmod ssl 
 </code> </code>
  
-/etc/apache2/sites-enabled/pypi.conf 
-<code> 
-<VirtualHost *:80> 
-    ServerName pypi.csgalileo.org 
  
-    RewriteEngine On +===== client ===== 
-    RewriteCond %{HTTPS} off + 
-    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} +
-</VirtualHost>+
  
-<VirtualHost *:443> +Client authentication use keyring and
-    ServerName pypi.csgalileo.org +- ~/.pip/pip.conf for install  
-    DocumentRoot /var/www/pypi.csgalileo.org+- ~/.pypirc for publish and eventually for clear password
  
-    SSLEngine On +===== pip =====
-    SSLCertificateFile /etc/apache2/ssl/pypi.csgalileo.org.pem +
-    SSLCertificateKeyFile /etc/apache2/ssl/pypi.csgalileo.org.key+
  
-    <Directory /var/www/pypi.csgalileo.org/> 
-        AllowOverride None 
-        Options +Indexes 
-        IndexOptions SuppressColumnSorting 
-        IndexIgnore .. 
-        Order deny,allow 
-        Allow from all 
  
-        AuthType Basic +~/.pip/pip.conf 
-        AuthName "Galileo" + 
-        AuthBasicProvider file +<code | download> 
-        AuthUserFile /etc/apache2/passwords_pypi +[global] 
-        Require valid-user +extra-index-url = http://localhost:8081 
-    </Directory>+                  https://pypi.csgalileo.org 
 +trusted-host = localhost
  
-    LogLevel warn 
-    ErrorLog /var/log/apache2/pypi-error.log 
-    CustomLog /var/log/apache2/pypi-access.log combined 
-</VirtualHost> 
 </code> </code>
  
  
-==== Users ====+now it is possible to use install command like "pip install blabla"
  
-create +===== twine ===== 
-<code> + 
-sudo htpasswd -/etc/apache2/passwords_pypi <user+ 
-</code>+~/.pypirc 
 +<code | download
 + 
 +[distutils] 
 +index-servers = 
 +    galileo 
 +    localhost 
 + 
 +[localhost] 
 +repository = http://localhost:8081 
 +username = galileo 
 +#password = <first-repository password
 + 
 + 
 +[galileo] 
 +repository = https://pypi.csgalileo.org 
 +username = galileo 
 +# not needed if keyring is used 
 +#password = <first-repository password>
  
-add user or change password +</code> 
-<code> +now it is possibile publish package like 
-sudo htpasswd /etc/apache2/passwords_pypi <user>+<code | download> 
 +twine upload -r galileo dist/*
 </code> </code>
  
  
 +===== user keyring =====
 +
 +
 +twine has keyring utility
 +add galileo user to keyring
 +
 +<code>
 +keyring set http://localhost:8081 galileo
 +</code>
  
  
  
  • tips/pypi.1451987008.txt.gz
  • Last modified: 2016/01/05 10:43
  • by scipio