Skip to content

Commit

Permalink
PR: Modernise Development Process (#126)
Browse files Browse the repository at this point in the history
* Modernise development process.

Signed-off-by: Thomas Mansencal <thomas.mansencal@gmail.com>

* Use shallow git clone in Dockerfile

Signed-off-by: Christian Schmidbauer <2787581+grische@users.noreply.github.com>

---------

Signed-off-by: Thomas Mansencal <thomas.mansencal@gmail.com>
Signed-off-by: Christian Schmidbauer <2787581+grische@users.noreply.github.com>
Co-authored-by: Christian Schmidbauer <2787581+grische@users.noreply.github.com>
  • Loading branch information
KelSolaar and grische committed May 6, 2024
1 parent beb43f3 commit 1a1b057
Show file tree
Hide file tree
Showing 48 changed files with 718 additions and 930 deletions.
162 changes: 81 additions & 81 deletions .github/workflows/configuration-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,87 +8,87 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
python-version: [3.9]
python-version: [3.11]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Environment Variables
run: |
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
echo "CI_PACKAGE=opencolorio_config_aces" >> $GITHUB_ENV
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV
shell: bash
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
sudo apt-get --yes install graphviz graphviz-dev
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
shell: bash
- name: Install Package Dependencies
run: |
poetry run python -m pip install --upgrade pip
poetry install --with graphviz,optional
shell: bash
- name: ACES - Conversion Graph
run: |
poetry run invoke build-aces-conversion-graph
shell: bash
- uses: actions/upload-artifact@v2
with:
name: aces-conversion-graph
path: |
build/aces/graph/
- name: Generation - Config - Common Tests
run: |
poetry run invoke build-config-common-tests
shell: bash
- uses: actions/upload-artifact@v2
with:
name: config-common-tests
path: |
build/config/common/tests/
- name: Generation - Config - ACES Reference (Analytical)
run: |
poetry run invoke build-config-reference-analytical
shell: bash
- uses: actions/upload-artifact@v2
with:
name: config-reference-analytical
path: |
build/config/aces/analytical/
- name: Generation - Config - ACES Reference
run: |
poetry run invoke build-config-reference
shell: bash
- uses: actions/upload-artifact@v2
with:
name: config-reference
path: |
build/config/aces/reference/
- name: Generation - Config - ACES CG
run: |
poetry run invoke build-config-cg
shell: bash
- uses: actions/upload-artifact@v2
with:
name: config-cg
path: |
build/config/aces/cg/
- name: Generation - Config - ACES Studio
run: |
poetry run invoke build-config-studio
shell: bash
- uses: actions/upload-artifact@v2
with:
name: config-studio
path: |
build/config/aces/studio/
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Environment Variables
run: |
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
echo "CI_PACKAGE=opencolorio_config_aces" >> $GITHUB_ENV
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV
shell: bash
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
sudo apt-get --yes install graphviz graphviz-dev
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
shell: bash
- name: Install Package Dependencies
run: |
poetry run python -m pip install --upgrade pip
poetry install
shell: bash
- name: ACES - Conversion Graph
run: |
poetry run invoke build-aces-conversion-graph
shell: bash
- uses: actions/upload-artifact@v4
with:
name: aces-conversion-graph
path: |
build/aces/graph/
- name: Generation - Config - Common Tests
run: |
poetry run invoke build-config-common-tests
shell: bash
- uses: actions/upload-artifact@v4
with:
name: config-common-tests
path: |
build/config/common/tests/
- name: Generation - Config - ACES Reference (Analytical)
run: |
poetry run invoke build-config-reference-analytical
shell: bash
- uses: actions/upload-artifact@v4
with:
name: config-reference-analytical
path: |
build/config/aces/analytical/
- name: Generation - Config - ACES Reference
run: |
poetry run invoke build-config-reference
shell: bash
- uses: actions/upload-artifact@v4
with:
name: config-reference
path: |
build/config/aces/reference/
- name: Generation - Config - ACES CG
run: |
poetry run invoke build-config-cg
shell: bash
- uses: actions/upload-artifact@v4
with:
name: config-cg
path: |
build/config/aces/cg/
- name: Generation - Config - ACES Studio
run: |
poetry run invoke build-config-studio
shell: bash
- uses: actions/upload-artifact@v4
with:
name: config-studio
path: |
build/config/aces/studio/
89 changes: 42 additions & 47 deletions .github/workflows/continuous-integration-quality-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,48 @@ jobs:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
strategy:
matrix:
os: [macOS-latest, ubuntu-20.04, windows-latest]
python-version: [3.9, '3.10']
os: [macOS-13, ubuntu-20.04, windows-latest]
python-version: [3.11]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Environment Variables
run: |
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
echo "CI_PACKAGE=opencolorio_config_aces" >> $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 3.9 for Pre-Commit
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
shell: bash
- name: Install Package Dependencies
run: |
poetry run python -m pip install --upgrade pip
poetry install --without graphviz
shell: bash
- name: Pre-Commit (All Files)
run: |
poetry run pre-commit run --all-files
shell: bash
- name: Test Optimised Python Execution
run: |
poetry run python -OO -c "import $CI_PACKAGE"
shell: bash
- name: Test with Pytest
run: |
poetry run python -W ignore -m pytest --disable-warnings --doctest-modules --ignore=$CI_PACKAGE/config/reference/aces-dev --cov=$CI_PACKAGE $CI_PACKAGE
shell: bash
# - name: Upload Coverage to coveralls.io
# run: |
# if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi
# shell: bash

- uses: actions/checkout@v4
with:
submodules: recursive
- name: Environment Variables
run: |
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
echo "CI_PACKAGE=opencolorio_config_aces" >> $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 3.9 for Pre-Commit
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
shell: bash
- name: Install Package Dependencies
run: |
poetry run python -m pip install --upgrade pip
poetry install --without graphviz
shell: bash
- name: Pre-Commit (All Files)
run: |
poetry run pre-commit run --all-files
shell: bash
- name: Test Optimised Python Execution
run: |
poetry run python -OO -c "import $CI_PACKAGE"
shell: bash
- name: Test with Pytest
run: |
poetry run python -W ignore -m pytest --disable-warnings --doctest-modules --ignore=$CI_PACKAGE/config/reference/aces-dev --cov=$CI_PACKAGE $CI_PACKAGE
shell: bash
38 changes: 16 additions & 22 deletions .github/workflows/continuous-integration-static-type-checking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,23 @@ jobs:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
strategy:
matrix:
os: [macOS-latest]
os: [macOS-13]
python-version: [3.11]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: Environment Variables
run: |
echo "CI_PACKAGE=opencolorio_config_aces" >> $GITHUB_ENV
shell: bash
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies (macOS)
if: matrix.os == 'macOS-latest'
run: |
brew install graphviz
export GRAPHVIZ_DIR="/usr/local/Cellar/graphviz/<VERSION>"
pip install pygraphviz --global-option=build_ext --global-option="-I$GRAPHVIZ_DIR/include" --global-option="-L$GRAPHVIZ_DIR/lib"
- name: Install Package Dependencies
run: |
pip install -r requirements.txt
- name: Static Type Checking
run: |
pyright --skipunannotated
- uses: actions/checkout@v4
- name: Environment Variables
run: |
echo "CI_PACKAGE=opencolorio_config_aces" >> $GITHUB_ENV
shell: bash
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Package Dependencies
run: |
pip install -r requirements.txt
- name: Static Type Checking
run: |
pyright --skipunannotated
58 changes: 48 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,52 @@
repos:
- repo: https://github.com/ikamensh/flynt/
rev: '0.76'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
hooks:
- id: flynt
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.272'
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: name-tests-test
args: ["--pytest-test-first"]
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 22.3.0
- id: codespell
args: ["--ignore-words-list=co-ordinates,exitance,fro,hart,ist"]
- repo: https://github.com/ikamensh/flynt
rev: "1.0.1"
hooks:
- id: black
language_version: python3.9
- id: flynt
args: [--verbose]
- repo: https://github.com/PyCQA/isort
rev: "5.13.2"
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.14"
hooks:
- id: ruff-format
- id: ruff
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
language_version: python3.9
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier
exclude: config-aces-reference.ocio.yaml
- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
exclude: aces-dev
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ build:
- graphviz-dev

sphinx:
configuration: docs/conf.py
configuration: docs/conf.py

formats:
- htmlzip
- pdf

python:
install:
- requirements: docs/requirements.txt
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN yum install --setopt=tsflags=nodocs -y \
# OpenColorIO Build
WORKDIR /tmp
ARG OCIO_INSTALL_DIRECTORY=/usr/local
RUN git clone https://github.com/AcademySoftwareFoundation/OpenColorIO \
RUN git clone --depth 1 https://github.com/AcademySoftwareFoundation/OpenColorIO \
&& cd OpenColorIO \
&& mkdir build \
&& mkdir -p ${OCIO_INSTALL_DIRECTORY} \
Expand Down
Loading

0 comments on commit 1a1b057

Please sign in to comment.