Skip to content

Commit

Permalink
Use *uv*.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Oct 8, 2024
1 parent 18584fe commit 2a5ede7
Show file tree
Hide file tree
Showing 8 changed files with 386 additions and 378 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/continuous-integration-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,18 @@ jobs:
run: |
sudo apt-get update
sudo apt-get --yes install graphviz graphviz-dev latexmk texlive-full
- name: Install Poetry
- name: Install uv
run: |
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
pip install uv
shell: bash
- name: Install Package Dependencies
run: |
poetry run python -m pip install --upgrade pip
poetry install
poetry run python -c "import imageio;imageio.plugins.freeimage.download()"
uv sync --all-extras --no-dev
uv run python -c "import imageio;imageio.plugins.freeimage.download()"
shell: bash
- name: Build Documentation
run: |
poetry run invoke docs
uv run invoke docs
shell: bash
- uses: actions/upload-artifact@v4
with:
Expand Down
37 changes: 11 additions & 26 deletions .github/workflows/continuous-integration-quality-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,51 +42,36 @@ jobs:
run: |
sudo apt-get update
sudo apt-get --yes install graphviz graphviz-dev
- name: Install Poetry
- name: Install uv
run: |
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
pip install uv
shell: bash
- name: Install Package Dependencies (macOs)
if: matrix.os == 'macOS-latest'
run: |
poetry run python -m pip install --upgrade pip
poetry install
- name: Install Package Dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
poetry run python -m pip install --upgrade pip
poetry install
poetry run python -c "import imageio;imageio.plugins.freeimage.download()"
shell: bash
- name: Install Package Dependencies (Windows)
if: matrix.os == 'windows-latest'
- name: Install Package Dependencies
run: |
poetry run python -m pip install --upgrade pip
poetry install
poetry run python -c "import imageio;imageio.plugins.freeimage.download()"
uv sync --all-extras --no-dev
uv run python -c "import imageio;imageio.plugins.freeimage.download()"
shell: bash
- name: Install OpenImageIO (macOs)
if: matrix.os == 'macOS-latest' && matrix.python-version == '3.12'
run: |
brew install openimageio
find /Users/runner/Library/Caches/pypoetry/virtualenvs/ -path "/Users/runner/Library/Caches/pypoetry/virtualenvs/*/lib/python3.12/site-packages" -type d -exec ln -s /opt/homebrew/Cellar/openimageio/*/lib/python*/site-packages/OpenImageIO/OpenImageIO*.so {}/OpenImageIO.so \;
poetry run python -c "import OpenImageIO;print(OpenImageIO.__version__)"
ln -s /opt/homebrew/Cellar/openimageio/*/lib/python*/site-packages/OpenImageIO/OpenImageIO*.so ./.venv/lib/python3.12/site-packages/OpenImageIO.so
uv run python -c "import OpenImageIO;print(OpenImageIO.__version__)"
shell: bash
- name: Pre-Commit (All Files)
run: |
poetry run pre-commit run --all-files
uv run pre-commit run --all-files
shell: bash
- name: Test Optimised Python Execution
run: |
poetry run python -OO -c "import $CI_PACKAGE"
uv run python -OO -c "import $CI_PACKAGE"
shell: bash
- name: Test with Pytest
run: |
poetry run python -W ignore -m pytest --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE
uv run python -W ignore -m pytest --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE
shell: bash
- name: Upload Coverage to coveralls.io
if: matrix.os == 'macOS-latest' && matrix.python-version == '3.12'
run: |
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else uv run coveralls; fi
shell: bash
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.fleet
.idea
.ipynb_checkpoints
.python-version
.vs
.vscode
.sandbox
Expand All @@ -20,5 +21,5 @@ docs/_static/Examples_*.png
docs/_static/Plotting_*.png
docs/_static/Tutorial_*.png
docs/generated
poetry.lock
references
uv.lock
88 changes: 51 additions & 37 deletions TODO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,70 @@ TODO

- colour/__init__.py

- Line 878 : # TODO: Remove legacy printing support when deemed appropriate.
- Line 914 : # TODO: Remove legacy printing support when deemed appropriate.


- colour/colorimetry/spectrum.py

- Line 1190 : # TODO: Provide support for fractional interval like 0.1, etc...
- Line 1176 : # TODO: Provide support for fractional interval like 0.1, etc...


