-
Notifications
You must be signed in to change notification settings - Fork 32
107 lines (100 loc) · 3.44 KB
/
pythonpackage.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: pytest
on:
push:
pull_request:
types: [opened, edited, review_requested, synchronize, reopened]
jobs:
conda-build:
timeout-minutes: 70
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7]
steps:
- uses: actions/checkout@v1
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: capreolus
environment-file: environment.yml
auto-activate-base: false
- name: Test with pytest
shell: bash -l {0}
run: |
conda activate capreolus
# delete conda cache to avoid "No space left on device" Exception
conda list
conda clean --all
conda install pytorch=1.8.1 torchvision cpuonly -c pytorch
conda list
# hack to force h5py version. 3.0 is not compatible with TF.
pip install h5py==2.10.0
# checks every test except those marked download
pytest -vvv
pip-build:
timeout-minutes: 50
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Set up Java 11
uses: actions/setup-java@v1
with:
java-version: '11'
- name: black
uses: lgeiger/black-action@master
with:
args: ". --check --config capreolus/pyproject.toml"
- name: Install dependencies
run: |
python -m pip install --upgrade pip==21.1.3
# cython should be installed seperately due to a pip bug. For some reason, it tries to build pyjnius before building cython
pip install cython
pip install -r requirements.txt
pip install torch==1.8.1+cu101 torchvision==0.9.1+cu101 -f https://download.pytorch.org/whl/torch_stable.html
- name: Test with pytest
run: |
pip install pytest
export PYTHONPATH=${PYTHONPATH}:/home/runner/work/capreolus/capreolus/
# checks every test except those marked download
python -m pytest -vvv
# download:
# timeout-minutes: 50
# if: github.ref == 'refs/heads/master'
# runs-on: ubuntu-latest
# strategy:
# max-parallel: 4
# matrix:
# python-version: [3.7]
# steps:
# - uses: actions/checkout@v1
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v1
# with:
# python-version: ${{ matrix.python-version }}
# - name: Set up Java 11
# uses: actions/setup-java@v1
# with:
# java-version: '11'
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# # cython should be installed seperately due to a pip bug. For some reason, it tries to build pyjnius before building cython
# pip install cython
# pip install -r requirements.txt
# pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
# - name: Test downloads with pytest
# run: |
# pip install pytest
# export PYTHONPATH=${PYTHONPATH}:/home/runner/work/capreolus/capreolus/
# # checks only tests marked download
# python -m pytest -vvv -m download