Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/networktocode/gh-action-setup-poetry-environment
The repo contains the GitHub action to setup the poetry environment
https://github.com/networktocode/gh-action-setup-poetry-environment
Last synced: about 2 months ago
JSON representation
The repo contains the GitHub action to setup the poetry environment
- Host: GitHub
- URL: https://github.com/networktocode/gh-action-setup-poetry-environment
- Owner: networktocode
- Created: 2021-09-17T08:08:43.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-16T04:36:12.000Z (8 months ago)
- Last Synced: 2024-10-14T19:34:04.992Z (2 months ago)
- Size: 10.7 KB
- Stars: 0
- Watchers: 9
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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`