Skip to content

Commit

Permalink
Use *uv* and *hatch* and enable *Python* 3.13.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Oct 13, 2024
1 parent 7b118a3 commit 0855859
Show file tree
Hide file tree
Showing 14 changed files with 377 additions and 340 deletions.
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ is available to guide the process: https://www.colour-science.org/contributing/.
- [ ] Pyright static checking has been run and passed.
- [ ] Pre-commit hooks have been run and passed.

<!-- The unit tests can be invoked with `poetry run invoke tests` -->
<!-- Pyright can be started with `pyright --skipunannotated` -->
<!-- The unit tests can be invoked with `uv run invoke tests` -->
<!-- Pyright can be started with `pyright --threads --skipunannotated` -->

**Documentation**

Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/continuous-integration-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [macOS-latest]
python-version: [3.11]
python-version: [3.13]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -32,18 +32,16 @@ jobs:
export PATH=/Library/TeX/texbin:$PATH
sudo tlmgr update --self
sudo tlmgr install latexmk
- 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 --no-plots
uv run invoke docs
shell: bash
36 changes: 20 additions & 16 deletions .github/workflows/continuous-integration-quality-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [macOS-latest, windows-latest]
python-version: [3.9, "3.10", 3.11]
python-version: ["3.10", 3.11, 3.12, 3.13]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -22,39 +22,43 @@ jobs:
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
- name: Set up Python 3.10 for Pre-Commit
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.10"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
- name: Install Dependencies (macOS)
if: matrix.os == 'macOS-latest'
run: |
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
brew install freeimage
# TODO: Drop when https://github.com/imageio/imageio/issues/628 is addressed
echo "IMAGEIO_FREEIMAGE_LIB=/opt/homebrew/Cellar/freeimage/3.18.0/lib/libfreeimage.3.18.0.dylib" >> $GITHUB_ENV
- name: Install uv
run: |
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: 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: |
uv run python -OO -c "import $CI_PACKAGE"
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 --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
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install Package Dependencies
run: |
pip install -r requirements.txt
cat requirements.txt | grep -Eo '(^[^#]+)' | xargs -n 1 pip install || true
- name: Static Type Checking
run: |
pyright --skipunannotated
pyright --threads --skipunannotated
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
.sandbox
.vs
.vscode
Expand All @@ -17,4 +18,4 @@ colour_visuals.egg-info
dist
docs/_build
docs/generated
poetry.lock
uv.lock
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,14 @@ Installation
Primary Dependencies
~~~~~~~~~~~~~~~~~~~~

- `python >= 3.9, < 4 <https://www.python.org/download/releases>`__
- `colour-science (git) <https://github.com/colour-science/colour.git>`__
- `python >= 3.10, < 3.14 <https://www.python.org/download/releases>`__
- `colour-science >= 4.5 <https://pypi.org/project/colour-science>`__
- `glfw <https://pypi.org/project/glfw>`__
- `imageio >= 2, < 3 <https://imageio.github.io>`__
- `networkx >= 2.7, < 3 <https://pypi.org/project/networkx>`__
- `numpy >= 1.22, < 2 <https://pypi.org/project/numpy>`__
- `networkx >= 3, < 4 <https://pypi.org/project/networkx>`__
- `numpy >= 1.24, < 3 <https://pypi.org/project/numpy>`__
- `pygfx <https://pypi.org/project/pygfx>`__
- `pyside >= 6, < 7 <https://pypi.org/project/pygfx>`__
- `scipy >= 1.8, < 2 <https://pypi.org/project/scipy>`__
- `scipy >= 1.10, < 2 <https://pypi.org/project/scipy>`__

Pypi
~~~~
Expand Down
6 changes: 5 additions & 1 deletion TODO.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
Colour - Visuals - TODO
===========================
=======================

TODO
----

- colour_visuals/__init__.py

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

About
-----

