devpi-client
devpi-client is a command-line tool for managing devpi-server instances, facilitating Python packaging workflows. It enables users to upload, test, and install packages from devpi indexes. As of version 7.2.1, it continues to support essential package management operations and is actively maintained with regular releases, typically used in conjunction with a running devpi-server.
Common errors
-
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised.
cause The `devpi-client` is connecting to an HTTPS `devpi-server` with an untrusted or self-signed certificate, or without proper certificate validation configured.fixEnsure the server's SSL certificate is valid and trusted by your system's CA store. Alternatively, configure `devpi` to trust the host, e.g., `devpi use --set-cfg --url https://your.devpi.server/` which automatically adds `trusted-host` for pip. For self-signed certificates, you might need to manually trust them or pass `--client-cert` if configured on the server. -
devpi-client fails upload from git submodule dirs
cause When uploading packages, `devpi-client` may encounter issues correctly identifying and exporting files within Git submodule directories, leading to failed uploads.fixConsider setting `setupdirs-only = 1` in the `[devpi:upload]` section of `setup.cfg` or using the `devpi upload --setupdir-only` option to ensure only the directory containing `setup.py` is exported. Ensure all necessary files are tracked by Git. -
Error added in 6.0.4 when old authentication data from before 6.x exists.
cause Authentication data schema changes between major versions (e.g., pre-6.x to 6.x and beyond) can cause client-side authentication failures with newer client versions.fixRemove old authentication data (`~/.devpi/client/accounts.json`) and re-login using `devpi login` to generate new, compatible credentials. Ensure both client and server are on compatible versions. -
PermissionError during upload due to trying to copy a folder like a file.
cause An internal issue where `devpi-client` attempts to treat a directory as a file during the upload process, leading to a `PermissionError`.fixThis was a bug fixed in `devpi-client 7.2.0`. Upgrade to `devpi-client` version 7.2.0 or higher. `pip install --upgrade devpi-client`
Warnings
- breaking Support for Python versions prior to 3.7 was dropped in devpi-client 7.0.0. Ensure your environment uses Python 3.7 or newer.
- breaking Devpi-client 7.0.0 removed the dependency on the 'py' package, requiring plugins that expected 'py.path.local' to be adjusted to work with 'pathlib.Path'.
- gotcha When exposing `devpi-server` to the internet, **security is paramount**. Incorrect configuration of authentication/authorization can lead to insecure repositories. Do NOT expose `devpi-server` without fully understanding its security implications.
- gotcha Devpi-common 4.x introduced custom legacy version parsing which is non-PEP 440 compliant after `packaging >= 22.0` removed support. This can potentially affect commands like `devpi remove` when used with specific version ranges.
- deprecated The `devpi quickstart` command was deprecated and removed in older versions (around 2.5.0, 2016). Use explicit `devpi` commands to set up the client.
Install
-
pip install devpi-client
Quickstart
# Assuming devpi-server is running at http://localhost:3141 # Set the devpi client to use the server and create a user export DEVPI_SERVER_URL="http://localhost:3141" export DEVPI_USER="myuser" export DEVPI_PASSWORD="mypassword" # Point client to the server devpi use $DEVPI_SERVER_URL # Create a user (if not exists) devpi user -c $DEVPI_USER password=$DEVPI_PASSWORD # Login to the created user devpi login $DEVPI_USER --password $DEVPI_PASSWORD # Create a new index for uploads devpi index $DEVPI_USER/dev # Switch to using the new index devpi use $DEVPI_SERVER_URL/$DEVPI_USER/dev # Example: Upload a dummy package (requires a setup.py or pyproject.toml in the current directory) # Assuming you have a `dist/mypackage-1.0.0.whl` and `dist/mypackage-1.0.0.tar.gz` # devpi upload --from-dir dist/