fengmiguoji commited on
Commit
2a6018a
·
verified ·
1 Parent(s): 1823ed6

Upload .github\actions\setup-poetry\action.yml with huggingface_hub

Browse files
.github//actions//setup-poetry//action.yml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Setup Poetry and Python
2
+
3
+ inputs:
4
+ python-version:
5
+ description: Python version to use and the Poetry installed with
6
+ required: true
7
+ default: '3.11'
8
+ poetry-version:
9
+ description: Poetry version to set up
10
+ required: true
11
+ default: '2.0.1'
12
+ poetry-lockfile:
13
+ description: Path to the Poetry lockfile to restore cache from
14
+ required: true
15
+ default: ''
16
+
17
+ runs:
18
+ using: composite
19
+ steps:
20
+ - name: Set up Python ${{ inputs.python-version }}
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: ${{ inputs.python-version }}
24
+ cache: pip
25
+
26
+ - name: Install Poetry
27
+ shell: bash
28
+ run: pip install poetry==${{ inputs.poetry-version }}
29
+
30
+ - name: Restore Poetry cache
31
+ if: ${{ inputs.poetry-lockfile != '' }}
32
+ uses: actions/setup-python@v5
33
+ with:
34
+ python-version: ${{ inputs.python-version }}
35
+ cache: poetry
36
+ cache-dependency-path: ${{ inputs.poetry-lockfile }}