Install devpi
Summary
devpi consists of three components:
- Devpi server: provides image and cache functions, deploys in the DMZ area of the enterprise, and improves the efficiency of downloading python package
- Devpi Web: provide web interface and query function
- Devpi client: command line tool, providing package upload and other functions
devpi-server
# If devpi server does not work with the Internet, you can install it by setting up an agent
# pip --proxy http://proxy_server:3128 install -q -U devpi-server
pip install -q -U devpi-server
devpi-server --version
Initialization and initial start-up
devpi-server --init devpi-server --start
test
pip install -i http://localhost:3141/root/pypi/ simplejson
pip uninstall -y simplejson
easy_install -i http://localhost:3141/root/pypi/+simple/ simplejson
pip uninstall -y simplejson
devpi-web
pip install -q -U devpi-web
devpi-server --stop
devpi-server --recreate-search-index
devpi-server --start
pip search --index http://localhost:3141/root/pypi/ devpi-client
Common commands
devpi-server --init
devpi-server --start
devpi-server --stop
devpi-server --status
devpi-server --log
devpi behind proxy
export http_proxy="http://proxy_server:3128"
export https_proxy="http://proxy_server:3128"
export no_proxy="localhost,10.0.0.0/8,172.16.0.0/12"
devpi-server --start
nginx reverse proxy
# http block
upstream pypi.example.com {
server 127.0.0.1:3141;
keepalive 16;
}
# server block
location ~ /(root|\+search) {
proxy_pass http://pypi.example.com;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Client settings
pip
# Linux: $HOME/.pip/pip.conf
# Windows 7: C:\ProgramData\pip\pip.ini
# windows xp: C:\Documents and Settings\All Users\Application Data\pip\pip.ini
# or use environment variable PIP_CONFIG_FILE to specify location
# please replace example.com to your REAL domain name
[global]
index-url = http://pypi.example.com/root/pypi/+simple/
[install]
trusted-host=pypi.example.com
[search]
index = http://pypi.example.com/root/pypi/
easy_install
# $HOME/.pydistutils.cfg:
[easy_install]
index_url = http://pypi.example.com/root/pypi/+simple/
Reference resources
Author: Pastoral w
Link: https://www.jianshu.com/p/cc600c36e549
Source: Jianshu
The copyright belongs to the author. For commercial reprint, please contact the author for authorization. For non-commercial reprint, please indicate the source.