-
Notifications
You must be signed in to change notification settings - Fork 92
138 lines (116 loc) · 4.71 KB
/
conda.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
name: Conda latest
on:
release:
types:
- released
- prereleased
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
defaults:
run:
shell: bash -l {0}
jobs:
test:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}, OpenEye=${{ matrix.openeye }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-12]
python-version: ["3.10"]
openeye: ["true", "false"]
env:
CI_OS: ${{ matrix.os }}
OPENEYE: ${{ matrix.openeye }}
PYVER: ${{ matrix.python-version }}
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
PACKAGE: openff-toolkit
steps:
- uses: actions/checkout@v4
- name: Vanilla install from conda
uses: mamba-org/setup-micromamba@v1
if: ${{ matrix.openeye == 'false' }}
with:
environment-file: devtools/conda-envs/conda.yaml
create-args: >-
python=${{ matrix.python-version }}
# default - will pull down 2.0 which we don't want!
# micromamba-version: latest
# pin to latest 1.x release
micromamba-version: "1.5.10-0"
- name: Install from conda with OpenEye
uses: mamba-org/setup-micromamba@v1
if: ${{ matrix.openeye == 'true' }}
with:
environment-file: devtools/conda-envs/conda_oe.yaml
create-args: >-
python=${{ matrix.python-version }}
# default - will pull down 2.0 which we don't want!
# micromamba-version: latest
# pin to latest 1.x release
micromamba-version: "1.5.10-0"
- name: Additional info about the build
run: |
uname -a
df -h
ulimit -a
- name: Make oe_license.txt file from GH org secret "OE_LICENSE"
env:
OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }}
run: |
echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE}
- name: Environment Information
run: |
conda info
conda list
- name: Check installed toolkits
run: |
# Checkout the state of the repo as of the last release (including RCs)
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openff-toolkit.git | cut -f2 | grep -E "([0-9]+)\.([0-9]+)\.([0-9]+)$" | sort --version-sort | tail -1 | sed 's/refs\/tags\///')
git fetch --tags
git checkout tags/$LATEST_TAG
git log -1 | cat
if [[ "$OPENEYE" == true ]]; then
python -c "from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE; assert OPENEYE_AVAILABLE, 'OpenEye unavailable'"
fi
if [[ "$OPENEYE" == false ]]; then
if [[ $(conda list | grep openeye-toolkits) ]]; then
micromamba remove --force openeye-toolkits --yes
fi
python -c "from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE; assert not OPENEYE_AVAILABLE, 'OpenEye unexpectedly found'"
fi
- name: Check that correct OFFTK version was installed
run: |
# Go up one directory to ensure that we don't just load the OFFTK from the checked-out repo
cd ../
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openff-toolkit.git | cut -f2 | grep -E "([0-9]+)\.([0-9]+)\.([0-9]+)$" | sort --version-sort | tail -1 | sed 's/refs\/tags\///')
export FOUND_VER=$(python -c "import openff.toolkit; print(openff.toolkit.__version__)")
echo "Latest tag is"
echo $LATEST_TAG
echo "Found version is"
echo $FOUND_VER
if [[ $LATEST_TAG != $FOUND_VER ]];
then echo "Version mismatch"
exit 1
fi
cd openff-toolkit
- name: Test the package
run: |
python -m pip install utilities/test_plugins
pwd
ls
if [[ "$OPENEYE" == true ]]; then
python -c "import openff.toolkit; print(openff.toolkit.__file__)"
python -c "import openeye; print(openeye.oechem.OEChemIsLicensed())"
fi
PYTEST_ARGS=" -r fE --tb=short --runslow openff/toolkit/_tests/conftest.py"
PYTEST_ARGS+=" --ignore=openff/toolkit/_tests/test_links.py"
pytest $PYTEST_ARGS openff
- name: Run example scripts
run: |
pytest $PYTEST_ARGS openff/toolkit/_tests/test_examples.py
- name: Run example notebooks
run: |
# External examples are temporarily skipped due to parmed incompatibility https://github.com/openforcefield/openff-toolkit/issues/1532
python -m pytest -r fE -v -x --tb=short --nbval-lax --ignore=examples/deprecated --ignore=examples/external examples