Skip to content

Commit d588eac

Browse files
authored
PR: Modernise Development Process. (#41)
* Modernise development process. Signed-off-by: Thomas Mansencal <[email protected]> * Reformat various docstrings. Signed-off-by: Thomas Mansencal <[email protected]> * Update "Poetry" version in CI. Signed-off-by: Thomas Mansencal <[email protected]> * Set "colour" version. Signed-off-by: Thomas Mansencal <[email protected]> * Use "ubuntu-20.04" in CI Signed-off-by: Thomas Mansencal <[email protected]> * Fix imports for Python 3.10. Signed-off-by: Thomas Mansencal <[email protected]> * Remove unneeded "OrderedDict" usage. Signed-off-by: Thomas Mansencal <[email protected]> * Update CI job name. Signed-off-by: Thomas Mansencal <[email protected]> * Set correct profile version for "ACES" "Reference" config. Signed-off-by: Thomas Mansencal <[email protected]> * Remove unused CI variable. Signed-off-by: Thomas Mansencal <[email protected]> * Add initial artifacts generation. Signed-off-by: Thomas Mansencal <[email protected]> * Implement support for ACES "Reference" "Analytical" config generation. Signed-off-by: Thomas Mansencal <[email protected]> * Verbose current build directory. Signed-off-by: Thomas Mansencal <[email protected]> * Handle pickling exception with early "PyOpenColorIO" versions. Signed-off-by: Thomas Mansencal <[email protected]> * Fix artifact locations. Signed-off-by: Thomas Mansencal <[email protected]> * Implement support for "Common Tests" config artifacts generation. Signed-off-by: Thomas Mansencal <[email protected]> * Nest "Configs" artifacts under a "config" directory Signed-off-by: Thomas Mansencal <[email protected]> * Implement support for "ACES" conversion graph artifact generation. Signed-off-by: Thomas Mansencal <[email protected]> * "OpenColorIO" package is now required. Signed-off-by: Thomas Mansencal <[email protected]> * Implement better logging support. Signed-off-by: Thomas Mansencal <[email protected]> * Address code review changes. Signed-off-by: Thomas Mansencal <[email protected]>
1 parent e22b467 commit d588eac

Some content is hidden

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

44 files changed

+3367
-2653
lines changed

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length = 88
3+
extend-ignore = E203
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Configuration Artifacts
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
configuration-artifacts:
7+
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
8+
strategy:
9+
matrix:
10+
os: [ubuntu-20.04]
11+
python-version: [3.9]
12+
fail-fast: false
13+
runs-on: ${{ matrix.os }}
14+
steps:
15+
- uses: actions/checkout@v1
16+
with:
17+
submodules: recursive
18+
- name: Environment Variables
19+
run: |
20+
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
21+
echo "CI_PACKAGE=opencolorio_config_aces" >> $GITHUB_ENV
22+
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV
23+
shell: bash
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v1
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
- name: Install Dependencies
29+
run: |
30+
sudo apt-get --yes install graphviz graphviz-dev
31+
- name: Install Poetry
32+
run: |
33+
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
34+
python get-poetry.py
35+
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
36+
shell: bash
37+
- name: Install Package Dependencies
38+
run: |
39+
poetry run python -m pip install --upgrade pip
40+
poetry install --extras "graphviz optional"
41+
shell: bash
42+
- name: ACES - Conversion Graph
43+
run: |
44+
poetry run invoke build-aces-conversion-graph
45+
shell: bash
46+
- uses: actions/upload-artifact@v2
47+
with:
48+
name: aces-conversion-graph
49+
path: |
50+
build/aces/graph/
51+
- name: Generation - Config - Common Tests
52+
run: |
53+
poetry run invoke build-config-common-tests
54+
shell: bash
55+
- uses: actions/upload-artifact@v2
56+
with:
57+
name: config-common-tests
58+
path: |
59+
build/config/common/tests/
60+
- name: Generation - Config - ACES Reference (Analytical)
61+
run: |
62+
poetry run invoke build-config-reference-analytical
63+
shell: bash
64+
- uses: actions/upload-artifact@v2
65+
with:
66+
name: config-reference-analytical
67+
path: |
68+
build/config/aces/analytical/
69+
- name: Generation - Config - ACES Reference
70+
run: |
71+
poetry run invoke build-config-reference
72+
shell: bash
73+
- uses: actions/upload-artifact@v2
74+
with:
75+
name: config-reference
76+
path: |
77+
build/config/aces/reference/
78+
- name: Generation - Config - ACES CG
79+
run: |
80+
poetry run invoke build-config-cg
81+
shell: bash
82+
- uses: actions/upload-artifact@v2
83+
with:
84+
name: config-cg
85+
path: |
86+
build/config/aces/cg/

.github/workflows/continuous-integration.yml renamed to .github/workflows/continuous-integration-quality-unit-tests.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
name: Continuous Integration
1+
name: Continuous Integration - Quality & Unit Tests
22

33
on: [push, pull_request]
44

55
jobs:
6-
continuous-integration:
6+
continuous-integration-quality-unit-tests:
77
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
88
strategy:
99
matrix:
10-
os: [macOS-latest, ubuntu-18.04, windows-latest]
11-
python-version: [3.7, 3.8]
10+
os: [macOS-latest, ubuntu-20.04, windows-latest]
11+
python-version: [3.8, 3.9, '3.10']
1212
fail-fast: false
1313
runs-on: ${{ matrix.os }}
1414
steps:
@@ -20,7 +20,6 @@ jobs:
2020
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
2121
echo "CI_PACKAGE=opencolorio_config_aces" >> $GITHUB_ENV
2222
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV
23-
echo "CI_FLAKE8_EXCLUDED=aces-dev" >> $GITHUB_ENV
2423
echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV
2524
shell: bash
2625
- name: Set up Python ${{ matrix.python-version }}
@@ -30,20 +29,25 @@ jobs:
3029
- name: Install Poetry
3130
run: |
3231
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
33-
python get-poetry.py --version 1.0.10
32+
python get-poetry.py
3433
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
3534
shell: bash
3635
- name: Install Package Dependencies
3736
run: |
37+
poetry run python -m pip install --upgrade pip
3838
poetry install --extras "optional"
3939
shell: bash
40-
- name: Lint with flake8
40+
- name: Pre-Commit (All Files)
4141
run: |
42-
poetry run flake8 $CI_PACKAGE --count --show-source --statistics --exclude=$CI_FLAKE8_EXCLUDED
42+
poetry run pre-commit run --all-files
4343
shell: bash
44-
- name: Test with nosetests
44+
- name: Test Optimised Python Execution
4545
run: |
46-
poetry run python -W ignore -m nose -q -v --with-doctest --doctest-options=+ELLIPSIS --with-coverage --traverse-namespace --cover-package=$CI_PACKAGE $CI_PACKAGE
46+
poetry run python -OO -c "import $CI_PACKAGE"
47+
shell: bash
48+
- name: Test with Pytest
49+
run: |
50+
poetry run python -W ignore -m py.test --disable-warnings --doctest-modules --ignore=$CI_PACKAGE/config/reference/aces-dev --cov=$CI_PACKAGE $CI_PACKAGE
4751
shell: bash
4852
# - name: Upload Coverage to coveralls.io
4953
# run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*.pyo
44
.DS_Store
55
.coverage
6+
.dmypy.json
67
.idea
78
__pycache__
89
build

.pre-commit-config.yaml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
repos:
2-
- repo: https://gitlab.com/pycqa/flake8
3-
rev: 3.7.8
2+
- repo: https://github.com/asottile/pyupgrade
3+
rev: v2.31.0
4+
hooks:
5+
- id: pyupgrade
6+
args: [--py38-plus]
7+
- repo: https://github.com/ikamensh/flynt/
8+
rev: '0.76'
9+
hooks:
10+
- id: flynt
11+
- repo: https://github.com/psf/black
12+
rev: 22.1.0
13+
hooks:
14+
- id: black
15+
language_version: python3.8
16+
- repo: https://github.com/PyCQA/flake8
17+
rev: 4.0.1
418
hooks:
519
- id: flake8
6-
exclude: aces-dev
7-
- repo: https://github.com/pre-commit/mirrors-yapf
8-
rev: v0.23.0
20+
- repo: https://github.com/pycqa/pydocstyle
21+
rev: 6.1.1
922
hooks:
10-
- id: yapf
11-
exclude: opencolorio_config_aces/config/reference/aces-dev
23+
- id: pydocstyle
24+
args:
25+
- --convention=numpy
26+
- --add-ignore=D104,D200,D202,D205,D301,D400

.readthedocs.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-20.04
5+
tools:
6+
python: "3.8"
7+
apt_packages:
8+
- graphviz
9+
- graphviz-dev
10+
11+
sphinx:
12+
configuration: docs/conf.py
13+
14+
formats:
15+
- htmlzip
16+
- pdf
17+
18+
python:
19+
install:
20+
- method: pip
21+
path: .
22+
extra_requirements:
23+
- read-the-docs

.readthedocs.yml

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

0 commit comments

Comments
 (0)