Skip to content

Commit

Permalink
Merge branch 'release/v0.1.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Nov 28, 2020
2 parents a3529eb + 92e4187 commit eab6ded
Show file tree
Hide file tree
Showing 42 changed files with 1,125 additions and 859 deletions.
190 changes: 67 additions & 123 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,164 +3,108 @@ name: Continuous Integration
on: [push, pull_request]

jobs:
unix-build:
name: Unix Build
continuous-integration:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
strategy:
matrix:
os: [ubuntu-18.04, macOS-latest]
python-version: [2.7, 3.6, 3.7]
os: [macOS-latest, ubuntu-18.04, windows-latest]
python-version: [2.7, 3.6, 3.7, 3.8]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Environment Variables
run: |
CI_PYTHON_VERSION=${{ matrix.python-version }}
CI_PACKAGE=colour_hdri
CI_SHA=${{ github.sha }}
COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}
echo ::set-env name=CI_PYTHON_VERSION::$CI_PYTHON_VERSION
echo ::set-env name=CI_PACKAGE::$CI_PACKAGE
echo ::set-env name=CI_SHA::$CI_SHA
echo ::set-env name=COVERALLS_REPO_TOKEN::$COVERALLS_REPO_TOKEN
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
echo "CI_PACKAGE=colour_hdri" >> $GITHUB_ENV
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV
echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV
shell: bash
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Ubuntu - Update OS & Install APT Dependencies
- name: Install Dependencies (macOS)
if: matrix.os == 'macOS-latest'
run: |
brew install dcraw exiftool gnu-sed
brew cask install adobe-dng-converter
ln -s /usr/local/bin/gsed /usr/local/bin/sed
shell: bash
- name: Install Dependencies (Ubuntu)
if: matrix.os == 'ubuntu-18.04'
run: |
sudo apt-get update
sudo apt-get --yes install dcraw libimage-exiftool-perl
- name: macOS - Install Homebrew Dependencies
if: matrix.os == 'macOS-latest'
shell: bash
- name: Install Dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
curl -L https://exiftool.org/exiftool-12.11.zip -o exiftool-12.11.zip
unzip -d exiftool exiftool-12.11.zip
cp exiftool/exiftool\(-k\).exe exiftool/exiftool.exe
echo "$PWD/exiftool" >> $GITHUB_PATH
curl -L https://cdn.fastpictureviewer.com/bin/dcraw.zip?v=201605100 -o dcraw.zip
unzip -d dcraw dcraw.zip
echo "$PWD/dcraw" >> $GITHUB_PATH
shell: bash
- name: Install Adobe DNG Converter (Windows)
if: matrix.os == 'windows-latest'
run: |
brew install dcraw exiftool
brew cask install adobe-dng-converter
- name: Ubuntu - Set up Matplotlib Backend
if: matrix.os == 'ubuntu-18.04'
curl -L https://download.adobe.com/pub/adobe/dng/win/DNGConverter_11_4.exe -o DNGConverter_11_4.exe
DNGConverter_11_4.exe /S
echo "C:\Program Files\Adobe\Adobe DNG Converter" >> $GITHUB_PATH
shell: cmd
- name: Add Adobe DNG Converter to %PATH% (Windows)
if: matrix.os == 'windows-latest'
run: |
mkdir -p ~/.config/matplotlib
echo "backend: Agg" > ~/.config/matplotlib/matplotlibrc
- name: macOS - Set up Matplotlib Backend
echo "C:\Program Files\Adobe\Adobe DNG Converter" >> $GITHUB_PATH
shell: bash
- name: Set Matplotlib Backend (macOS)
if: matrix.os == 'macOS-latest'
run: |
mkdir -p ~/.matplotlib
echo "backend: Agg" > ~/.matplotlib/matplotlibrc
- name: Install Poetry
run: |
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
python get-poetry.py --preview --version 1.0.0b3
PATH=$HOME/.poetry/bin:$PATH
echo ::set-env name=PATH::$PATH
# - "rawpy" raises a "UnicodeEncodeError" exception on Python 2.7 during installation thus skipping the "optional" packages.
# - "pathlib" is missing from "Imageio".
- name: Python 2.7 - Install Package Dependencies
python get-poetry.py --version 1.0.10
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
shell: bash
- name: Update pyproject.toml file (Python 2.7)
if: matrix.python-version == '2.7'
run: |
poetry install --extras "plotting"
source $(poetry env info -p)/bin/activate
pip install pathlib
python -c "import imageio;imageio.plugins.freeimage.download()"
- name: Python 3.x - Install Package Dependencies
if: matrix.python-version != '2.7'
run: |
poetry install --extras "optional plotting"
source $(poetry env info -p)/bin/activate
python -c "import imageio;imageio.plugins.freeimage.download()"
- name: Lint with flake8
sed -i.bak 's/python = "~2.7 || ^3.6"/python = "~2.7"/g' pyproject.toml
sed -i.bak '/colour-science = "\^0\.3\.16"/ a pathlib = "*"' pyproject.toml
sed -i.bak '/colour-science = "\^0\.3\.16"/ a qtconsole = "4.7.7"' pyproject.toml
shell: bash
- name: Update pyproject.toml file (Windows, Python 2.7)
if: matrix.os == 'windows-latest' && matrix.python-version == '2.7'
run: |
source $(poetry env info -p)/bin/activate
flake8 $CI_PACKAGE --count --show-source --statistics
- name: Test with nosetests
run: |
source $(poetry env info -p)/bin/activate
python -W ignore -m nose --nocapture --with-doctest --doctest-options=+ELLIPSIS --with-coverage --cover-package=$CI_PACKAGE $CI_PACKAGE
- name: Upload Coverage to coveralls.io
if: matrix.python-version == '3.6' || matrix.python-version == '3.7'
run: |
source $(poetry env info -p)/bin/activate
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else coveralls; fi
windows-build:
name: Windows Build
strategy:
matrix:
os: [windows-2019]
python-version: [2.7, 3.6, 3.7]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Environment Variables
run: |
set CI_PYTHON_VERSION=${{ matrix.python-version }}
set CI_PACKAGE=colour_hdri
set CI_SHA=${{ github.sha }}
set COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}
echo ::set-env name=CI_PYTHON_VERSION::%CI_PYTHON_VERSION%
echo ::set-env name=CI_PACKAGE::%CI_PACKAGE%
echo ::set-env name=CI_SHA::%CI_SHA%
echo ::set-env name=COVERALLS_REPO_TOKEN::%COVERALLS_REPO_TOKEN%
shell: cmd
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Command Line Dependencies
run: |
curl -L https://www.sno.phy.queensu.ca/~phil/exiftool/exiftool-11.75.zip -o exiftool-11.75.zip
powershell -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('exiftool-11.75.zip', 'exiftool'); }"
copy %CD%\exiftool\"exiftool(-k).exe" %CD%\exiftool\exiftool.exe
dir %CD%\exiftool\
curl -L https://cdn.fastpictureviewer.com/bin/dcraw.zip?v=201605100 -o dcraw.zip
powershell -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('dcraw.zip', 'dcraw'); }"
curl -L https://download.adobe.com/pub/adobe/dng/win/DNGConverter_11_4.exe -o DNGConverter_11_4.exe
DNGConverter_11_4.exe /S
set PATH=%CD%\exiftool;%CD%\dcraw;"C:\Program Files\Adobe\Adobe DNG Converter";%PATH%
echo ::set-env name=PATH::%PATH%
shell: cmd
- name: Install Poetry
run: |
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
python get-poetry.py --preview --version 1.0.0b3
set PATH=%USERPROFILE%\.poetry\bin;%PATH%
echo ::set-env name=PATH::%PATH%
shell: cmd
# - "pathlib" is missing from "Imageio".
- name: Python 2.7 - Install Package Dependencies
if: matrix.python-version == '2.7'
run: |
call poetry install --extras "optional plotting"
FOR /F %%a IN ('poetry env info -p') DO SET CI_VIRTUAL_ENVIRONMENT=%%a
echo ::set-env name=CI_VIRTUAL_ENVIRONMENT::%CI_VIRTUAL_ENVIRONMENT%
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
pip install pathlib
python -c "import imageio;imageio.plugins.freeimage.download()"
shell: cmd
- name: Python 3.x - Install Package Dependencies
sed -i.bak '/colour-science = "\^0\.3\.16"/ a pywin32 = "228"' pyproject.toml
shell: bash
- name: Update pyproject.toml file (Python 3.x)
if: matrix.python-version != '2.7'
run: |
call poetry install --extras "optional plotting"
FOR /F %%a IN ('poetry env info -p') DO SET CI_VIRTUAL_ENVIRONMENT=%%a
echo ::set-env name=CI_VIRTUAL_ENVIRONMENT::%CI_VIRTUAL_ENVIRONMENT%
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
python -c "import imageio;imageio.plugins.freeimage.download()"
shell: cmd
sed -i.bak 's/python = "~2.7 || ^3.6"/python = "^3.6"/g' pyproject.toml
shell: bash
- name: Install Package Dependencies
run: |
poetry install --extras "plotting"
poetry run python -c "import imageio;imageio.plugins.freeimage.download()"
shell: bash
- name: Lint with flake8
run: |
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
flake8 %CI_PACKAGE% --count --show-source --statistics
shell: cmd
poetry run flake8 $CI_PACKAGE --count --show-source --statistics
shell: bash
- name: Test with nosetests
run: |
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
python -W ignore -m nose --nocapture --with-doctest --doctest-options=+ELLIPSIS --with-coverage --cover-package=%CI_PACKAGE% %CI_PACKAGE%
shell: cmd
poetry run python -W ignore -m nose -q -v --with-doctest --doctest-options=+ELLIPSIS --with-coverage --cover-package=$CI_PACKAGE $CI_PACKAGE
shell: bash
- name: Upload Coverage to coveralls.io
if: matrix.python-version == '3.6' || matrix.python-version == '3.7'
run: |
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
IF "%COVERALLS_REPO_TOKEN%"=="" (echo "COVERALLS_REPO_TOKEN" secret is undefined!) ELSE (coveralls)
shell: cmd
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi
shell: bash
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ repos:
rev: 3.7.8
hooks:
- id: flake8
exclude: examples
exclude: examples|setup\.py
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.23.0
hooks:
- id: yapf
exclude: setup\.py
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ build:
image: latest

python:
version: 3.6
version: 3.7
pip_install: true
extra_requirements:
- read-the-docs
Loading

0 comments on commit eab6ded

Please sign in to comment.