Giter VIP home page Giter VIP logo

gh-action-setup-poetry-environment's Introduction

GitHub Action to Setup The Poetry Environment

This action can be used to set up the Poetry Environment. The action tries to load the environment from the cache. If the cache does not exist, the fresh environment is installed and saved to the cache.

The following key syntax is used to check if the cache exists:

key: "${{ runner.os }}-poetry-${{ steps.python-setup.outputs.python-version }}-${{ hashFiles('./poetry.lock') }}${{ inputs.cache-version }}"
  • Typically, the value of the first variable is Linux
  • The second variable contains the python version. The value 3.9.7 is the example that can be used.
  • The third variable calculates the hash of the poetry.lock file. If the poetry.lock is updated, then the hash is different, which means that the key is different.
  • The last variable is the value of the input variable.

The following is the example of the key:

Linux-poetry-3.9.7-3c5d9aa2fd2aec48fd6a7de22cde35e3d3193e2141961270823edbdf12c104ed

If the key is changed, then this action invalidates the cache and creates a new environment. The new environment is then saved to the cache.

Input variables

  • python-version: Defines the python version which will be deployed on the system. Example values are: 3.6, 3.7, 3.8, 3.9. Defaults to 3.9.
  • cache-version: Can be used to specify the different version of the cache. This string is appended to the key. Defaults to empty string.
  • poetry-install-options: Specifies any additional options pass to Poetry when installing dependencies. Defaults to --only dev.

Output variables

  • cache-used: Returns True if the environment was loaded from the cache, or empty string if the fresh environment is installed.
  • python-version: Returns the exact version installed. For example: 3.6.15, 3.7.12, 3.8.12, 3.9.7

gh-action-setup-poetry-environment's People

Contributors

mattmiller87 avatar nniehoff avatar ubajze avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gh-action-setup-poetry-environment's Issues

Error with `Windows-latest`

There is a problem in the pipeline related to windows-latest. It stops in Run ln -s /root/.local/bin/poetry /usr/local/bin/poetry. The problem it has is the following: ln: failed to create symbolic link '/usr/local/bin/poetry': No such file or directory.

Error using `act`

Hi!

I'm using this github action for a network automation project called fakenos. I really the cool projects and style you have in NetworkToCode, so I'm to implement some of the workflows into the projects i work on.

I have found an issue related to act, that it's a project for testing in local the github actions workflows. Specifically there is an issue related to actions/setup-python@v5 link. I've found this doc talking about it specifically. Is it possible to add some sort of if condition to be able to run test the pipeline using act?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.