- colour/colorimetry/tristimulus_values.py

- Line 1071 : # TODO: Investigate code vectorisation.
- Line 1050 : # TODO: Investigate code vectorisation.


- colour/appearance/ciecam02.py

- Line 377 : # TODO: Compute hue composition.
- Line 369 : # TODO: Compute hue composition.


- colour/appearance/ciecam16.py

- Line 325 : # TODO: Compute hue composition.
- Line 322 : # TODO: Compute hue composition.


- colour/appearance/cam16.py

- Line 313 : # TODO: Compute hue composition.
- Line 308 : # TODO: Compute hue composition.


- colour/appearance/hellwig2022.py

- Line 355 : # TODO: Compute hue composition.
- Line 354 : # TODO: Compute hue composition.


- colour/appearance/hunt.py

- Line 487 : # TODO: Implement hue quadrature & composition computation.
- Line 518 : # TODO: Implement whiteness-blackness :math:`Q_{wb}` computation.
- Line 478 : # TODO: Implement hue quadrature & composition computation.
- Line 509 : # TODO: Implement whiteness-blackness :math:`Q_{wb}` computation.


- colour/appearance/rlab.py

- Line 287 : # TODO: Implement hue composition computation.
- Line 283 : # TODO: Implement hue composition computation.


- colour/appearance/nayatani95.py

- Line 311 : # TODO: Implement hue quadrature & composition computation.
- Line 324 : # TODO: Investigate components usage. M_RG, M_YB = tsplit(colourfulness_components(C_RG, C_YB, brightness_ideal_white))
- Line 307 : # TODO: Implement hue quadrature & composition computation.
- Line 318 : # TODO: Investigate components usage. M_RG, M_YB = tsplit(colourfulness_components(C_RG, C_YB, brightness_ideal_white))


- colour/appearance/llab.py

- Line 396 : # TODO: Implement hue composition computation.
- Line 362 : # TODO: Implement hue composition computation.


- colour/recovery/tests/test_jiang2013.py

- Line 63 : # TODO: Last eigen value seems to be very sensitive and produce differences on ARM.
- Line 66 : # TODO: Last eigen value seems to be very sensitive and produce differences on ARM.


- colour/io/fichet2021.py

- Line 644 : # TODO: Implement support for integration of bi-spectral component.
- Line 651 : # TODO: Implement support for re-binning component with non-uniform interval.


- colour/io/ocio.py
Expand All @@ -73,97 +79,105 @@ TODO

- colour/io/ctl.py

- Line 64 : # TODO: Reinstate coverage when "ctlrender" is trivially available cross-platform.
- Line 65 : # TODO: Reinstate coverage when "ctlrender" is trivially available cross-platform.


- colour/io/tests/test_ocio.py

- Line 39 : # TODO: Remove when "Pypi" wheel compatible with "ARM" on "macOS" is released.
- Line 37 : # TODO: Remove when "Pypi" wheel compatible with "ARM" on "macOS" is released.


- colour/io/tests/test_ctl.py

- Line 41 : # TODO: Reinstate coverage when "ctlrender" is tivially available cross-platform.
- Line 39 : # TODO: Reinstate coverage when "ctlrender" is tivially available cross-platform.


- colour/io/tests/test_image.py

- Line 314 : # TODO: Investigate "OIIO" behaviour here: 1.0 != 15360.0 image = read_image_OpenImageIO( os.path.join(ROOT_RESOURCES, 'Colour_Logo.png'), 'float16') self.assertIs(image.dtype, np.dtype('float16')) self.assertEqual(np.min(image), 0.0) self.assertEqual(np.max(image), 1.0)
- Line 321 : # TODO: Investigate "OIIO" behaviour here: 1.0 != 15360.0 image = read_image_OpenImageIO( os.path.join(ROOT_RESOURCES, 'Colour_Logo.png'), 'float16') self.assertIs(image.dtype, np.dtype('float16')) self.assertEqual(np.min(image), 0.0) self.assertEqual(np.max(image), 1.0)


- colour/models/rgb/derivation.py

- Line 231 : # TODO: Investigate if we return an ndarray here with primaries and whitepoint stacked together.
- Line 230 : # TODO: Investigate if we return an ndarray here with primaries and whitepoint stacked together.


