{"id":19197146,"url":"https://github.com/python-poetry/poetry-plugin-bundle","last_synced_at":"2025-04-04T17:07:13.527Z","repository":{"id":37940818,"uuid":"384446914","full_name":"python-poetry/poetry-plugin-bundle","owner":"python-poetry","description":"Poetry plugin to bundle projects into various formats","archived":false,"fork":false,"pushed_at":"2025-03-24T20:15:06.000Z","size":349,"stargazers_count":136,"open_issues_count":21,"forks_count":29,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-28T16:06:45.457Z","etag":null,"topics":["poetry","poetry-plugin","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/python-poetry.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-09T13:34:11.000Z","updated_at":"2025-03-13T07:51:28.000Z","dependencies_parsed_at":"2023-11-13T12:29:46.827Z","dependency_job_id":"9f0ccd2f-dc48-465d-a884-e881fe9f1d4f","html_url":"https://github.com/python-poetry/poetry-plugin-bundle","commit_stats":{"total_commits":84,"total_committers":13,"mean_commits":6.461538461538462,"dds":0.5238095238095238,"last_synced_commit":"6a55c187990b2d544714f3eef4e1e7eec346f1b8"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-poetry%2Fpoetry-plugin-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-poetry%2Fpoetry-plugin-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-poetry%2Fpoetry-plugin-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-poetry%2Fpoetry-plugin-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/python-poetry","download_url":"https://codeload.github.com/python-poetry/poetry-plugin-bundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217180,"owners_count":20903009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["poetry","poetry-plugin","python"],"created_at":"2024-11-09T12:15:40.264Z","updated_at":"2025-04-04T17:07:13.510Z","avatar_url":"https://github.com/python-poetry.png","language":"Python","readme":"# Poetry Plugin: Bundle\n\n[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)\n\nThis package is a plugin that allows the bundling of Poetry projects into various formats.\n\n## Installation\n\nThe easiest way to install the `bundle` plugin is via the `self add` command of Poetry.\n\n```bash\npoetry self add poetry-plugin-bundle\n```\n\nIf you used `pipx` to install Poetry you can add the plugin via the `pipx inject` command.\n\n```bash\npipx inject poetry poetry-plugin-bundle\n```\n\nOtherwise, if you used `pip` to install Poetry you can add the plugin packages via the `pip install` command.\n\n```bash\npip install poetry-plugin-bundle\n```\n\n## Usage\n\nThe plugin introduces a `bundle` command namespace that regroups commands to bundle the current project\nand its dependencies into various formats. These commands are particularly useful to deploy\nPoetry-managed applications.\n\n### bundle venv\n\nThe `bundle venv` command bundles the project and its dependencies into a virtual environment.\n\nThe following command\n\n```bash\npoetry bundle venv /path/to/environment\n```\n\nwill bundle the project in the `/path/to/environment` directory by creating the virtual environment,\ninstalling the dependencies and the current project inside it. If the directory does not exist,\nit will be created automatically.\n\nBy default, the command uses the same Python executable that Poetry would use\nwhen running `poetry install` to build the virtual environment.\nIf you want to use a different one, you can specify it with the `--python/-p` option:\n\n```bash\npoetry bundle venv /path/to/environment --python /full/path/to/python\npoetry bundle venv /path/to/environment -p python3.8\npoetry bundle venv /path/to/environment -p 3.8\n```\n\n**Note**\n\nIf the virtual environment already exists, two things can happen:\n\n- **The python version of the virtual environment is the same as the main one**: the dependencies will be synced (updated or removed).\n- **The python version of the virtual environment is different**: the virtual environment will be recreated from scratch.\n\nYou can also ensure that the virtual environment is recreated by using the `--clear` option:\n\n```bash\npoetry bundle venv /path/to/environment --clear\n```\n\n#### --platform option (Experimental)\nThis option allows you to specify a target platform for binary wheel selection, allowing you to install wheels for\narchitectures/platforms other than the host system.\n\nThe primary use case is in CI/CD operations to produce a deployable asset, such as a ZIP file for AWS Lambda and other\nsuch cloud providers. It is common for the runtimes of these target environments to be different enough from the CI/CD's\nrunner host such that the binary wheels selected using the host's criteria are not compatible with the target system's.\n\n#### Supported platform values\nThe `--platform` option requires a value that conforms to the [Python Packaging Platform Tag format](\nhttps://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#platform-tag). Only the following\n\"families\" are supported at this time:\n- `manylinux`\n- `musllinux`\n- `macosx`\n\n#### Examples of valid platform tags\nThis is not a comprehensive list, but illustrates typical examples.\n\n`manylinux_2_28_x86_64`, `manylinux1_x86_64`, `manylinux2010_x86_64`, `manylinux2014_x86_64`\n\n`musllinux_1_2_x86_64`\n\n`macosx_10_9_x86_64`, `macosx_10_9_intel`, `macosx_11_1_universal2`, `macosx_11_0_arm64`\n\n#### Example use case for AWS Lambda\nAs an example of one motivating use case for this option, consider the AWS Lambda \"serverless\" execution environment.\nDepending upon which Python version you configure for your runtime, you may get different versions of the Linux system\nruntime.  When dealing with pre-compiled binary wheels, these runtime differences can matter.  If a shared library from\na wheel is packaged in your deployment artifact that is incompatible with the runtime provided environment, then your\nPython \"function\" will error at execution time in the serverless environment.\nThe issue arises when the build system that is producing the deployment artifact has a materially different platform\nfrom the selected serverless Lambda runtime.\n\nFor example, the Python 3.11 Lambda runtime is Amazon Linux 2, which includes the Glibc 2.26 library.  If a Python\napplication is packaged and deployed in this environment that contains wheels built for a more recent version of Glibc,\nthen a runtime error will result.  This is likely to occur even if the build system is the same CPU architecture\n(e.g. x86_64) and core platform (e.g. Linux) and there is a package dependency that provides multiple precompiled\nwheels for various Glibc (or other system library) versions.  The \"best\" wheel in the context of the build system can\ndiffer from that of the target execution environment.\n\n\n#### Limitations\n**This is not an actual cross-compiler**.  Nor is it a containerized compilation/build environment. It simply allows\ncontrolling which **prebuilt** binaries are selected.  It is not a replacement for cross-compilation or containerized\nbuilds for use cases requiring that.\n\nIf there is not a binary wheel distribution compatible with the specified platform, then the package's source\ndistribution is selected.  If there are compile/build steps for \"extensions\" that need to run for the source\ndistribution, then these operations will execute in the context of the host CI/build system.\n**This means that the `--platform` option\nhas no impact on any extension compile/build operations that must occur during package installation.**\nThis feature is only for\n**selecting** prebuilt wheels, and **not for compiling** them from source.\n\nArguably, in a vast number of use cases, prebuilt wheel binaries are available for your packages and simply selecting\nthem based on a platform other than the host CI/build system is much faster and simpler than heavier build-from-source\nalternatives.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-poetry%2Fpoetry-plugin-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython-poetry%2Fpoetry-plugin-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-poetry%2Fpoetry-plugin-bundle/lists"}