Skip to content

Commit 8eec8d1

Browse files
committed
Merge branch 'release/v0.1.0'
2 parents 3fb802c + cb82b17 commit 8eec8d1

File tree

78 files changed

+8653
-710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+8653
-710
lines changed
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Continuous Integration
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
unix-build:
7+
name: Unix Build
8+
strategy:
9+
matrix:
10+
os: [ubuntu-18.04]
11+
python-version: [3.6]
12+
runs-on: ${{ matrix.os }}
13+
steps:
14+
- uses: actions/checkout@v1
15+
- name: Environment Variables
16+
run: |
17+
CI_PYTHON_VERSION=${{ matrix.python-version }}
18+
CI_PACKAGE=colour_datasets
19+
CI_SHA=${{ github.sha }}
20+
CI_SLACK_WEBHOOK=${{ secrets.SLACK_WEBHOOK }}
21+
CI_SLACK_SUCCESS_NOTIFICATION="payload={\"attachments\": [{\"color\": \"#4CAF50\", \"author_name\": \"Python ${{ matrix.python-version }} build on ${{ matrix.os }}\", \"text\": \"Build for commit *${CI_SHA:0:7}* succeeded!\", \"title\": \"${{ github.repository }}@${{ github.ref }}\", \"title_link\": \"https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks\", \"footer\": \"Triggered by ${{ github.actor }}\"}], \"username\":\"Github Actions @ ${{ github.repository }}\", \"channel\":\"#continuous-integration\", \"icon_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}"
22+
CI_SLACK_FAILURE_NOTIFICATION="${CI_SLACK_SUCCESS_NOTIFICATION/4CAF50/F44336}"
23+
CI_SLACK_FAILURE_NOTIFICATION="${CI_SLACK_FAILURE_NOTIFICATION/succeeded/failed}"
24+
COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}
25+
echo ::set-env name=CI_PYTHON_VERSION::$CI_PYTHON_VERSION
26+
echo ::set-env name=CI_PACKAGE::$CI_PACKAGE
27+
echo ::set-env name=CI_SHA::$CI_SHA
28+
echo ::set-env name=CI_SLACK_WEBHOOK::$CI_SLACK_WEBHOOK
29+
echo ::set-env name=CI_SLACK_SUCCESS_NOTIFICATION::$CI_SLACK_SUCCESS_NOTIFICATION
30+
echo ::set-env name=CI_SLACK_FAILURE_NOTIFICATION::$CI_SLACK_FAILURE_NOTIFICATION
31+
echo ::set-env name=COVERALLS_REPO_TOKEN::$COVERALLS_REPO_TOKEN
32+
- name: Set up Python ${{ matrix.python-version }}
33+
uses: actions/setup-python@v1
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
- name: Install Poetry
37+
run: |
38+
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
39+
python get-poetry.py --preview
40+
PATH=$HOME/.poetry/bin:$PATH
41+
echo ::set-env name=PATH::$PATH
42+
- name: Install Package Dependencies
43+
run: |
44+
poetry install
45+
poetry env use $CI_PYTHON_VERSION
46+
- name: Lint with flake8
47+
run: |
48+
source $(poetry env info -p)/bin/activate
49+
flake8 $CI_PACKAGE --count --show-source --statistics
50+
- name: Test with nosetests
51+
run: |
52+
source $(poetry env info -p)/bin/activate
53+
python -W ignore -m nose --nocapture --with-doctest --doctest-options=+ELLIPSIS --with-coverage --cover-package=$CI_PACKAGE $CI_PACKAGE
54+
- name: Upload Coverage to coveralls.io
55+
if: matrix.python-version == '3.6' || matrix.python-version == '3.7'
56+
run: |
57+
source $(poetry env info -p)/bin/activate
58+
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else coveralls; fi
59+
- name: Notify Slack
60+
if: always()
61+
run: |
62+
if [ "${{ job.status }}" == "Success" ]; then CI_SLACK_NOTIFICATION="$CI_SLACK_SUCCESS_NOTIFICATION"; else CI_SLACK_NOTIFICATION="$CI_SLACK_FAILURE_NOTIFICATION"; fi
63+
if [ -z "$CI_SLACK_WEBHOOK" ]; then echo \"SLACK_WEBHOOK\" secret is undefined!; else curl -k -d "$CI_SLACK_NOTIFICATION" -X POST $CI_SLACK_WEBHOOK; fi
64+
windows-build:
65+
name: Windows Build
66+
strategy:
67+
matrix:
68+
os: [windows-2019]
69+
python-version: [3.6]
70+
runs-on: ${{ matrix.os }}
71+
steps:
72+
- uses: actions/checkout@v1
73+
- name: Environment Variables
74+
run: |
75+
set CI_PYTHON_VERSION=${{ matrix.python-version }}
76+
set CI_PACKAGE=colour_datasets
77+
set CI_SHA=${{ github.sha }}
78+
set CI_SLACK_WEBHOOK=${{ secrets.SLACK_WEBHOOK }}
79+
set CI_SLACK_SUCCESS_NOTIFICATION="payload={\"attachments\": [{\"color\": \"#4CAF50\", \"author_name\": \"Python ${{ matrix.python-version }} build on ${{ matrix.os }}\", \"text\": \"Build for commit *"%CI_SHA:~0,7%"* succeeded!\", \"title\": \"${{ github.repository }}@${{ github.ref }}\", \"title_link\": \"https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks\", \"footer\": \"Triggered by ${{ github.actor }}\"}], \"username\":\"Github Actions @ ${{ github.repository }}\", \"channel\":\"#continuous-integration\", \"icon_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}"
80+
set CI_SLACK_FAILURE_NOTIFICATION=%CI_SLACK_SUCCESS_NOTIFICATION:4CAF50=F44336%
81+
set CI_SLACK_FAILURE_NOTIFICATION=%CI_SLACK_FAILURE_NOTIFICATION:succeeded=failed%
82+
set COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}
83+
echo ::set-env name=CI_PYTHON_VERSION::%CI_PYTHON_VERSION%
84+
echo ::set-env name=CI_PACKAGE::%CI_PACKAGE%
85+
echo ::set-env name=CI_SHA::%CI_SHA%
86+
echo ::set-env name=CI_SLACK_WEBHOOK::%CI_SLACK_WEBHOOK%
87+
echo ::set-env name=CI_SLACK_SUCCESS_NOTIFICATION::%CI_SLACK_SUCCESS_NOTIFICATION%
88+
echo ::set-env name=CI_SLACK_FAILURE_NOTIFICATION::%CI_SLACK_FAILURE_NOTIFICATION%
89+
echo ::set-env name=COVERALLS_REPO_TOKEN::%COVERALLS_REPO_TOKEN%
90+
shell: cmd
91+
- name: Set up Python ${{ matrix.python-version }}
92+
uses: actions/setup-python@v1
93+
with:
94+
python-version: ${{ matrix.python-version }}
95+
- name: Install Poetry
96+
run: |
97+
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
98+
python get-poetry.py --preview
99+
set PATH=%USERPROFILE%\.poetry\bin;%PATH%
100+
echo ::set-env name=PATH::%PATH%
101+
shell: cmd
102+
- name: Install Package Dependencies
103+
run: |
104+
call poetry install
105+
FOR /F %%a IN ('poetry env info -p') DO SET CI_VIRTUAL_ENVIRONMENT=%%a
106+
echo ::set-env name=CI_VIRTUAL_ENVIRONMENT::%CI_VIRTUAL_ENVIRONMENT%
107+
shell: cmd
108+
- name: Lint with flake8
109+
run: |
110+
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
111+
flake8 %CI_PACKAGE% --count --show-source --statistics
112+
shell: cmd
113+
- name: Test with nosetests
114+
run: |
115+
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
116+
python -W ignore -m nose --nocapture --with-doctest --doctest-options=+ELLIPSIS --with-coverage --cover-package=%CI_PACKAGE% %CI_PACKAGE%
117+
shell: cmd
118+
- name: Upload Coverage to coveralls.io
119+
if: matrix.python-version == '3.6' || matrix.python-version == '3.7'
120+
run: |
121+
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
122+
IF "%COVERALLS_REPO_TOKEN%"=="" (echo "COVERALLS_REPO_TOKEN" secret is undefined!) ELSE (coveralls)
123+
shell: cmd
124+
- name: Notify Slack
125+
if: always()
126+
run: |
127+
IF "${{ job.status }}"=="Success" (set CI_SLACK_NOTIFICATION=%CI_SLACK_SUCCESS_NOTIFICATION%) ELSE (set CI_SLACK_NOTIFICATION=%CI_SLACK_FAILURE_NOTIFICATION%)
128+
IF "%CI_SLACK_WEBHOOK%"=="" (echo "SLACK_WEBHOOK" secret is undefined!) ELSE (curl -k -d %CI_SLACK_NOTIFICATION% -X POST %CI_SLACK_WEBHOOK%)
129+
shell: cmd

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ __pycache__
88
build
99
dist
1010
docs/_build
11+
docs/generated
1112
references
1213
zenodo
14+
poetry.lock

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://gitlab.com/pycqa/flake8
3+
rev: 3.7.8
4+
hooks:
5+
- id: flake8
6+
exclude: examples
7+
- repo: https://github.com/pre-commit/mirrors-yapf
8+
rev: v0.23.0
9+
hooks:
10+
- id: yapf

.readthedocs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
build:
2+
image: latest
3+
4+
python:
5+
version: 3.6
6+
pip_install: true
7+
extra_requirements:
8+
- read-the-docs

.travis.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)