{"id":7157,"library":"devpi-common","title":"devpi-common","description":"devpi-common is a utility library providing common functionalities like URL handling, metadata parsing, and archive management. It is primarily used by devpi-server and devpi-client to ensure consistent behavior across the devpi ecosystem. The current version is 4.1.1, with releases often coinciding with major devpi component updates, typically several times a year.","status":"active","version":"4.1.1","language":"en","source_language":"en","source_url":"https://github.com/devpi/devpi/tree/main/devpi-common","tags":["devpi","utility","packaging","pypi","url-handling","metadata","archive"],"install":[{"cmd":"pip install devpi-common","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Provides path manipulation utilities and helpers (e.g., py.path).","package":"py","optional":false},{"reason":"Used for plugin management and hook specifications within devpi_common.plugin.","package":"pluggy","optional":false}],"imports":[{"note":"URL is located in the devpi_common.url submodule, not directly under devpi_common.","wrong":"from devpi_common import URL","symbol":"URL","correct":"from devpi_common.url import URL"},{"symbol":"get_metadata","correct":"from devpi_common.metadata import get_metadata"},{"symbol":"archive_file","correct":"from devpi_common.archive import archive_file"},{"symbol":"Plugin","correct":"from devpi_common.plugin import Plugin"}],"quickstart":{"code":"from devpi_common.url import URL\n\n# Create a URL object\nurl_obj = URL('https://pypi.org/project/devpi-common/4.1.1/')\nprint(f\"Original URL: {url_obj}\")\n\n# Access parts of the URL\nprint(f\"Scheme: {url_obj.scheme}\")\nprint(f\"Netloc: {url_obj.netloc}\")\nprint(f\"Path: {url_obj.path}\")\n\n# Join paths\nnew_url = url_obj.joinpath('../pypi')\nprint(f\"Joined URL: {new_url}\")\n\n# Create a URL from components\ncomposed_url = URL(scheme='http', netloc='localhost:3141', path='/root/pypi/')\nprint(f\"Composed URL: {composed_url}\")\n","lang":"python","description":"This quickstart demonstrates how to use the `devpi_common.url.URL` object for parsing, manipulating, and composing URLs, which is one of the core utilities provided by the library."},"warnings":[{"fix":"Upgrade to Python 3.7 or newer, or pin devpi-common to a version < 4.0.0.","message":"Python 3.6 support was dropped in devpi-common 4.0.0. Users on Python 3.6 must use an older version.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Always install devpi-common at the same time or with the same version constraints as devpi-server and devpi-client, or ensure they are from the same release train. For example, `pip install devpi-server devpi-client devpi-common`.","message":"It is crucial to keep devpi-common's version aligned with devpi-server and devpi-client versions. Mismatched versions can lead to unexpected behavior or errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Access specific parts of the URL using its attributes like `.path`, `.parts`, or methods like `.joinpath()`. To get path segments, use `url_obj.parts`.","message":"The `URL` object from `devpi_common.url` is not directly iterable. Attempting to iterate over it (e.g., in a `for` loop expecting path segments) will raise a `TypeError`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Change the import statement to `from devpi_common.url import URL`.","cause":"Attempting to import the `URL` class directly from the `devpi_common` package instead of its specific submodule.","error":"AttributeError: module 'devpi_common' has no attribute 'URL'"},{"fix":"Use `url_obj.parts` to get a tuple of path segments if iteration is required, or access specific path components via attributes/methods.","cause":"Trying to iterate over a `devpi_common.url.URL` object directly, often when expecting it to behave like a list of path segments.","error":"TypeError: 'URL' object is not iterable"},{"fix":"Reinstall `devpi-server` (or `devpi-client`) and `devpi-common` together to ensure compatible versions are installed, e.g., `pip install --upgrade devpi-server devpi-client devpi-common`.","cause":"devpi-server (or devpi-client) was installed with a different version of devpi-common than it expects, leading to runtime incompatibility.","error":"Failed to load devpi-server: Incompatible devpi-common version X.Y.Z (expected W.X.Y)"}]}