Skip to content

threeal/setup-poetry-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup Poetry Action

The Setup Poetry Action is a GitHub Action designed to streamline the setup of Poetry, a powerful dependency and packaging manager for Python projects. This action allows you to easily configure and use a specific version of Poetry within your GitHub Actions workflow, enabling you to build and test your Python project seamlessly.

Key Features

The Setup Poetry Action offers the following key features:

  • Easy Setup: Quickly make Poetry available in your GitHub Actions workflow.
  • Version Flexibility: Specify the desired version of Poetry for your project.
  • Caching Support: Speed up the Poetry setup process with caching for improved efficiency.

Usage

To get started with the Setup Poetry Action, you can refer to the action.yml file for detailed configuration options. Additionally, if you are new to GitHub Actions, you can explore the GitHub Actions guide for a comprehensive overview.

Inputs

Here are the available input parameters for the Setup Poetry Action:

Name Type Default Description
version Version number or latest latest Specify the version of Poetry to be set up using this action. You can refer to the Poetry release history for information about the available versions for setup.
cache true or false true Indicates whether to use caching during Poetry installation.

Examples

Here is the basic example of how to use the Setup Poetry Action to set up Poetry for installing the dependencies of a Python project in your GitHub Actions workflow:

name: Python CI
on:
  push:
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/[email protected]

      - name: Setup Poetry
        uses: threeal/[email protected]

      - name: Install dependencies
        run: poetry install

      # Add more steps as needed for your workflow

Specifying Poetry Version

You can specify the Poetry version to be used by providing it as an input parameter:

- name: Setup Poetry
  uses: threeal/[email protected]
  with:
    version: 1.5.1

Combining with Setup Python Action

To set both the Python and Poetry versions, you can combine the Setup Poetry Action with the Setup Python action:

- name: Setup Python
  uses: actions/[email protected]
  with:
    python-version: 3.11

- name: Setup Poetry
  uses: threeal/[email protected]
  with:
    version: 1.5.1

Disable Caching

By default, caching is enabled. To disable caching, set the cache input parameter to false as shown below:

- name: Setup Poetry without caching
  uses: threeal/[email protected]
  with:
    cache: false

License

This project is licensed under the terms of the MIT License.

Copyright © 2023-2024 Alfi Maulana