{"id":28326169,"url":"https://github.com/packetcoders/action-setup-cache-python-poetry","last_synced_at":"2025-10-30T10:33:43.152Z","repository":{"id":61994871,"uuid":"555391532","full_name":"packetcoders/action-setup-cache-python-poetry","owner":"packetcoders","description":"GitHub Action for Python Poetry setup and also the caching of dependencies and the Poetry binary.","archived":false,"fork":false,"pushed_at":"2024-02-29T17:38:44.000Z","size":17,"stargazers_count":15,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-14T16:53:25.950Z","etag":null,"topics":["github","github-actions","poetry","python"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/packetcoders.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-10-21T13:41:26.000Z","updated_at":"2025-05-06T06:15:36.000Z","dependencies_parsed_at":"2024-02-29T18:49:43.972Z","dependency_job_id":null,"html_url":"https://github.com/packetcoders/action-setup-cache-python-poetry","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/packetcoders/action-setup-cache-python-poetry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packetcoders%2Faction-setup-cache-python-poetry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packetcoders%2Faction-setup-cache-python-poetry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packetcoders%2Faction-setup-cache-python-poetry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packetcoders%2Faction-setup-cache-python-poetry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/packetcoders","download_url":"https://codeload.github.com/packetcoders/action-setup-cache-python-poetry/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packetcoders%2Faction-setup-cache-python-poetry/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261063128,"owners_count":23104546,"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":["github","github-actions","poetry","python"],"created_at":"2025-05-25T22:11:02.647Z","updated_at":"2025-10-30T10:33:43.137Z","avatar_url":"https://github.com/packetcoders.png","language":null,"readme":"# GitHub Action - Setup and Cache Python Poetry\n\nThis action simplifies the setup and caching of Poetry, and provides the following functionality for GitHub Actions users:\n* Python setup via [`actions/setup-python`](https://github.com/actions/setup-python).\n* Poetry install via [`snok/install-poetry`](https://github.com/snok/install-poetry).\n* Poetry binary caching via [`actions/cache`](https://github.com/actions/cache).\n* Poetry dependency caching via [`actions/cache`](https://github.com/actions/cache).\n\n## Basic Usage\n\n**Note:** \n* We assume you already have `pyproject.toml`, `poetry.lock` and a test module created for `pytest` to run this workflow example.\n* For your first `push` to `main`, the workflow will download Poetry and the required project dependencies, then save it to the cache.\n* For your second run (whether it's on a different job, re-run the job or a different workflow [based on your first cached commit](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache)) this Action will use the cache.\n* You can see list of cache entries by going to: `Your Repo` -\u003e `Actions` tab -\u003e `Caches` under `Managements` (left navbar, at the bottom). \n\n[Don't forget the limitation of cache](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy).\n\n```yml\nname: ci\n\non:\n  # Triggers the workflow on push but only for the main branch\n  push:\n    branches: [ main ]\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      #-------------------------------------#\n      #  Check out repo and set up Python   #\n      #-------------------------------------#\n      - name: Check out the repository\n        uses: actions/checkout@v3\n      - name: \"Setup Python, Poetry and Dependencies\"\n        uses: packetcoders/action-setup-cache-python-poetry@main\n        with:\n          python-version: 3.8\n          poetry-version: 1.2.2\n\n      #------------------------#\n      #  Run your actual job   #\n      #------------------------#\n      - name: Run tests\n        run: |\n          poetry run pytest\n```\n\n## [Matrix Strategy](https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs) Usage\n\nWith a matrix strategy, several \"workflows\" are generated based on your matrix inputs. In this case, multiple caches for each of the matrix workflows will be generated.\n\n```yml\nname: ci\n\non:\n  # Triggers the workflow on push but only for the main branch\n  push:\n    branches: [ main ]\n\njobs:\n  test:\n    # Using matrix strategy\n    strategy:\n      matrix:\n        python-version: [3.8, 3.9, 3.10]\n        poetry-version: [1.2.2]\n    runs-on: ubuntu-latest\n    steps:\n      #------------------------------------#\n      #  Check out repo and set up Python  #\n      #------------------------------------#\n      - name: Check out the repository\n        uses: actions/checkout@v3\n      - name: \"Setup Python, Poetry and Dependencies\"\n        uses: packetcoders/action-setup-cache-python-poetry@main\n        with:\n          python-version: ${{matrix.python-version}}\n          poetry-version: ${{matrix.poetry-version}}\n\n      #-----------------------#\n      #  Run your actual job  #\n      #-----------------------#\n      - name: Run tests\n        run: |\n          poetry run pytest\n```\n\n## Advanced usage\n\n### Passing extra arguments to `poetry install`\n\nBy default the action will install your dendencies with `poetry install --no-interaction --no-root` You can specify extra arguments with `install-args`, e.g.\n\n```yml\n      - name: \"Setup Python, Poetry and Dependencies\"\n        uses: packetcoders/action-setup-cache-python-poetry@main\n        with:\n          python-version: \"3.12\"\n          poetry-version: \"1.6.1\"\n          install-args: --all-extras\n```\nto install any optional dependencies alongside the required ones.\n\n## License\n\nThe scripts and documentation in this project are released under the [MIT License](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacketcoders%2Faction-setup-cache-python-poetry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpacketcoders%2Faction-setup-cache-python-poetry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacketcoders%2Faction-setup-cache-python-poetry/lists"}