Skip to content
Search

Devpi

lastmod 2025-02-14created 2020-12-1032 edits

Python PyPi staging server and packaging, testing, release tool.

How to install

Installation including the web interface:

pip install devpi-web
devpi-init --serverdir /data
devpi-server --host 0.0.0.0 --port 8080 --restrict-modify root --serverdir /data

Uploading Sphinx docs

Using plain setup.py for uploading

Authentication and User management

If you started the server with the --restrict-modify root flag, you must log in as the root user and then create an index.

First, install the client:

pip install devpi-client

Select the server to connect to.

devpi use https://pypi.yourdomain.com/

For reference, the output looks like this:

using server: https://pypi.yourdomain.com/ (not logged in)
no current index: type 'devpi use -l' to discover indices
/home/yourid/.pip/pip.conf: no config file exists
~/.pydistutils.cfg     : no config file exists
~/.buildout/default.cfg: no config file exists
always-set-cfg: no

Log in as the root user.

devpi login root

Enter the password.

password for user root at https://pypi.yourdomain.com/:
logged in 'root', credentials valid for 10.00 hours

Create a new user.

devpi user -c serverid

Of course, enter the user's password.

new password for user serverid:
repeat new password for user serverid:
user created: serverid

Then create an index for the new user.

devpi index -c serverid/answer volatile=False

The output looks like this:

https://pypi.yourdomain.com/serverid/answer?no_projects=:
  type=stage
  bases=
  volatile=False
  acl_upload=serverid
  acl_toxresult_upload=:ANONYMOUS:
  mirror_whitelist=

Log out.

devpi logout

The output looks like this:

login information deleted

Creating, configuring and using indices

After selecting the server and index, log in as the root user to create a new index.

devpi index -c servername/answer volatile=True bases=root/pypi
Creates an index for the new user.

Options

volatile=True
If True, destructive operations on the index (such as overriding or deleting packages) are allowed.
bases=root/pypi
Inherits the root/pypi index so the base can be reconfigured.

Quickstart: uploading, testing, pushing releases

Select the server.

devpi use https://pypi.yourdomain.com/

Output of selecting the server:

using server: https://pypi.yourdomain.com/ (not logged in)
no current index: type 'devpi use -l' to discover indices
/home/yourid/.pip/pip.conf: no config file exists
~/.pydistutils.cfg     : no config file exists
~/.buildout/default.cfg: no config file exists
always-set-cfg: no

Select the index.

devpi use serverid/answer

Output of the selection:

current devpi index: https://pypi.yourdomain.com/serverid/answer (not logged in)
supported features: server-keyvalue-parsing
/home/yourid/.pip/pip.conf: no config file exists
~/.pydistutils.cfg     : no config file exists
~/.buildout/default.cfg: no config file exists
always-set-cfg: no

Log in.

devpi login serverid

Login output:

password for user serverid at https://pypi.yourdomain.com/:
logged in 'serverid' at 'https://pypi.yourdomain.com/serverid/answer', credentials valid for 10.00 hours

Move to the folder containing setup.py and you can upload. (Adding the --with-docs option also uploads the documentation.</code>

devpi upload --with-docs

Upload output:

using workdir /tmp/devpi4
copied repo /home/yourid/Project/recc/.git to /tmp/devpi4/upload/recc/.git
pre-build: cleaning /home/yourid/Project/recc/core/dist
-->  /tmp/devpi4/upload/recc/core$ /home/yourid/.pyenv/versions/opy-yourid-3.7.7/bin/python setup.py sdist --formats gztar
warning: sdist: standard file not found: should have one of README, README.rst, README.txt, README.md

built: /home/yourid/Project/recc/core/dist/recc-2.0.0.tar.gz [SDIST.TGZ] 2.088kb
-->  /tmp/devpi4/upload/recc/core$ /home/yourid/.pyenv/versions/opy-yourid-3.7.7/bin/python setup.py build_sphinx -E --build-dir /tmp/devpi4/upload/recc/core/build
built: /home/yourid/Project/recc/core/dist/recc-2.0.0.doc.zip [sphinx docs] 14030.88kb
register recc-2.0.0 to https://pypi.yourdomain.com/serverid/answer/
file_upload of recc-2.0.0.tar.gz to https://pypi.yourdomain.com/serverid/answer/
doc_upload of recc-2.0.0.doc.zip to https://pypi.yourdomain.com/serverid/answer/

Then log out.

devpi logout

The uploaded package can be installed as follows.

pip install -i https://pypi.yourdomain.com/serverid/answer recc

wheel upload

Try to use the devpi upload with the --formats option set to bdist_wheel:

devpi upload --formats bdist_wheel

Troubleshooting

If the website theme is not applied properly

If you used the --outside-url option, check that the address was given in a form like https://test.site.com.

Conflicting dependencies

Packages are downloaded from the new server as follows:

pip install -i https://pypi.yourdomain.com/serverid/answer recc

However, an error saying that packages specified as dependencies cannot be installed may be printed.

Looking in indexes: https://pypi.yourdomain.com/serverid/answer
Collecting recc
  Using cached https://pypi.yourdomain.com/serverid/answer/%2Bf/73f/5adddc6aaaf1c/recc-2.0.1.tar.gz (2.1 kB)
  Using cached https://pypi.yourdomain.com/serverid/answer/%2Bf/1f0/8f923ef2bdbe1/recc-2.0.0.tar.gz (2.1 kB)
ERROR: Cannot install recc==2.0.0 and recc==2.0.1 because these package versions have conflicting dependencies.

The conflict is caused by:
    recc 2.0.1 depends on docker>=4.4.0
    recc 2.0.0 depends on docker>=4.4.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

In this case, you must use an index that mirrors the main PyPi server as the base. (Usually root/pypi is such an index after the initial setup):

devpi index -c serverid/answer volatile=True bases=root/pypi

See also

Favorite site

author Zer0 sitemap