- colour/models/rgb/tests/test_rgb_colourspace.py

- Line 348 : # TODO: Remove tests when dropping deprecated signature support.
- Line 551 : # TODO: Remove tests when dropping deprecated signature support.
- Line 340 : # TODO: Remove tests when dropping deprecated signature support.
- Line 541 : # TODO: Remove tests when dropping deprecated signature support.


- colour/models/rgb/tests/test_derivation.py

- Line 339 : # TODO: Simplify that monster.
- Line 327 : # TODO: Simplify that monster.


- colour/utilities/verbose.py

- Line 669 : # TODO: Implement support for "pyproject.toml" file whenever "TOML" is supported in the standard library. NOTE: A few clauses are not reached and a few packages are not available during continuous integration and are thus ignored for coverage.
- Line 791 : # TODO: Implement support for "pyproject.toml" file whenever "TOML" is supported in the standard library. NOTE: A few clauses are not reached and a few packages are not available during continuous integration and are thus ignored for coverage.


- colour/utilities/network.py

- Line 587 : # TODO: Consider using an ordered set instead of a dict.
- Line 1064 : # TODO: Consider using ordered set.
- Line 1070 : # TODO: Consider using ordered set.
- Line 1907 : # TODO: Implement solid control flow based processing using a stack.


- colour/utilities/array.py

- Line 577 : # TODO: Remove when https://github.com/numpy/numpy/issues/5718 is addressed.
- Line 865 : # TODO: Investigate behaviour on Windows.
- Line 922 : # TODO: Annotate with "Union[Literal['ignore', 'reference', '1', '100'], str]" when Python 3.7 is dropped.
- Line 570 : # TODO: Remove when https://github.com/numpy/numpy/issues/5718 is addressed.
- Line 850 : # TODO: Investigate behaviour on Windows.
- Line 911 : # TODO: Annotate with "Union[Literal['ignore', 'reference', '1', '100'], str]" when Python 3.7 is dropped.


- colour/plotting/models.py

- Line 1939 : # TODO: Filter appropriate colour models. NOTE: "dtype=object" is required for ragged array support in "Numpy" 1.24.0.
- Line 1925 : # TODO: Filter appropriate colour models. NOTE: "dtype=object" is required for ragged array support in "Numpy" 1.24.0.


- colour/plotting/graph.py

- Line 88 : # TODO: Investigate API to trigger the conversion graph build.
- Line 87 : # TODO: Investigate API to trigger the conversion graph build.


- colour/plotting/common.py

- Line 870 : # TODO: Reassess according to https://github.com/matplotlib/matplotlib/issues/1077
- Line 989 : # TODO: Consider using "MutableMapping" here.
- Line 864 : # TODO: Reassess according to https://github.com/matplotlib/matplotlib/issues/1077
- Line 980 : # TODO: Consider using "MutableMapping" here.


- colour/characterisation/aces_it.py

- Line 397 : # TODO: Remove when removing the "colour.sd_blackbody" definition warning.
- Line 395 : # TODO: Remove when removing the "colour.sd_blackbody" definition warning.


- colour/characterisation/correction.py

- Line 461 : # TODO: Generalise polynomial expansion.
- Line 459 : # TODO: Generalise polynomial expansion.


- colour/notation/munsell.py

- Line 1251 : # TODO: Consider refactoring implementation.
- Line 1236 : # TODO: Consider refactoring implementation.


- colour/continuous/signal.py

- Line 424 : # TODO: Check for interpolator compatibility.
- Line 484 : # TODO: Check for extrapolator compatibility.
- Line 422 : # TODO: Check for interpolator compatibility.
- Line 482 : # TODO: Check for extrapolator compatibility.


- colour/hints/__init__.py

- Line 135 : # TODO: Revisit to use Protocol.
- Line 137 : # TODO: Revisit to use Protocol.


- colour/algebra/tests/test_interpolation.py

- Line 1176 : # TODO: Revisit if the interpolator can be applied on non-uniform "x" independent variable.
- Line 1168 : # TODO: Revisit if the interpolator can be applied on non-uniform "x" independent variable.

About
-----
Expand Down
Loading

0 comments on commit 2a5ede7

Please sign in to comment.