简体   繁体   中英

How change `setup.py test` to use different Pypi server?

Currently I have ~/.pypirc file like this:

[distutils]
index-servers=
    mypypi

[mypypi]
repository = http://192.168.100.101:8080/simple
username = awesome_user
password = awesome_pass

Also I have /etc/pip.conf file:

[global]
index-url = https://192.168.100.101:8080/simple/
allow-external = true
allow-unverified = true

In setuptools documentation we can read:

When your project is installed, either by using EasyInstall, setup.py install, or setup.py develop, all of the dependencies not already installed will be located (via PyPI), downloaded, built (if necessary), and installed.

I can successfully deploy a package but problem is when trying to do setup.py test , it trying to get dependencies from pypi.org not mypypi .

running test
Searching for fancy_super_lib
Reading https://pypi.python.org/simple/fancy_super_lib/
Couldn't find index page for 'fancy_super_lib' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
No local packages or download links found for fancy_super_lib
error: Could not find suitable distribution for Requirement.parse('fancy_super_lib')

How to change this behaviour?

Simply create file ~/.pydistutils.cfg and put this content:

[easy_install]
index_url = http://192.168.100.101:8080/simple

This will use Your Pypi server instead global pypi.org.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM