-
Notifications
You must be signed in to change notification settings - Fork 72
148 lines (129 loc) · 4.05 KB
/
ci.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: tests
on:
push:
branches:
- "*"
pull_request:
branches:
- master
workflow_dispatch:
defaults:
run:
shell: bash -l {0}
concurrency:
group: "${{ github.ref }}-${{ github.head_ref }}"
cancel-in-progress: true
jobs:
tests:
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
# only run once if internal PR
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
include:
- label: earliest
os: ubuntu-latest
python-version: 3.8
rdkit-version: "rdkit=2021.03.1"
coverage: false
- label: baseline
os: ubuntu-latest
python-version: "3.10"
rdkit-version: "rdkit~=2022.09"
coverage: true
- label: latest
os: ubuntu-latest
python-version: "3.12"
rdkit-version: "rdkit"
coverage: false
steps:
- uses: actions/checkout@v4
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
channel-priority: flexible
channels: conda-forge, defaults
add-pip-as-python-dependency: true
architecture: x64
use-mamba: true
miniforge-variant: Mambaforge
- name: Check conda and pip
run: |
which python
python --version
pip --version
conda --version
mamba --version
- name: Install conda dependencies
run: |
mamba install ${{ matrix.rdkit-version }}
mamba list
- name: Install package through pip
run: |
pip install .[dev]
pip list
- name: Build
run: |
python -m build
- name: Ensure tests and data included in source dist
run: |
tar -ztvf dist/prolif-*.tar.gz | grep -E 'prolif-.+/tests/.+' || exit 1
tar -ztvf dist/prolif-*.tar.gz | grep -E 'prolif-.+/data/.+' || exit 1
tar -ztvf dist/prolif-*.tar.gz | grep -E 'prolif-.+/data/vina/.+' || exit 1
- name: Run tests
run: |
pytest --color=yes --disable-pytest-warnings --cov=prolif --cov-report=xml tests/
- name: Measure tests coverage
if: matrix.coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Build
run: |
python -m build
- name: Remove previous ProLIF install
run: |
pip uninstall -y prolif
- name: Install from tar.gz
run: |
pip install dist/prolif-*.tar.gz
- name: Test tar.gz install
working-directory: /
run: |
python <<EOF
from pathlib import Path
from contextlib import suppress
import prolif
print(prolif.__version__)
from prolif.plotting.network import LigNetwork
assert Path(prolif.datafiles.TOP).is_file()
with suppress(ImportError, ModuleNotFoundError):
import tests
assert next(Path(tests.__file__).parent.glob("test_fingerprint.py"), None) is None
EOF
- name: Remove previous ProLIF install
run: |
pip uninstall -y prolif
- name: Install from wheel
run: |
pip install dist/prolif-*.whl
- name: Test wheel install
working-directory: /
run: |
python <<EOF
from pathlib import Path
from contextlib import suppress
import prolif
print(prolif.__version__)
from prolif.plotting.network import LigNetwork
assert Path(prolif.datafiles.TOP).is_file()
with suppress(ImportError, ModuleNotFoundError):
import tests
assert next(Path(tests.__file__).parent.glob("test_fingerprint.py"), None) is None
EOF