{"id":3212,"library":"plaster-pastedeploy","title":"plaster-pastedeploy Registry Entry","description":"Plaster-pastedeploy provides a `plaster` loader that understands `PasteDeploy` configuration files, primarily used for loading WSGI applications and server configurations from INI-style files. It is currently at version 1.0.1. Its release cadence is generally stable and aligns with major `plaster` and `PasteDeploy` releases.","status":"active","version":"1.0.1","language":"en","source_language":"en","source_url":"https://github.com/Pylons/plaster_pastedeploy","tags":["web","wsgi","paste","plaster","config","pylons"],"install":[{"cmd":"pip install plaster-pastedeploy","lang":"bash","label":"Install plaster-pastedeploy"}],"dependencies":[{"reason":"Provides the base configuration loading interface; plaster-pastedeploy registers itself as a loader for plaster.","package":"plaster","optional":false},{"reason":"Provides the underlying configuration parsing logic for PasteDeploy-style files.","package":"PasteDeploy","optional":false}],"imports":[{"note":"Importing the package registers its PasteDeploy loader with the plaster ecosystem.","symbol":"plaster_pastedeploy","correct":"import plaster_pastedeploy"},{"note":"The primary way to use plaster-pastedeploy's functionality is through plaster's parse_uri after importing plaster_pastedeploy.","symbol":"parse_uri","correct":"from plaster import parse_uri"}],"quickstart":{"code":"import os\nimport plaster\nimport plaster_pastedeploy # This registers the PasteDeploy loader\n\n# Create a dummy PasteDeploy-style config file\nconfig_content = \"\"\"\n[app:main]\nuse = egg:webtest_app#main\n\n[server:main]\nuse = egg:waitress#main\nhost = 127.0.0.1\nport = 8080\n\"\"\"\nconfig_path = \"development.ini\"\nwith open(config_path, \"w\") as f:\n    f.write(config_content)\n\n# Parse the URI using plaster (which now knows about PasteDeploy thanks to plaster_pastedeploy)\n# Note: webtest_app and waitress would need to be installed for a real application.\ntry:\n    loader = plaster.parse_uri(f\"config:{config_path}\")\n    print(f\"Successfully parsed configuration using loader: {type(loader).__name__}\")\n\n    # Example: Get a WSGI application\n    app = loader.get_wsgi_app(\"main\")\n    print(f\"WSGI App loaded: {app}\")\n\n    # Example: Get a WSGI server factory\n    server_factory = loader.get_wsgi_server(\"main\")\n    print(f\"WSGI Server factory loaded: {server_factory}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\nfinally:\n    # Clean up the dummy config file\n    if os.path.exists(config_path):\n        os.remove(config_path)","lang":"python","description":"This quickstart demonstrates how to use `plaster-pastedeploy` to load a WSGI application and server configuration from a `PasteDeploy`-style `.ini` file using the `plaster` API. Importing `plaster_pastedeploy` ensures that `plaster` can correctly parse URIs starting with `config:` that point to `PasteDeploy` configurations. For this example to fully run without errors regarding egg specs, `webtest-app` and `waitress` would need to be installed."},"warnings":[{"fix":"Ensure `import plaster_pastedeploy` is placed at the top of your module or prior to any `plaster.parse_uri` calls.","message":"For plaster-pastedeploy's loader to be available to `plaster.parse_uri`, `import plaster_pastedeploy` must be executed *before* `plaster.parse_uri` is called. This ensures the entry points are loaded and the PasteDeploy loader is registered.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure all packages referenced in your `use = egg:spec` directives within the .ini file are installed in your environment (e.g., `pip install webtest-app waitress`).","message":"PasteDeploy configurations often use `egg:package#factory` syntax for specifying applications and servers. These rely on `setuptools` entry points and the referenced packages being installed in your Python environment. If packages like `webtest-app` or `waitress` (common in examples) are not installed, `plaster-pastedeploy` will raise `DistributionNotFound` or similar errors during configuration loading.","severity":"gotcha","affected_versions":"All versions"},{"fix":"When upgrading, ensure both `plaster` and `plaster-pastedeploy` are at compatible 1.x versions (e.g., `pip install 'plaster>=1.0' 'plaster-pastedeploy>=1.0'`). Review `plaster`'s migration guide if moving from 0.x.","message":"`plaster-pastedeploy` v1.x is designed to work with `plaster` v1.x. `plaster` itself introduced significant breaking changes between its 0.x and 1.x versions (e.g., `plaster.PlasterLoader` was removed). Attempting to use `plaster-pastedeploy` 1.x with `plaster` 0.x, or an older `plaster-pastedeploy` with `plaster` 1.x, will lead to API incompatibilities and runtime errors.","severity":"breaking","affected_versions":"Migration from plaster < 1.0 to plaster >= 1.0 (and corresponding plaster-pastedeploy versions)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}