Testing a TestPyPI package with dependencies

Akkana Peck akkana at shallowsky.com
Mon Dec 9 20:34:19 EST 2019


I'm a novice packager, trying to test a package I built and
uploaded to TestPyPI. It has dependencies and I want to make
sure my setup.py works before uploading to the real PyPI.

https://packaging.python.org/guides/using-testpypi/
says that if a package has dependencies, to use this command to get
the package from TestPyPI while getting dependencies from PyPI:

pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple your-package

That doesn't seem to work, though. It seems like it never checks
pypi.org and looks for everything in test.pypi.org. Here's what I'm
doing, starting from a new virtualenv:

......
    $ python3 -m venv /tmp/test3env

    $ source /tmp/test3env/bin/activate

    (test3env) $ pip install wheel
    Collecting wheel
      Using cached https://files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.whl
    Installing collected packages: wheel
    Successfully installed wheel-0.33.6

    (test3env) $ pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pytopo==1.6.1
    Looking in indexes: https://test.pypi.org/simple/, https://pypi.org/simple
    Collecting pytopo
      Using cached https://test-files.pythonhosted.org/packages/1d/dd/f46722bed2296676053b333a97babf05cb31b20e4a621161d44399a3ed18/pytopo-1.6.1-py3-none-any.whl
    Collecting simplejson (from pytopo)
    Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://test.pypi.org/simple/simplejson/
......

I can pip install simplejson without errors, so I know it's in PyPI.
(If I then try the install again, it fails on pycairo, same error.)

Am I misunderstanding that packaging.python.org guide, or making
some silly typo? Is there a trick it doesn't mention to getting pip
to use both PyPI and TestPyPI?

Thanks for any suggestions!

        ...Akkana


More information about the Python-list mailing list