1. Official PyPI sources and private pypi sources
We usually install the Python package using PIP, which will be conveniently installed by default from the Https://pypi.python.org/pypi. But some of the company's internal projects, inconvenient to go online, this time we will build their own intranet PyPI source server, need to be safe and have the same comfortable experience. So some of our companies need to build their own pypi warehouses, and Python has an official pypi private source implementation (Http://wiki.python.org/moin/PyPiImplementations), and listed a few more mature implementation plan:
(1) PyPI, aka Cheeseshop-the Reference Implementation, powering Themain index.
(2) Cluereleasemanager
(3) eggbasket-a simple, lightweight Python Package Index (akacheeseshop) clone.
(4) haufe.eggserver-grok-based local repository with upload and nosecurity model.
(4) Plone Software Center
(5) Chishop-django based
(6) Pypiserver-minimal PyPI Server, easy to install & use
Generally speaking, using pypiserver is simpler because he is minimal and easy to use.
2. Upload Python packs to the official PyPI or private PyPI
When you upload the Python module using setup.py, you will use the Register/upload command of the setup.py script, but the register and upload command will go to the ~/.PYPIRC configuration file to find the PyPI configuration. If you are building a private pypi source, then you need to configure the private warehouse address, account number, and password information in ~/.PYPIRC. Examples are as follows:
Index-servers =
pypi
pypitest
test-pypi
#官方PyPI源信息
[PyPI]
repository:https:// Pypi.python.org/pypi
Username:{{your_username}}
Password:{{your_password}}
#官方测试PyPI源信息
[ Pypitest]
repository:https://testpypi.python.org/pypi
username:{{your_username}}
password:{{ Your_password}}
#自己搭建的PyPI源信息
[Test-pypi]
repository:https://127.0.0.1/pypi
username:{{ Your_username}}
Password:{{your_password}}
When publishing, you can specify which PyPI warehouse to publish to, such as the following commands to Test-pypi:
Python setup.py register-r test-pypi
python setup.py sdist upload-r
3. Specify PyPI source for PIP configuration
The PIP defaults to downloading and installing packages from the official PyPI source warehouse. In fact, this can be configured with a specified PyPI source, the configuration file is ~/.pip/pip.conf, such as the need to download from the Watercress pip source, configured as follows:
[Global]
Index-url = http://pypi.douban.com/simple/