From 085585911924072231a6f833365a8f56716a1ea8 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 13 Oct 2024 16:09:22 +1300 Subject: [PATCH] Use *uv* and *hatch* and enable *Python* 3.13. --- .github/PULL_REQUEST_TEMPLATE.md | 4 +- .../continuous-integration-documentation.yml | 14 +- ...tinuous-integration-quality-unit-tests.yml | 36 +- ...nuous-integration-static-type-checking.yml | 4 +- .gitignore | 3 +- .gitmodules | 6 - README.rst | 12 +- TODO.rst | 6 +- colour_visuals/pointer_gamut.py | 2 +- docs/installation.rst | 12 +- docs/requirements.txt | 116 +++--- pyproject.toml | 100 +++-- requirements.txt | 374 +++++++++--------- tasks.py | 28 +- 14 files changed, 377 insertions(+), 340 deletions(-) delete mode 100644 .gitmodules diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 32e3642..6562351 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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. - - + + **Documentation** diff --git a/.github/workflows/continuous-integration-documentation.yml b/.github/workflows/continuous-integration-documentation.yml index 30a4c3d..edc1b96 100644 --- a/.github/workflows/continuous-integration-documentation.yml +++ b/.github/workflows/continuous-integration-documentation.yml @@ -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: @@ -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 diff --git a/.github/workflows/continuous-integration-quality-unit-tests.yml b/.github/workflows/continuous-integration-quality-unit-tests.yml index ab4385c..95ce734 100644 --- a/.github/workflows/continuous-integration-quality-unit-tests.yml +++ b/.github/workflows/continuous-integration-quality-unit-tests.yml @@ -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: @@ -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 diff --git a/.github/workflows/continuous-integration-static-type-checking.yml b/.github/workflows/continuous-integration-static-type-checking.yml index 87918e0..57e3bde 100644 --- a/.github/workflows/continuous-integration-static-type-checking.yml +++ b/.github/workflows/continuous-integration-static-type-checking.yml @@ -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 diff --git a/.gitignore b/.gitignore index f6b3d98..09a2a69 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ .fleet .idea .ipynb_checkpoints +.python-version .sandbox .vs .vscode @@ -17,4 +18,4 @@ colour_visuals.egg-info dist docs/_build docs/generated -poetry.lock +uv.lock diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index b287c09..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "colour_visuals/resources/colour-visuals-tests-datasets"] - path = colour_visuals/resources/colour-visuals-tests-datasets - url = https://github.com/colour-science/colour-visuals-tests-datasets.git -[submodule "colour_visuals/resources/colour-visuals-examples-datasets"] - path = colour_visuals/resources/colour-visuals-examples-datasets - url = https://github.com/colour-science/colour-visuals-examples-datasets.git diff --git a/README.rst b/README.rst index cb29746..dc9250f 100644 --- a/README.rst +++ b/README.rst @@ -249,14 +249,14 @@ Installation Primary Dependencies ~~~~~~~~~~~~~~~~~~~~ -- `python >= 3.9, < 4 `__ -- `colour-science (git) `__ +- `python >= 3.10, < 3.14 `__ +- `colour-science >= 4.5 `__ +- `glfw `__ - `imageio >= 2, < 3 `__ -- `networkx >= 2.7, < 3 `__ -- `numpy >= 1.22, < 2 `__ +- `networkx >= 3, < 4 `__ +- `numpy >= 1.24, < 3 `__ - `pygfx `__ -- `pyside >= 6, < 7 `__ -- `scipy >= 1.8, < 2 `__ +- `scipy >= 1.10, < 2 `__ Pypi ~~~~ diff --git a/TODO.rst b/TODO.rst index d7f4d01..a51fd57 100644 --- a/TODO.rst +++ b/TODO.rst @@ -1,9 +1,13 @@ Colour - Visuals - TODO -=========================== +======================= TODO ---- +- colour_visuals/__init__.py + + - Line 127 : # TODO: Remove legacy printing support when deemed appropriate. + About ----- diff --git a/colour_visuals/pointer_gamut.py b/colour_visuals/pointer_gamut.py index 47ed1a3..9542b18 100644 --- a/colour_visuals/pointer_gamut.py +++ b/colour_visuals/pointer_gamut.py @@ -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, diff --git a/docs/installation.rst b/docs/installation.rst index d965c3b..7aaebf6 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -4,14 +4,14 @@ Installation Guide Primary Dependencies -------------------- -- `python >= 3.9, < 4 `__ -- `colour-science (git) `__ +- `python >= 3.10, < 3.14 `__ +- `colour-science >= 4.5 `__ +- `glfw `__ - `imageio >= 2, < 3 `__ -- `networkx >= 2.7, < 3 `__ -- `numpy >= 1.22, < 2 `__ +- `networkx >= 3, < 4 `__ +- `numpy >= 1.24, < 3 `__ - `pygfx `__ -- `pyside >= 6, < 7 `__ -- `scipy >= 1.8, < 2 `__ +- `scipy >= 1.10, < 2 `__ Pypi ---- diff --git a/docs/requirements.txt b/docs/requirements.txt index a5a0d05..ae4a883 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 8d42af4..0e8d9c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,16 @@ -[tool.poetry] +[project] name = "colour-visuals" version = "0.1.0" description = "WebGPU-based visuals for colour science applications" -license = "BSD-3-Clause" -authors = [ "Colour Developers " ] -maintainers = [ "Colour Developers " ] -readme = 'README.rst' -repository = "https://github.com/colour-science/colour-visuals" -homepage = "https://www.colour-science.org/" +readme = "README.rst" +requires-python = ">=3.10,<3.14" +authors = [ + { name = "Colour Developers", email = "colour-developers@colour-science.org" }, +] +maintainers = [ + { name = "Colour Developers", email = "colour-developers@colour-science.org" } +] +license = { text = "BSD-3-Clause" } keywords = [ "color", "color-science", @@ -37,39 +40,59 @@ classifiers = [ "Topic :: Scientific/Engineering", "Topic :: Software Development" ] +dependencies = [ + "colour-science>=0.4.5", + "glfw>=2,<3", + "imageio>=2,<3", + "networkx>=3,<4", + "numpy>=1.24,<3", + "pygfx>=0.1,<0.3", + "scipy>=1.10,<2", + "matplotlib>=3.7", +] + +[project.optional-dependencies] +docs = [ + "biblib-simple", + "pydata-sphinx-theme", + "restructuredtext-lint", + "sphinx", + "sphinxcontrib-bibtex", +] -[tool.poetry.dependencies] -python = ">= 3.9, < 3.13" -colour-science = ">= 0.4.4, < 0.5" -glfw = ">= 2, < 3" -imageio = ">= 2, < 3" -networkx = ">= 2.7, < 3" -numpy = ">= 1.22, < 2" -pygfx = ">= 0.1, < 0.3" -scipy = ">= 1.8, < 2" -matplotlib = "^3.8.1" +[project.urls] +Homepage = "https://www.colour-science.org" +Documentation = "https://colour-visuals.readthedocs.org" +Repository = "https://github.com/colour-science/colour-visuals" +Issues = "https://github.com/colour-science/colour-visuals/issues" +Changelog = "https://github.com/colour-science/colour-visuals/releases" -[tool.poetry.group.dev.dependencies] -coverage = ">= 6, < 7" -coveralls = "*" -invoke = "*" -jupyter = "*" -pre-commit = ">= 3.5" -pyright = "*" -pytest = "*" -pytest-cov = "*" -pytest-xdist = "*" -toml = "*" -twine = "*" +[tool.uv] +package = true +dev-dependencies = [ + "coverage", + "coveralls", + "hatch", + "invoke", + "jupyter", + "pre-commit", + "pyright", + "pytest", + "pytest-cov", + "pytest-xdist", + "toml", + "twine", +] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" -[tool.poetry.group.docs.dependencies] -matplotlib = ">= 3.5, != 3.5.0, != 3.5.1" -pydata-sphinx-theme = "*" -restructuredtext-lint = "*" -sphinx = "*" +[tool.hatch.build.targets.wheel] +packages = [ "colour_visuals" ] [tool.codespell] -skip = 'BIBLIOGRAPHY.bib,CONTRIBUTORS.rst' +skip = "BIBLIOGRAPHY.bib,CONTRIBUTORS.rst" [tool.flynt] line_length=999 @@ -96,7 +119,7 @@ reportUnusedExpression = false addopts = "-n auto --dist=loadscope --durations=5" [tool.ruff] -target-version = "py39" +target-version = "py310" line-length = 88 select = [ "A", # flake8-builtins @@ -173,6 +196,7 @@ ignore = [ "RET508", "TRY003", "TRY300", + "UP038", ] typing-modules = ["colour.hints"] fixable = ["B", "C", "E", "F", "PIE", "RUF", "SIM", "UP", "W"] @@ -189,7 +213,3 @@ convention = "numpy" [tool.ruff.format] docstring-code-format = true - -[build-system] -requires = [ "poetry_core>=1.0.0" ] -build-backend = "poetry.core.masonry.api" diff --git a/requirements.txt b/requirements.txt index 2aaa037..97cf435 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,180 +1,194 @@ -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" -anyio==4.3.0 ; python_version >= "3.9" and python_version < "3.13" -appnope==0.1.4 ; python_version >= "3.9" and python_version < "3.13" and platform_system == "Darwin" -argon2-cffi==23.1.0 ; python_version >= "3.9" and python_version < "3.13" -argon2-cffi-bindings==21.2.0 ; python_version >= "3.9" and python_version < "3.13" -arrow==1.3.0 ; python_version >= "3.9" and python_version < "3.13" -asttokens==2.4.1 ; python_version >= "3.9" and python_version < "3.13" -async-lru==2.0.4 ; python_version >= "3.9" and python_version < "3.13" -attrs==23.2.0 ; python_version >= "3.9" and python_version < "3.13" -babel==2.14.0 ; python_version >= "3.9" and python_version < "3.13" -backports-tarfile==1.1.1 ; python_version >= "3.9" and python_version < "3.12" -beautifulsoup4==4.12.3 ; python_version >= "3.9" and python_version < "3.13" -bleach==6.1.0 ; 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" -cfgv==3.4.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" -comm==0.2.2 ; python_version >= "3.9" and python_version < "3.13" -contourpy==1.2.1 ; python_version >= "3.9" and python_version < "3.13" -coverage==6.5.0 ; python_version >= "3.9" and python_version < "3.13" -coverage[toml]==6.5.0 ; python_version >= "3.9" and python_version < "3.13" -coveralls==4.0.0 ; python_version >= "3.9" and python_version < "3.13" -cryptography==42.0.6 ; python_version >= "3.9" and python_version < "3.13" and sys_platform == "linux" -cycler==0.12.1 ; python_version >= "3.9" and python_version < "3.13" -debugpy==1.8.1 ; python_version >= "3.9" and python_version < "3.13" -decorator==5.1.1 ; python_version >= "3.9" and python_version < "3.13" -defusedxml==0.7.1 ; python_version >= "3.9" and python_version < "3.13" -distlib==0.3.8 ; python_version >= "3.9" and python_version < "3.13" -docopt==0.6.2 ; python_version >= "3.9" and python_version < "3.13" -docutils==0.21.2 ; python_version >= "3.9" and python_version < "3.13" -exceptiongroup==1.2.1 ; python_version >= "3.9" and python_version < "3.11" -execnet==2.1.1 ; python_version >= "3.9" and python_version < "3.13" -executing==2.0.1 ; python_version >= "3.9" and python_version < "3.13" -fastjsonschema==2.19.1 ; python_version >= "3.9" and python_version < "3.13" -filelock==3.14.0 ; python_version >= "3.9" and python_version < "3.13" -fonttools==4.51.0 ; python_version >= "3.9" and python_version < "3.13" -fqdn==1.5.1 ; 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" -h11==0.14.0 ; python_version >= "3.9" and python_version < "3.13" -httpcore==1.0.5 ; python_version >= "3.9" and python_version < "3.13" -httpx==0.27.0 ; python_version >= "3.9" and python_version < "3.13" -identify==2.5.36 ; 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.13" -importlib-resources==6.4.0 ; python_version >= "3.9" and python_version < "3.10" -iniconfig==2.0.0 ; python_version >= "3.9" and python_version < "3.13" -invoke==2.2.0 ; python_version >= "3.9" and python_version < "3.13" -ipykernel==6.29.4 ; python_version >= "3.9" and python_version < "3.13" -ipython==8.18.1 ; python_version >= "3.9" and python_version < "3.13" -ipywidgets==8.1.2 ; python_version >= "3.9" and python_version < "3.13" -isoduration==20.11.0 ; python_version >= "3.9" and python_version < "3.13" -jaraco-classes==3.4.0 ; python_version >= "3.9" and python_version < "3.13" -jaraco-context==5.3.0 ; python_version >= "3.9" and python_version < "3.13" -jaraco-functools==4.0.1 ; python_version >= "3.9" and python_version < "3.13" -jedi==0.19.1 ; python_version >= "3.9" and python_version < "3.13" -jeepney==0.8.0 ; python_version >= "3.9" and python_version < "3.13" and sys_platform == "linux" -jinja2==3.1.3 ; python_version >= "3.9" and python_version < "3.13" -json5==0.9.25 ; python_version >= "3.9" and python_version < "3.13" -jsonpointer==2.4 ; python_version >= "3.9" and python_version < "3.13" -jsonschema==4.22.0 ; python_version >= "3.9" and python_version < "3.13" -jsonschema-specifications==2023.12.1 ; python_version >= "3.9" and python_version < "3.13" -jsonschema[format-nongpl]==4.22.0 ; python_version >= "3.9" and python_version < "3.13" -jupyter==1.0.0 ; python_version >= "3.9" and python_version < "3.13" -jupyter-client==8.6.1 ; python_version >= "3.9" and python_version < "3.13" -jupyter-console==6.6.3 ; python_version >= "3.9" and python_version < "3.13" -jupyter-core==5.7.2 ; python_version >= "3.9" and python_version < "3.13" -jupyter-events==0.10.0 ; python_version >= "3.9" and python_version < "3.13" -jupyter-lsp==2.2.5 ; python_version >= "3.9" and python_version < "3.13" -jupyter-server==2.14.0 ; python_version >= "3.9" and python_version < "3.13" -jupyter-server-terminals==0.5.3 ; python_version >= "3.9" and python_version < "3.13" -jupyterlab==4.1.8 ; python_version >= "3.9" and python_version < "3.13" -jupyterlab-pygments==0.3.0 ; python_version >= "3.9" and python_version < "3.13" -jupyterlab-server==2.27.1 ; python_version >= "3.9" and python_version < "3.13" -jupyterlab-widgets==3.0.10 ; python_version >= "3.9" and python_version < "3.13" -keyring==25.2.0 ; python_version >= "3.9" and python_version < "3.13" -kiwisolver==1.4.5 ; python_version >= "3.9" and python_version < "3.13" -markdown-it-py==3.0.0 ; 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" -matplotlib-inline==0.1.7 ; python_version >= "3.9" and python_version < "3.13" -mdurl==0.1.2 ; python_version >= "3.9" and python_version < "3.13" -mistune==3.0.2 ; python_version >= "3.9" and python_version < "3.13" -more-itertools==10.2.0 ; python_version >= "3.9" and python_version < "3.13" -nbclient==0.10.0 ; python_version >= "3.9" and python_version < "3.13" -nbconvert==7.16.4 ; python_version >= "3.9" and python_version < "3.13" -nbformat==5.10.4 ; python_version >= "3.9" and python_version < "3.13" -nest-asyncio==1.6.0 ; python_version >= "3.9" and python_version < "3.13" -networkx==2.8.8 ; python_version >= "3.9" and python_version < "3.13" -nh3==0.2.17 ; python_version >= "3.9" and python_version < "3.13" -nodeenv==1.8.0 ; python_version >= "3.9" and python_version < "3.13" -notebook==7.1.3 ; python_version >= "3.9" and python_version < "3.13" -notebook-shim==0.2.4 ; python_version >= "3.9" and python_version < "3.13" -numpy==1.26.4 ; python_version >= "3.9" and python_version < "3.13" -overrides==7.7.0 ; python_version >= "3.9" and python_version < "3.13" -packaging==24.0 ; python_version >= "3.9" and python_version < "3.13" -pandocfilters==1.5.1 ; python_version >= "3.9" and python_version < "3.13" -parso==0.8.4 ; python_version >= "3.9" and python_version < "3.13" -pexpect==4.9.0 ; python_version >= "3.9" and python_version < "3.13" and sys_platform != "win32" -pillow==10.3.0 ; python_version >= "3.9" and python_version < "3.13" -pkginfo==1.10.0 ; python_version >= "3.9" and python_version < "3.13" -platformdirs==4.2.1 ; python_version >= "3.9" and python_version < "3.13" -pluggy==1.5.0 ; python_version >= "3.9" and python_version < "3.13" -pre-commit==3.7.0 ; python_version >= "3.9" and python_version < "3.13" -prometheus-client==0.20.0 ; python_version >= "3.9" and python_version < "3.13" -prompt-toolkit==3.0.43 ; python_version >= "3.9" and python_version < "3.13" -psutil==5.9.8 ; python_version >= "3.9" and python_version < "3.13" -ptyprocess==0.7.0 ; python_version >= "3.9" and python_version < "3.13" and (sys_platform != "win32" or os_name != "nt") -pure-eval==0.2.2 ; 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" -pyright==1.1.361 ; python_version >= "3.9" and python_version < "3.13" -pytest==8.2.0 ; python_version >= "3.9" and python_version < "3.13" -pytest-cov==5.0.0 ; python_version >= "3.9" and python_version < "3.13" -pytest-xdist==3.6.1 ; python_version >= "3.9" and python_version < "3.13" -python-dateutil==2.9.0.post0 ; python_version >= "3.9" and python_version < "3.13" -python-json-logger==2.0.7 ; python_version >= "3.9" and python_version < "3.13" -pywin32==306 ; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.9" and python_version < "3.13" -pywin32-ctypes==0.2.2 ; python_version >= "3.9" and python_version < "3.13" and sys_platform == "win32" -pywinpty==2.0.13 ; python_version >= "3.9" and python_version < "3.13" and os_name == "nt" -pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "3.13" -pyzmq==26.0.3 ; python_version >= "3.9" and python_version < "3.13" -qtconsole==5.5.1 ; python_version >= "3.9" and python_version < "3.13" -qtpy==2.4.1 ; python_version >= "3.9" and python_version < "3.13" -readme-renderer==43.0 ; python_version >= "3.9" and python_version < "3.13" -referencing==0.35.1 ; python_version >= "3.9" and python_version < "3.13" -requests==2.31.0 ; python_version >= "3.9" and python_version < "3.13" -requests-toolbelt==1.0.0 ; python_version >= "3.9" and python_version < "3.13" -restructuredtext-lint==1.4.0 ; python_version >= "3.9" and python_version < "3.13" -rfc3339-validator==0.1.4 ; python_version >= "3.9" and python_version < "3.13" -rfc3986==2.0.0 ; python_version >= "3.9" and python_version < "3.13" -rfc3986-validator==0.1.1 ; python_version >= "3.9" and python_version < "3.13" -rich==13.7.1 ; python_version >= "3.9" and python_version < "3.13" -rpds-py==0.18.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" -secretstorage==3.3.3 ; python_version >= "3.9" and python_version < "3.13" and sys_platform == "linux" -send2trash==1.8.3 ; python_version >= "3.9" and python_version < "3.13" -setuptools==69.5.1 ; python_version >= "3.9" and python_version < "3.13" -six==1.16.0 ; python_version >= "3.9" and python_version < "3.13" -sniffio==1.3.1 ; 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" -stack-data==0.6.3 ; python_version >= "3.9" and python_version < "3.13" -terminado==0.18.1 ; python_version >= "3.9" and python_version < "3.13" -tinycss2==1.3.0 ; python_version >= "3.9" and python_version < "3.13" -toml==0.10.2 ; python_version >= "3.9" and python_version < "3.13" -tomli==2.0.1 ; python_version >= "3.9" and python_full_version <= "3.11.0a6" -tornado==6.4 ; python_version >= "3.9" and python_version < "3.13" -traitlets==5.14.3 ; python_version >= "3.9" and python_version < "3.13" -twine==5.0.0 ; python_version >= "3.9" and python_version < "3.13" -types-python-dateutil==2.9.0.20240316 ; python_version >= "3.9" and python_version < "3.13" -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" -uri-template==1.3.0 ; python_version >= "3.9" and python_version < "3.13" -urllib3==2.2.1 ; python_version >= "3.9" and python_version < "3.13" -virtualenv==20.26.1 ; python_version >= "3.9" and python_version < "3.13" -wcwidth==0.2.13 ; python_version >= "3.9" and python_version < "3.13" -webcolors==1.13 ; python_version >= "3.9" and python_version < "3.13" -webencodings==0.5.1 ; python_version >= "3.9" and python_version < "3.13" -websocket-client==1.8.0 ; python_version >= "3.9" and python_version < "3.13" -wgpu==0.15.1 ; python_version >= "3.9" and python_version < "3.13" -widgetsnbextension==4.0.10 ; python_version >= "3.9" and python_version < "3.13" -zipp==3.18.1 ; python_version >= "3.9" and python_version < "3.13" +# This file was autogenerated by uv via the following command: +# uv export --no-hashes --all-extras +accessible-pygments==0.0.5 +alabaster==1.0.0 +anyio==4.6.0 +appnope==0.1.4 ; platform_system == 'Darwin' +argon2-cffi==23.1.0 +argon2-cffi-bindings==21.2.0 +arrow==1.3.0 +asttokens==2.4.1 +async-lru==2.0.4 +attrs==24.2.0 +babel==2.16.0 +backports-tarfile==1.2.0 ; python_full_version < '3.12' +beautifulsoup4==4.12.3 +biblib-simple==0.1.2 +bleach==6.1.0 +certifi==2024.8.30 +cffi==1.17.1 +cfgv==3.4.0 +charset-normalizer==3.4.0 +click==8.1.7 +colorama==0.4.6 ; sys_platform == 'win32' or platform_system == 'Windows' +colour-science==0.4.6 +comm==0.2.2 +contourpy==1.3.0 +coverage==7.6.2 +coveralls==4.0.1 +cryptography==43.0.1 ; sys_platform == 'linux' +cycler==0.12.1 +debugpy==1.8.7 +decorator==5.1.1 +defusedxml==0.7.1 +distlib==0.3.9 +docopt==0.6.2 +docutils==0.21.2 +exceptiongroup==1.2.2 ; python_full_version < '3.11' +execnet==2.1.1 +executing==2.1.0 +fastjsonschema==2.20.0 +filelock==3.16.1 +fonttools==4.54.1 +fqdn==1.5.1 +freetype-py==2.5.1 +glfw==2.7.0 +h11==0.14.0 +hatch==1.12.0 +hatchling==1.25.0 +httpcore==1.0.6 +httpx==0.27.2 +hyperlink==21.0.0 +identify==2.6.1 +idna==3.10 +imageio==2.35.1 +imagesize==1.4.1 +importlib-metadata==8.5.0 +iniconfig==2.0.0 +invoke==2.2.0 +ipykernel==6.29.5 +ipython==8.28.0 +ipywidgets==8.1.5 +isoduration==20.11.0 +jaraco-classes==3.4.0 +jaraco-context==6.0.1 +jaraco-functools==4.1.0 +jedi==0.19.1 +jeepney==0.8.0 ; sys_platform == 'linux' +jinja2==3.1.4 +json5==0.9.25 +jsonpointer==3.0.0 +jsonschema==4.23.0 +jsonschema-specifications==2024.10.1 +jupyter==1.1.1 +jupyter-client==8.6.3 +jupyter-console==6.6.3 +jupyter-core==5.7.2 +jupyter-events==0.10.0 +jupyter-lsp==2.2.5 +jupyter-server==2.14.2 +jupyter-server-terminals==0.5.3 +jupyterlab==4.2.5 +jupyterlab-pygments==0.3.0 +jupyterlab-server==2.27.3 +jupyterlab-widgets==3.0.13 +keyring==25.4.1 +kiwisolver==1.4.7 +latexcodec==3.0.0 +markdown-it-py==3.0.0 +markupsafe==3.0.1 +matplotlib==3.9.2 +matplotlib-inline==0.1.7 +mdurl==0.1.2 +mistune==3.0.2 +more-itertools==10.5.0 +nbclient==0.10.0 +nbconvert==7.16.4 +nbformat==5.10.4 +nest-asyncio==1.6.0 +networkx==3.4.1 +nh3==0.2.18 +nodeenv==1.9.1 +notebook==7.2.2 +notebook-shim==0.2.4 +numpy==2.1.2 +overrides==7.7.0 +packaging==24.1 +pandocfilters==1.5.1 +parso==0.8.4 +pathspec==0.12.1 +pexpect==4.9.0 +pillow==10.4.0 +pkginfo==1.10.0 +platformdirs==4.3.6 +pluggy==1.5.0 +pre-commit==4.0.1 +prometheus-client==0.21.0 +prompt-toolkit==3.0.48 +psutil==6.0.0 +ptyprocess==0.7.0 +pure-eval==0.2.3 +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 +pyright==1.1.384 +pytest==8.3.3 +pytest-cov==5.0.0 +pytest-xdist==3.6.1 +python-dateutil==2.9.0.post0 +python-json-logger==2.0.7 +pywin32==308 ; platform_python_implementation != 'PyPy' and sys_platform == 'win32' +pywin32-ctypes==0.2.3 ; sys_platform == 'win32' +pywinpty==2.0.13 ; os_name == 'nt' +pyyaml==6.0.2 +pyzmq==26.2.0 +readme-renderer==44.0 +referencing==0.35.1 +requests==2.32.3 +requests-toolbelt==1.0.0 +restructuredtext-lint==1.4.0 +rfc3339-validator==0.1.4 +rfc3986==2.0.0 +rfc3986-validator==0.1.1 +rich==13.9.2 +rpds-py==0.20.0 +rubicon-objc==0.4.9 ; sys_platform == 'darwin' +scipy==1.14.1 +secretstorage==3.3.3 ; sys_platform == 'linux' +send2trash==1.8.3 +setuptools==75.1.0 +shellingham==1.5.4 +six==1.16.0 +sniffio==1.3.1 +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 +stack-data==0.6.3 +terminado==0.18.1 +tinycss2==1.3.0 +toml==0.10.2 +tomli==2.0.2 ; python_full_version <= '3.11' +tomli-w==1.1.0 +tomlkit==0.13.2 +tornado==6.4.1 +traitlets==5.14.3 +trove-classifiers==2024.10.12 +twine==5.1.1 +types-python-dateutil==2.9.0.20241003 +typing-extensions==4.12.2 +uharfbuzz==0.41.0 +uri-template==1.3.0 +urllib3==2.2.3 +userpath==1.9.2 +uv==0.4.20 +virtualenv==20.26.6 +wcwidth==0.2.13 +webcolors==24.8.0 +webencodings==0.5.1 +websocket-client==1.8.0 +wgpu==0.15.3 +widgetsnbextension==4.0.13 +zipp==3.20.2 +zstandard==0.23.0 diff --git a/tasks.py b/tasks.py index b66dfa6..0fdde0b 100644 --- a/tasks.py +++ b/tasks.py @@ -149,7 +149,7 @@ def quality( if pyright: message_box('Checking codebase with "Pyright"...') - ctx.run("pyright --skipunannotated --level warning") + ctx.run("pyright --threads --skipunannotated --level warning") if rstlint: message_box('Linting "README.rst" file...') @@ -293,19 +293,12 @@ def requirements(ctx: Context): """ message_box('Exporting "requirements.txt" file...') - ctx.run( - "poetry export -f requirements.txt " - "--without-hashes " - "--with dev,docs " - "--output requirements.txt" - ) + ctx.run('uv export --no-hashes --all-extras | grep -v "-e \\." > requirements.txt') message_box('Exporting "docs/requirements.txt" file...') ctx.run( - "poetry export -f requirements.txt " - "--without-hashes " - "--with docs " - "--output docs/requirements.txt" + 'uv export --no-hashes --all-extras --no-dev | grep -v "-e \\." > ' + "docs/requirements.txt" ) @@ -322,7 +315,7 @@ def build(ctx: Context): """ message_box("Building...") - ctx.run("poetry build") + ctx.run("uv build") ctx.run("twine check dist/*") @@ -351,15 +344,18 @@ def virtualise(ctx: Context, tests: bool = True): ) with ctx.cd(unique_name): - ctx.run("poetry install") - ctx.run("source $(poetry env info -p)/bin/activate") - ctx.run('python -c "import imageio;imageio.plugins.freeimage.download()"') + ctx.run("uv sync --all-extras --no-dev") + ctx.run( + 'uv run python -c "import imageio;imageio.plugins.freeimage.download()"' + ) if tests: ctx.run( - "poetry run pytest " + "source .venv/bin/activate && " + "uv run pytest " "--doctest-modules " f"--ignore={PYTHON_PACKAGE_NAME}/examples " f"{PYTHON_PACKAGE_NAME}", + env={"MPLBACKEND": "AGG"}, )