forked from conda/conda
-
Notifications
You must be signed in to change notification settings - Fork 1
/
circle.yml
221 lines (204 loc) · 8.76 KB
/
circle.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# The Docker images used here are
# - condatest/linux-64-python-3.6 [https://github.com/conda/conda-docker/blob/master/condatest/linux-64-python3.6/Dockerfile]
# - condatest/linux-64-python-2.7 [https://github.com/conda/conda-docker/blob/master/condatest/linux-64-python2.7/Dockerfile]
defaults: &defaults
working_directory: ~/conda
docker:
- image: condatest/linux-64-python-3.6
# Dockerfile at https://github.com/conda/conda-docker/blob/master/condatest/linux-64-python3.6/Dockerfile
remove_conda: &remove_conda
name: remove conda
command: |
prefix=/opt/conda
BIN_DIR=bin
PYTHON_EXE="$prefix/$BIN_DIR/python"
site_packages=$($PYTHON_EXE -c "from distutils.sysconfig import get_python_lib as g; print(g())")
sudo /opt/conda/bin/conda config --system --set auto_update_conda false
sudo rm -rf \
$prefix/$BIN_DIR/activate* \
$prefix/$BIN_DIR/conda* \
$prefix/$BIN_DIR/deactivate* \
$prefix/etc/profile.d/conda.sh \
$prefix/conda-meta/conda-*.json \
$site_packages/conda*
main_test: &main_test
<<: *defaults
steps:
- run: *remove_conda
- checkout
- run:
name: unit tests
command: |
echo "local_repodata_ttl: 1800" >> ~/.condarc
mkdir -p ~/.conda
/opt/conda/bin/python utils/setup-testing.py --version
/opt/conda/bin/python -m conda info
export PYTHON_MAJOR_VERSION=$(/opt/conda/bin/python -c "import sys; print(sys.version_info[0])")
export TEST_PLATFORM=$(/opt/conda/bin/python -c "import sys; print('win' if sys.platform.startswith('win') else 'unix')")
export PYTHONHASHSEED=$(/opt/conda/bin/python -c "import random as r; print(r.randint(0,4294967296))") && echo "PYTHONHASHSEED=$PYTHONHASHSEED"
ADD_COV="--cov-report xml --cov-report term-missing --cov conda"
/opt/conda/bin/py.test $ADD_COV -m "not integration and not installed"
# PYTHON_MAJOR_VERSION and TEST_PLATFORM are used by coverage via setup.cfg
- run:
name: integration tests
command: |
export PYTHON_MAJOR_VERSION=$(/opt/conda/bin/python -c "import sys; print(sys.version_info[0])")
export TEST_PLATFORM=$(/opt/conda/bin/python -c "import sys; print('win' if sys.platform.startswith('win') else 'unix')")
export PYTHONHASHSEED=$(/opt/conda/bin/python -c "import random as r; print(r.randint(0,4294967296))") && echo "PYTHONHASHSEED=$PYTHONHASHSEED"
ADD_COV="--cov-report xml --cov-report term-missing --cov conda"
/opt/conda/bin/py.test $ADD_COV --cov-append -m "integration and not installed" -v
/opt/conda/bin/python -m conda.common.io
- run:
name: upload codecov
command: /opt/conda/bin/codecov --env PYTHON_VERSION --flags integration --required
conda_build_test: &conda_build_test
<<: *defaults
environment:
CONDA_BUILD: master
steps:
- run: *remove_conda
- checkout
- run:
name: install conda full
command: |
sudo su root -c ". utils/functions.sh && install_conda_shell_scripts /opt/conda ."
sudo su root -c ". utils/functions.sh && make_conda_entrypoint /opt/conda/bin/conda /opt/conda/bin/python ~circleci/conda 'from conda.cli import main'"
sudo su root -c ". utils/functions.sh && make_conda_entrypoint /opt/conda/bin/conda-env /opt/conda/bin/python ~circleci/conda 'from conda_env.cli.main import main'"
site_packages=$(/opt/conda/bin/python -c "from distutils.sysconfig import get_python_lib as g; print(g())")
sudo su -c "echo /home/circleci/conda > $site_packages/conda.pth"
sudo /opt/conda/bin/conda install -yq conda-verify
- run:
name: checkout conda-build
command: |
cb_branch="${CONDA_BUILD:-master}"
git clone -b $cb_branch --depth 750 https://github.com/conda/conda-build.git ~/conda-build
cd ~/conda-build
sudo /opt/conda/bin/pip install --no-deps -U .
git clone https://github.com/conda/conda_build_test_recipe.git ~/conda_build_test_recipe
/opt/conda/bin/conda info
sudo chown -R $(id -nu):$(id -ng) /opt/conda # conda-build tests assume writable base prefix
rm ~/.gitconfig
# circleci image by default has
# $ cat ~/.gitconfig
# [url "ssh://[email protected]"]
# insteadOf = https://github.com
# This messes up conda-build tests
- run:
name: configure and pre-populate cache
# pre-populating the package cache helps avoid race conditions for testing in parallel
command: |
echo "safety_checks: disabled" >> ~/.condarc
echo "local_repodata_ttl: 1800" >> ~/.condarc
mkdir -p ~/.conda
. /opt/conda/etc/profile.d/conda.sh
conda create -n blarg -yq --download-only python=2.7
conda create -n blarg -yq --download-only python=3.4
conda create -n blarg -yq --download-only python=3.5
conda create -n blarg -yq --download-only python=3.6
conda create -n blarg -yq --download-only libpng=1.6.17
- run:
name: conda-build tests [parallel]
environment:
CONDABUILD_SKIP: >
not xattr
and not skeleton_pypi
and not test_expand_globs
and not test_build_expands_wildcards
and not numpy
and not test_intradependencies
and not perl-cpan-Moo
and not cran-nmf
and not test_preferred_env
# skeleton_pypi skipped because of changes to PyPI API
# expand_globs and build_expands_wildcards fail on circleci because of list ordering discrepancies
# skipping numpy tests so circleci images don't need numpy (and mkl) installed
# test_intradependencies started failing after pkgs/main release it seems
# skipping perl-cpan-Moo because of changes in cpan API
# skipping cran-nmf because nmf was removed/archived in cran
# for test_preferred_env see https://github.com/conda/conda/issues/3912#issuecomment-374820599
command: |
. /opt/conda/etc/profile.d/conda.sh
conda activate base
conda info
cd ~/conda-build
env | sort
py.test --basetemp /tmp/cb -v --durations=20 -n 3 -m "not serial" tests -k "$CONDABUILD_SKIP"
- run:
name: conda-build tests [serial]
environment:
CONDABUILD_SKIP: >
not perl-cpan-Moo
and not cran-nmf
and not skeleton_pypi
and not env_creation_with_short_prefix_does_not_deadlock
and not test_preferred_env
# skipping perl-cpan-Moo because of changes in cpan API
# skipping cran-nmf because nmf was removed/archived in cran
# skeleton_pypi skipped because of changes to PyPI API
# env_creation_with_short_prefix_does_not_deadlock: error is prefix is too long
# for test_preferred_env see https://github.com/conda/conda/issues/3912#issuecomment-374820599
command: |
. /opt/conda/etc/profile.d/conda.sh
conda activate base
conda info
cd ~/conda-build
env | sort
py.test --basetemp /tmp/cb -v --durations=20 -n 0 -m "serial" tests -k "$CONDABUILD_SKIP"
/opt/conda/bin/python -m conda.common.io
activate_tests: &activate_tests
<<: *defaults
steps:
- run: *remove_conda
- checkout
- run:
name: setup
command: |
/opt/conda/bin/python -m conda._vendor.auxlib.packaging conda
/opt/conda/bin/python -c "import conda; print(conda.__version__)"
/opt/conda/bin/python -m conda info
- run:
name: activate tests
command: |
ADD_COV="--cov-report xml --cov-report term-missing --cov-append --cov conda"
/opt/conda/bin/py.test $ADD_COV -m "installed" -v --shell=bash --shell=zsh
flake8: &flake8
<<: *defaults
steps:
- checkout
- run: /opt/conda/bin/flake8 --statistics
jobs:
py36 main tests:
<<: *main_test
docker:
- image: condatest/linux-64-python-3.6
environment:
- CONDA_INSTRUMENTATION_ENABLED: true
py27 main tests:
<<: *main_test
docker:
- image: condatest/linux-64-python-2.7
environment:
- CONDA_INSTRUMENTATION_ENABLED: true
3.0 conda-build:
<<: *conda_build_test
environment:
- CONDA_BUILD: 3.0.21
- CONDA_INSTRUMENTATION_ENABLED: true
2.1 conda-build:
<<: *conda_build_test
environment:
- CONDA_BUILD: 2.1.17
- CONDA_INSTRUMENTATION_ENABLED: true
activate tests: *activate_tests
flake8: *flake8
version: 2
workflows:
version: 2
conda tests:
jobs:
- py36 main tests
- py27 main tests
- 3.0 conda-build
- 2.1 conda-build
- activate tests
- flake8