Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh repo configuration #9

Merged
merged 1 commit into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
platform:
- x64

branches:
only:
- master

environment:
matrix:
- PYVER: 36
- PYVER: 35
- PYVER: 27

install:
# If there is a newer build queued for the same PR, cancel this one.
- cmd: >
.gen_ci_support\\ff_ci_pr_build.py -v
--ci "appveyor"
"%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_SLUG%"
"%APPVEYOR_BUILD_NUMBER%"
"%APPVEYOR_PULL_REQUEST_NUMBER%"

# Install Miniconda.
- cmd: call .appveyor_support\\install_miniconda.bat

# Create the test environment.
- cmd: set "CONDA_ENV_TYPE=tst_py%PYVER%"
- cmd: call .appveyor_support\\create_env.bat

# Install the package and dependencies.
- cmd: pip install -e .

# Skip .NET project specific build phase.
build: off

# Run tests and measure test coverage.
test_script:
- cmd: coverage erase
- cmd: coverage run --source . setup.py test
- cmd: coverage report -m

on_success:
- cmd: set "CONDA_ENV_TYPE=dpl"
- cmd: .appveyor_support\\create_env.bat
- cmd: coveralls || exit 0
31 changes: 31 additions & 0 deletions .appveyor_support/create_env.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
:: Show each command and output
@echo on

:: Check CONDA_ENV_TYPE was set.
if "$%CONDA_ENV_TYPE%" == "" (
echo "Set $CONDA_ENV_TYPE externally."
exit 1
)

:: Activate conda.
call "%MINICONDA_DIR%\Scripts\activate.bat"
if errorlevel 1 exit 1

:: Create a temporary directory for the environment.
python -c "import tempfile; print(tempfile.mkdtemp())" > tmp_dir.txt
if errorlevel 1 exit 1
set /p CONDA_ENV_PREFIX=<tmp_dir.txt
if errorlevel 1 exit 1
del tmp_dir.txt
if errorlevel 1 exit 1
set "CONDA_ENV_PATH=%CONDA_ENV_PREFIX%\%CONDA_ENV_TYPE%"
set "SCRIPT_DIR=%~dp0"
set "CONDA_ENV_SPEC=%SCRIPT_DIR%\environments\%CONDA_ENV_TYPE%.yml"

:: Fill the temporary directory.
call "%MINICONDA_DIR%\Scripts\activate.bat"
if errorlevel 1 exit 1
conda.exe env create -p "%CONDA_ENV_PATH%" -f "%CONDA_ENV_SPEC%"
if errorlevel 1 exit 1
call "%MINICONDA_DIR%\Scripts\activate.bat" "%CONDA_ENV_PATH%"
if errorlevel 1 exit 1
11 changes: 11 additions & 0 deletions .appveyor_support/environments/dpl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: dask_image_dpl_env

channels:
- conda-forge

dependencies:
- python=3.6.*
- pip==18.0
- wheel==0.31.1
- coverage==4.5.1
- coveralls==1.3.0
10 changes: 10 additions & 0 deletions .appveyor_support/environments/tst_py27.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: dask_image_py27_env

channels:
- conda-forge

dependencies:
- python=2.7.*
- pip==18.0
- wheel==0.31.1
- coverage==4.5.1
10 changes: 10 additions & 0 deletions .appveyor_support/environments/tst_py35.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: dask_image_py35_env

channels:
- conda-forge

dependencies:
- python=3.5.*
- pip==18.0
- wheel==0.31.1
- coverage==4.5.1
10 changes: 10 additions & 0 deletions .appveyor_support/environments/tst_py36.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: dask_image_py36_env

channels:
- conda-forge

dependencies:
- python=3.6.*
- pip==18.0
- wheel==0.31.1
- coverage==4.5.1
49 changes: 49 additions & 0 deletions .appveyor_support/install_miniconda.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
:: Configure batch
@echo on

:: Miniconda Config:
set "MINICONDA_VERSION=4.5.4"
set "MINICONDA_MD5=1c73051ccd997770288275ee6474b423"
set "MINICONDA_INSTALLER=%USERPROFILE%\miniconda.exe"
set "MINICONDA_DIR=%USERPROFILE%\miniconda"
set "MINICONDA_URL=https://repo.continuum.io/miniconda/Miniconda3-%MINICONDA_VERSION%-Windows-x86_64.exe"

