-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathaction.yml
56 lines (49 loc) · 1.76 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: "Install Python and DIANNA"
description: "Installs Python, updates pip and installs DIANNA together with its dependencies."
inputs:
python-version:
required: false
description: "The Python version to use. Specify major and minor version, e.g. '3.10'."
default: "3.10"
extras-require:
required: false
description: "The extras dependencies packages to be installed, for instance 'docs' or 'publishing,notebooks'."
runs:
using: "composite"
steps:
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- uses: actions/cache@v3
id: cache-python-env
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}
- name: Python info
shell: bash {0}
run: |
which python3
python --version
- name: Upgrade pip
if: steps.cache-python-env.outputs.cache-hit != 'true'
shell: bash {0}
run: |
python -m pip install --upgrade pip setuptools wheel
# only necessary on linux to avoid bloated installs
# pining the version of torch is temporary, see see #829
- name: Install tensorflow/pytorch cpu version
if: runner.os == 'Linux' && steps.cache-python-env.outputs.cache-hit != 'true'
shell: bash {0}
run: |
python -m pip install torch==2.3.1 --index-url https://download.pytorch.org/whl/cpu
python -m pip install tensorflow-cpu
- name: Install DIANNA
shell: bash {0}
run: |
python -m pip install -e .[dev]
- name: Install DIANNA extras
if: ${{ inputs.extras-require }}
shell: bash {0}
run: |
python -m pip install -e .[${{ inputs.extras-require }}]