Expand Down
2 changes: 1 addition & 1 deletion colour_visuals/pointer_gamut.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
import numpy as np
import pygfx as gfx
from colour.hints import ArrayLike, Literal, LiteralColourspaceModel
from colour.models import LCHab_to_Lab # pyright: ignore
from colour.models import (
CCS_ILLUMINANT_POINTER_GAMUT,
DATA_POINTER_GAMUT_VOLUME,
Lab_to_XYZ,
LCHab_to_Lab,
)
from colour.plotting import (
CONSTANTS_COLOUR_STYLE,
Expand Down
12 changes: 6 additions & 6 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Installation Guide
Primary Dependencies
--------------------

- `python >= 3.9, < 4 <https://www.python.org/download/releases>`__
- `colour-science (git) <https://github.com/colour-science/colour.git>`__
- `python >= 3.10, < 3.14 <https://www.python.org/download/releases>`__
- `colour-science >= 4.5 <https://pypi.org/project/colour-science>`__
- `glfw <https://pypi.org/project/glfw>`__
- `imageio >= 2, < 3 <https://imageio.github.io>`__
- `networkx >= 2.7, < 3 <https://pypi.org/project/networkx>`__
- `numpy >= 1.22, < 2 <https://pypi.org/project/numpy>`__
- `networkx >= 3, < 4 <https://pypi.org/project/networkx>`__
- `numpy >= 1.24, < 3 <https://pypi.org/project/numpy>`__
- `pygfx <https://pypi.org/project/pygfx>`__
- `pyside >= 6, < 7 <https://pypi.org/project/pygfx>`__
- `scipy >= 1.8, < 2 <https://pypi.org/project/scipy>`__
- `scipy >= 1.10, < 2 <https://pypi.org/project/scipy>`__

Pypi
----
Expand Down
116 changes: 61 additions & 55 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,55 +1,61 @@
accessible-pygments==0.0.4 ; python_version >= "3.9" and python_version < "3.13"
alabaster==0.7.16 ; python_version >= "3.9" and python_version < "3.13"
babel==2.14.0 ; python_version >= "3.9" and python_version < "3.13"
beautifulsoup4==4.12.3 ; python_version >= "3.9" and python_version < "3.13"
certifi==2024.2.2 ; python_version >= "3.9" and python_version < "3.13"
cffi==1.16.0 ; python_version >= "3.9" and python_version < "3.13"
charset-normalizer==3.3.2 ; python_version >= "3.9" and python_version < "3.13"
colorama==0.4.6 ; python_version >= "3.9" and python_version < "3.13" and sys_platform == "win32"
colour-science==0.4.4 ; python_version >= "3.9" and python_version < "3.13"
contourpy==1.2.1 ; python_version >= "3.9" and python_version < "3.13"
cycler==0.12.1 ; python_version >= "3.9" and python_version < "3.13"
docutils==0.21.2 ; python_version >= "3.9" and python_version < "3.13"
fonttools==4.51.0 ; python_version >= "3.9" and python_version < "3.13"
freetype-py==2.4.0 ; python_version >= "3.9" and python_version < "3.13"
glfw==2.7.0 ; python_version >= "3.9" and python_version < "3.13"
idna==3.7 ; python_version >= "3.9" and python_version < "3.13"
imageio==2.34.1 ; python_version >= "3.9" and python_version < "3.13"
imagesize==1.4.1 ; python_version >= "3.9" and python_version < "3.13"
importlib-metadata==7.1.0 ; python_version >= "3.9" and python_version < "3.10"
importlib-resources==6.4.0 ; python_version >= "3.9" and python_version < "3.10"
jinja2==3.1.3 ; python_version >= "3.9" and python_version < "3.13"
kiwisolver==1.4.5 ; python_version >= "3.9" and python_version < "3.13"
markupsafe==2.1.5 ; python_version >= "3.9" and python_version < "3.13"
matplotlib==3.8.4 ; python_version >= "3.9" and python_version < "3.13"
networkx==2.8.8 ; python_version >= "3.9" and python_version < "3.13"
numpy==1.26.4 ; python_version >= "3.9" and python_version < "3.13"
packaging==24.0 ; python_version >= "3.9" and python_version < "3.13"
pillow==10.3.0 ; python_version >= "3.9" and python_version < "3.13"
pycparser==2.22 ; python_version >= "3.9" and python_version < "3.13"
pydata-sphinx-theme==0.15.2 ; python_version >= "3.9" and python_version < "3.13"
pygfx==0.1.18 ; python_version >= "3.9" and python_version < "3.13"
pygments==2.18.0 ; python_version >= "3.9" and python_version < "3.13"
pylinalg==0.4.1 ; python_version >= "3.9" and python_version < "3.13"
pyparsing==3.1.2 ; python_version >= "3.9" and python_version < "3.13"
python-dateutil==2.9.0.post0 ; python_version >= "3.9" and python_version < "3.13"
requests==2.31.0 ; python_version >= "3.9" and python_version < "3.13"
restructuredtext-lint==1.4.0 ; python_version >= "3.9" and python_version < "3.13"
rubicon-objc==0.4.9 ; python_version >= "3.9" and python_version < "3.13" and sys_platform == "darwin"
scipy==1.13.0 ; python_version >= "3.9" and python_version < "3.13"
six==1.16.0 ; python_version >= "3.9" and python_version < "3.13"
snowballstemmer==2.2.0 ; python_version >= "3.9" and python_version < "3.13"
soupsieve==2.5 ; python_version >= "3.9" and python_version < "3.13"
sphinx==7.3.7 ; python_version >= "3.9" and python_version < "3.13"
sphinxcontrib-applehelp==1.0.8 ; python_version >= "3.9" and python_version < "3.13"
sphinxcontrib-devhelp==1.0.6 ; python_version >= "3.9" and python_version < "3.13"
sphinxcontrib-htmlhelp==2.0.5 ; python_version >= "3.9" and python_version < "3.13"
sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.9" and python_version < "3.13"
sphinxcontrib-qthelp==1.0.7 ; python_version >= "3.9" and python_version < "3.13"
sphinxcontrib-serializinghtml==1.1.10 ; python_version >= "3.9" and python_version < "3.13"
tomli==2.0.1 ; python_version >= "3.9" and python_version < "3.11"
typing-extensions==4.11.0 ; python_version >= "3.9" and python_version < "3.13"
uharfbuzz==0.39.1 ; python_version >= "3.9" and python_version < "3.13"
urllib3==2.2.1 ; python_version >= "3.9" and python_version < "3.13"
wgpu==0.15.1 ; python_version >= "3.9" and python_version < "3.13"
zipp==3.18.1 ; python_version >= "3.9" and python_version < "3.10"
# This file was autogenerated by uv via the following command:
# uv export --no-hashes --all-extras --no-dev
accessible-pygments==0.0.5
alabaster==1.0.0
babel==2.16.0
beautifulsoup4==4.12.3
biblib-simple==0.1.2
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.4.0
colorama==0.4.6 ; sys_platform == 'win32'
colour-science==0.4.6
contourpy==1.3.0
cycler==0.12.1
docutils==0.21.2
fonttools==4.54.1
freetype-py==2.5.1
glfw==2.7.0
idna==3.10
imageio==2.35.1
imagesize==1.4.1
jinja2==3.1.4
kiwisolver==1.4.7
latexcodec==3.0.0
markupsafe==3.0.1
matplotlib==3.9.2
networkx==3.4.1
numpy==2.1.2
packaging==24.1
pillow==10.4.0
pybtex==0.24.0
pybtex-docutils==1.0.3
pycparser==2.22
pydata-sphinx-theme==0.15.4
pygfx==0.2.0
pygments==2.18.0
pylinalg==0.4.1
pyparsing==3.1.4
python-dateutil==2.9.0.post0
pyyaml==6.0.2
requests==2.32.3
restructuredtext-lint==1.4.0
rubicon-objc==0.4.9 ; sys_platform == 'darwin'
scipy==1.14.1
setuptools==75.1.0 ; python_full_version >= '3.12'
six==1.16.0
snowballstemmer==2.2.0
soupsieve==2.6
sphinx==8.1.2
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-bibtex==2.6.3
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
tomli==2.0.2 ; python_full_version < '3.11'
typing-extensions==4.12.2
uharfbuzz==0.41.0
urllib3==2.2.3
wgpu==0.15.3
Loading

0 comments on commit 0855859

Please sign in to comment.