:: Install Miniconda.
powershell -Command "(New-Object Net.WebClient).DownloadFile('%MINICONDA_URL%', '%MINICONDA_INSTALLER%')"
if errorlevel 1 exit 1
( certutil -hashfile "%MINICONDA_INSTALLER%" md5 | findstr /v ":" ) > "%MINICONDA_INSTALLER%.md5"
if errorlevel 1 exit 1
type "%MINICONDA_INSTALLER%.md5"
if errorlevel 1 exit 1
set /p MINICONDA_MD5_FOUND=<%MINICONDA_INSTALLER%.md5
if errorlevel 1 exit 1
set "MINICONDA_MD5_FOUND=%MINICONDA_MD5_FOUND: =%"
if errorlevel 1 exit 1
echo "%MINICONDA_MD5_FOUND%" | findstr /c:"%MINICONDA_MD5%"
if errorlevel 1 exit 1
start /wait "" %MINICONDA_INSTALLER% /InstallationType=JustMe ^
/AddToPath=0 ^
/RegisterPython=0 ^
/S ^
/D=%MINICONDA_DIR%
if errorlevel 1 exit 1
del "%MINICONDA_INSTALLER%"
if errorlevel 1 exit 1
del "%MINICONDA_INSTALLER%.md5"
if errorlevel 1 exit 1

:: Activate conda.
call "%MINICONDA_DIR%\Scripts\activate.bat"
if errorlevel 1 exit 1

:: Configure conda.
conda.exe config --set show_channel_urls true
if errorlevel 1 exit 1
conda.exe config --set auto_update_conda false
if errorlevel 1 exit 1
conda.exe config --set add_pip_as_python_dependency true
if errorlevel 1 exit 1

:: Patch VS 2008 for 64-bit support.
conda.exe install --quiet --yes "conda-forge::vs2008_express_vc_python_patch"
call setup_x64
27 changes: 27 additions & 0 deletions .circleci/checkout_merge_commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash


# Update PR refs for testing.
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/head:pr/${CIRCLE_PR_NUMBER}/head"
FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/merge:pr/${CIRCLE_PR_NUMBER}/merge"
fi

# Retrieve the refs.
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
git fetch -u origin ${FETCH_REFS}
fi

# Checkout the PR merge ref.
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
git checkout -qf "pr/${CIRCLE_PR_NUMBER}/merge"
fi

# Check for merge conflicts.
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
git branch --merged | grep "pr/${CIRCLE_PR_NUMBER}/head" > /dev/null
fi
143 changes: 143 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
version: 2

jobs:
build_py36:
working_directory: ~/test
machine: true
environment:
- PYVER: "36"
steps:
- checkout
- run:
name: Fast finish outdated PRs and merge PRs
command: |
./.circleci/fast_finish_ci_pr_build.sh
./.circleci/checkout_merge_commit.sh
- run:
name: Install and Configure Miniconda
command: |
source .circleci/install_miniconda.sh
echo "MINICONDA_DIR=${MINICONDA_DIR}" >> "${BASH_ENV}"
- run:
name: Create the test environment
command: |
export CONDA_ENV_TYPE="tst_py${PYVER}"
source .circleci/create_env.sh
echo "CONDA_ENV_PATH=${CONDA_ENV_PATH}" >> "${BASH_ENV}"
- run:
name: Install the package and dependencies
command: |
source "${MINICONDA_DIR}/etc/profile.d/conda.sh"
conda activate "${CONDA_ENV_PATH}"
pip install -e .
- run:
name: Run tests and measure test coverage
command: |
source "${MINICONDA_DIR}/etc/profile.d/conda.sh"
conda activate "${CONDA_ENV_PATH}"
coverage erase
coverage run --source . setup.py test
coverage report -m
- run:
name: Report coverage
command: |
export CONDA_ENV_TYPE="dpl"
source .circleci/create_env.sh
coveralls


build_py35:
working_directory: ~/test
machine: true
environment:
- PYVER: "35"
steps:
- checkout
- run:
name: Fast finish outdated PRs and merge PRs
command: |
./.circleci/fast_finish_ci_pr_build.sh
./.circleci/checkout_merge_commit.sh
- run:
name: Install and Configure Miniconda
command: |
source .circleci/install_miniconda.sh
echo "MINICONDA_DIR=${MINICONDA_DIR}" >> "${BASH_ENV}"
- run:
name: Create the test environment
command: |
export CONDA_ENV_TYPE="tst_py${PYVER}"
source .circleci/create_env.sh
echo "CONDA_ENV_PATH=${CONDA_ENV_PATH}" >> "${BASH_ENV}"
- run:
name: Install the package and dependencies
command: |
source "${MINICONDA_DIR}/etc/profile.d/conda.sh"
conda activate "${CONDA_ENV_PATH}"
pip install -e .
- run:
name: Run tests and measure test coverage
command: |
source "${MINICONDA_DIR}/etc/profile.d/conda.sh"
conda activate "${CONDA_ENV_PATH}"
coverage erase
coverage run --source . setup.py test
coverage report -m
- run:
name: Report coverage
command: |
export CONDA_ENV_TYPE="dpl"
source .circleci/create_env.sh
coveralls

build_py27:
working_directory: ~/test
machine: true
environment:
- PYVER: "27"
steps:
- checkout
- run:
name: Fast finish outdated PRs and merge PRs
command: |
./.circleci/fast_finish_ci_pr_build.sh
./.circleci/checkout_merge_commit.sh
- run:
name: Install and Configure Miniconda
command: |
source .circleci/install_miniconda.sh
echo "MINICONDA_DIR=${MINICONDA_DIR}" >> "${BASH_ENV}"
- run:
name: Create the test environment
command: |
export CONDA_ENV_TYPE="tst_py${PYVER}"
source .circleci/create_env.sh
echo "CONDA_ENV_PATH=${CONDA_ENV_PATH}" >> "${BASH_ENV}"
- run:
name: Install the package and dependencies
command: |
source "${MINICONDA_DIR}/etc/profile.d/conda.sh"
conda activate "${CONDA_ENV_PATH}"
pip install -e .
- run:
name: Run tests and measure test coverage
command: |
source "${MINICONDA_DIR}/etc/profile.d/conda.sh"
conda activate "${CONDA_ENV_PATH}"
coverage erase
coverage run --source . setup.py test
coverage report -m
- run:
name: Report coverage
command: |
export CONDA_ENV_TYPE="dpl"
source .circleci/create_env.sh
coveralls

workflows:
version: 2
build_and_test:
jobs:
- build_py36
- build_py35
- build_py27
27 changes: 27 additions & 0 deletions .circleci/create_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash -l

# Some reasonable bash constraints.
set -xeuo pipefail

# Check CONDA_ENV_TYPE was set.
if [ -z "${CONDA_ENV_TYPE}" ]; then
echo "Set $CONDA_ENV_TYPE externally."
exit 1
fi

# Activate conda.
source "${MINICONDA_DIR}/etc/profile.d/conda.sh"
conda activate

# Create a temporary directory for the environment.
export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export CONDA_ENV_PREFIX="$(python -c 'import tempfile; print(tempfile.mkdtemp())')"
export CONDA_ENV_PATH="${CONDA_ENV_PREFIX}/${CONDA_ENV_TYPE}"
export CONDA_ENV_SPEC="${SCRIPT_DIR}/environments/${CONDA_ENV_TYPE}.yml"

# Fill the temporary directory.
conda env create -p "${CONDA_ENV_PATH}" -f "${CONDA_ENV_SPEC}"
conda activate "${CONDA_ENV_PATH}"

# Unset all bash constraints.
set +xeuo pipefail
11 changes: 11 additions & 0 deletions .circleci/environments/dpl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: dask_image_dpl_env

channels:
- conda-forge

dependencies:
- python=3.6.*
- pip==18.0
- wheel==0.31.1
- coverage==4.5.1
- coveralls==1.3.0
10 changes: 10 additions & 0 deletions .circleci/environments/tst_py27.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: dask_image_py27_env

channels:
- conda-forge

dependencies:
- python=2.7.*
- pip==18.0
- wheel==0.31.1
- coverage==4.5.1
Loading