Please make sure you are using VirtualEnv. This will isolate yopypi from other packages:
pip install virtualenv
yopypi can use a configuration file in a ini style. But this is not required!
yopypi uses these settings by default:
'web_host': 'localhost',
'web_port': '8080',
'mirrors' : ['d.pypi.python.org', 'c.pypi.python.org']
The above values are in the form of a dictionary, but getting them correctly in a ini file would be something like this:
# Sample Configuration File for yopypi
[DEFAULT]
yopypi.web.host = localhost
yopypi.web.port = 8080
yopypi.mirrors = d.pypi.python.org c.pypi.python.org
To be able to catch your requests to pypi we need to run a webserver. yopypi provides a command line tool for this: yopypi-cli. This tool will allow you to start, stop and even pass a configuration file if you need to.
Start:
yopypi-cli start
Stop:
yopypi-cli stop
Start with configuration file:
yopypi-cli start app.conf
If you started the server with the defaults (e.g. localhost:8080) try and go to that same address
If PYPI is up, you should be automatically be redirected.
That is how yopypi works! We test if PYPI is up and redirect you there, if not, we try one of the mirrors the configuration supplied.
There are a few tools that interact with PYPI and they all take different configuration approaches.
For pip you would need something like this in the config:
[global]
index-url = http://127.0.0.1:8080/simple
For buildout:
[buildout]
index = http://127.0.0.1:8080/simple
It is necessary to add that portion of the URL. To check everything is working correctly, create a new VirtualEnv in a temporary directory and see what happens! With yopypi running you should have a similar output to this (tested with one of my packages):
(foo)[alfredo@mbp ~/foo]$ pip install supay
Downloading/unpacking supay
Downloading Supay-0.0.6.tar.gz
Running setup.py egg_info for package supay
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.10.tar.gz
Extracting in /var/folders/1Y/1YKT8JpbGuSvDHiafKs5gU+++TI/-Tmp-/tmprg36Q3
Now working in /var/folders/1Y/1YKT8JpbGuSvDHiafKs5gU+++TI/-Tmp-/tmprg36Q3/distribute-0.6.10
Building a Distribute egg in /Users/alfredo/foo/build/supay
/Users/alfredo/foo/build/supay/distribute-0.6.10-py2.6.egg
Installing collected packages: supay
Running setup.py install for supay
changing mode of build/scripts-2.6/supay.py from 644 to 755
changing mode of /Users/alfredo/foo/bin/supay.py to 755
Successfully installed supay
Cleaning up...
If you are able to catch it... PYPI was up and running when the above happened so even though you are pointing yopypi to 127.0.0.1:8080/simple it is redirecting the request to PYPI.
或是邮件反馈可也:
askdama[AT]googlegroups.com
订阅 substack 体验古早写作:
关注公众号, 持续获得相关各种嗯哼: