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 e4666c2..67bd815 100644 --- a/.github/workflows/continuous-integration-documentation.yml +++ b/.github/workflows/continuous-integration-documentation.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.12] + python-version: [3.13] fail-fast: false runs-on: ${{ matrix.os }} steps: @@ -29,18 +29,16 @@ jobs: run: | sudo apt-get update sudo apt-get --yes install 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 diff --git a/.github/workflows/continuous-integration-quality-unit-tests.yml b/.github/workflows/continuous-integration-quality-unit-tests.yml index 4324405..067f5f1 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: [ubuntu-latest] - python-version: [3.12] + python-version: [3.13] fail-fast: false runs-on: ${{ matrix.os }} steps: @@ -20,37 +20,36 @@ 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 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 + 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: | - 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 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 90b090d..1349901 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 8c55073..43f367b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ .fleet .idea .ipynb_checkpoints +.python-version .sandbox .vs .vscode @@ -18,4 +19,4 @@ docs/_build docs/generated references zenodo -poetry.lock +uv.lock diff --git a/README.rst b/README.rst index 0d6561e..360ec05 100644 --- a/README.rst +++ b/README.rst @@ -160,14 +160,14 @@ Primary Dependencies **Colour - Datasets** requires various dependencies in order to run: -- `python >= 3.9, < 4 `__ +- `python >= 3.10, < 3.14 `__ - `cachetools `__ -- `colour-science >= 4.3 `__ +- `colour-science >= 4.4 `__ - `imageio >= 2, < 3 `__ -- `numpy >= 1.22, < 2 `__ -- `scipy >= 1.8, < 2 `__ +- `numpy >= 1.24, < 3 `__ +- `scipy >= 1.10, < 2 `__ - `tqdm `__ -- `xlrd `__ +- `xlrd >=1.2, <2 `__ Pypi ~~~~ diff --git a/TODO.rst b/TODO.rst index 2a1649f..2395031 100644 --- a/TODO.rst +++ b/TODO.rst @@ -6,34 +6,34 @@ TODO - colour_datasets/__init__.py - - Line 78 : # TODO: Remove legacy printing support when deemed appropriate. + - Line 74 : # TODO: Remove legacy printing support when deemed appropriate. - colour_datasets/records/zenodo.py - - Line 450 : # TODO: Remove the following space escaping: The new Zenodo API is not quoting filenames properly thus we are temporarily escaping spaces for now. https://github.com/colour-science/colour-datasets/issues/ 36issuecomment-1773464695 + - Line 433 : # TODO: Remove the following space escaping: The new Zenodo API is not quoting filenames properly thus we are temporarily escaping spaces for now. https://github.com/colour-science/colour-datasets/issues/ 36issuecomment-1773464695 - colour_datasets/utilities/common.py - - Line 42 : # TODO: Use *colour* definition. + - Line 43 : # TODO: Use *colour* definition. - colour_datasets/loaders/kuopio.py - - Line 310 : # TODO: Implement support for *Natural Colors*: https://sandbox.zenodo.org/record/315640 http://www.uef.fi/web/spectral/natural-colors + - Line 304 : # TODO: Implement support for *Natural Colors*: https://sandbox.zenodo.org/record/315640 http://www.uef.fi/web/spectral/natural-colors - colour_datasets/loaders/xrite2016.py - - Line 109 : # TODO: Implement support for "CGATS" file format in "Colour": https://github.com/colour-science/colour/issues/354 + - Line 108 : # TODO: Implement support for "CGATS" file format in "Colour": https://github.com/colour-science/colour/issues/354 - colour_datasets/loaders/dyer2017.py - Line 141 : # TODO: Re-instate "manufacturer", "model", "illuminant" and "type" attributes according to outcome of https://github.com/ampas/rawtoaces/issues/114. Those attributes are currently stored in "self._kwargs". - - Line 928 : # TODO: Re-instate "manufacturer", "model", "illuminant" and "type" attributes according to outcome of https://github.com/ampas/rawtoaces/issues/114. - - Line 1430 : # TODO: Re-instate "manufacturer", "model", "illuminant" and "type" attributes according to outcome of https://github.com/ampas/rawtoaces/issues/114. + - Line 923 : # TODO: Re-instate "manufacturer", "model", "illuminant" and "type" attributes according to outcome of https://github.com/ampas/rawtoaces/issues/114. + - Line 1420 : # TODO: Re-instate "manufacturer", "model", "illuminant" and "type" attributes according to outcome of https://github.com/ampas/rawtoaces/issues/114. About ----- diff --git a/colour_datasets/records/zenodo.py b/colour_datasets/records/zenodo.py index 190b3d4..bcf01ce 100644 --- a/colour_datasets/records/zenodo.py +++ b/colour_datasets/records/zenodo.py @@ -668,7 +668,7 @@ def __repr__(self) -> str: Community( {'community': {'access': {'member_policy': 'open', 'members_visibility': 'public', - 'record_policy': 'open', + 'record_submission_policy': 'open', """ data = "\n".join([f" {line}" for line in pformat(self._data).splitlines()]) diff --git a/colour_datasets/utilities/common.py b/colour_datasets/utilities/common.py index ea9b81e..dc7b0ae 100644 --- a/colour_datasets/utilities/common.py +++ b/colour_datasets/utilities/common.py @@ -13,6 +13,7 @@ import json import os import shutil +import socket import sys import urllib.error import urllib.request @@ -158,12 +159,17 @@ def url_download(url: str, filename: str, md5: str | None = None, retries: int = miniters=1, desc=f'Downloading "{url}" url', ) as progress: - urllib.request.urlretrieve( # noqa: S310 - url, - filename=filename, - reporthook=progress.update_to, - data=None, - ) + timeout = socket.getdefaulttimeout() + try: + socket.setdefaulttimeout(10) + urllib.request.urlretrieve( # noqa: S310 + url, + filename=filename, + reporthook=progress.update_to, + data=None, + ) + finally: + socket.setdefaulttimeout(timeout) if md5 is not None and md5.lower() != hash_md5(filename): raise ValueError( # noqa: TRY301 diff --git a/docs/installation.rst b/docs/installation.rst index a5a76c5..c4a42d4 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -6,14 +6,14 @@ Primary Dependencies **Colour - Datasets** requires various dependencies in order to run: -- `python >= 3.9, < 4 `__ +- `python >= 3.10, < 3.14 `__ - `cachetools `__ -- `colour-science >= 4.3 `__ +- `colour-science >= 4.4 `__ - `imageio >= 2, < 3 `__ -- `numpy >= 1.22, < 2 `__ -- `scipy >= 1.8, < 2 `__ +- `numpy >= 1.24, < 3 `__ +- `scipy >= 1.10, < 2 `__ - `tqdm `__ -- `xlrd `__ +- `xlrd >=1.2, <2 `__ Pypi ---- diff --git a/docs/requirements.txt b/docs/requirements.txt index 84020f9..da90e31 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,46 +1,55 @@ -accessible-pygments==0.0.4 ; python_version >= "3.9" and python_version < "3.13" -alabaster==0.7.13 ; 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.2 ; python_version >= "3.9" and python_version < "3.13" -biblib-simple==0.1.2 ; python_version >= "3.9" and python_version < "3.13" -cachetools==5.3.2 ; python_version >= "3.9" and python_version < "3.13" -certifi==2023.11.17 ; 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 (platform_system == "Windows" or sys_platform == "win32") -colour-science==0.4.4 ; python_version >= "3.9" and python_version < "3.13" -docutils==0.20.1 ; python_version >= "3.9" and python_version < "3.13" -idna==3.6 ; python_version >= "3.9" and python_version < "3.13" -imageio==2.33.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.0.0 ; python_version >= "3.9" and python_version < "3.10" -jinja2==3.1.2 ; python_version >= "3.9" and python_version < "3.13" -latexcodec==2.0.1 ; python_version >= "3.9" and python_version < "3.13" -markupsafe==2.1.3 ; python_version >= "3.9" and python_version < "3.13" -numpy==1.26.2 ; python_version >= "3.9" and python_version < "3.13" -opencv-python==4.8.1.78 ; python_version >= "3.9" and python_version < "3.13" -packaging==23.2 ; python_version >= "3.9" and python_version < "3.13" -pillow==10.1.0 ; python_version >= "3.9" and python_version < "3.13" -pybtex==0.24.0 ; python_version >= "3.9" and python_version < "3.13" -pybtex-docutils==1.0.3 ; python_version >= "3.9" and python_version < "3.13" -pydata-sphinx-theme==0.14.4 ; python_version >= "3.9" and python_version < "3.13" -pygments==2.17.2 ; python_version >= "3.9" and python_version < "3.13" -pyyaml==6.0.1 ; 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" -scipy==1.11.4 ; 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.2.6 ; python_version >= "3.9" and python_version < "3.13" -sphinxcontrib-applehelp==1.0.7 ; python_version >= "3.9" and python_version < "3.13" -sphinxcontrib-bibtex==2.6.1 ; python_version >= "3.9" and python_version < "3.13" -sphinxcontrib-devhelp==1.0.5 ; python_version >= "3.9" and python_version < "3.13" -sphinxcontrib-htmlhelp==2.0.4 ; 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.6 ; python_version >= "3.9" and python_version < "3.13" -sphinxcontrib-serializinghtml==1.1.9 ; python_version >= "3.9" and python_version < "3.13" -tqdm==4.66.1 ; python_version >= "3.9" and python_version < "3.13" -typing-extensions==4.9.0 ; python_version >= "3.9" and python_version < "3.13" -urllib3==2.1.0 ; python_version >= "3.9" and python_version < "3.13" -xlrd==1.2.0 ; python_version >= "3.9" and python_version < "3.13" -zipp==3.17.0 ; 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 +cachetools==5.5.0 +certifi==2024.8.30 +charset-normalizer==3.4.0 +colorama==0.4.6 ; sys_platform == 'win32' or platform_system == 'Windows' +colour-science==0.4.6 +contourpy==1.3.0 +cycler==0.12.1 +docutils==0.21.2 +fonttools==4.54.1 +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 +numpy==2.1.2 +opencv-python==4.10.0.84 +packaging==24.1 +pillow==10.4.0 +pybtex==0.24.0 +pybtex-docutils==1.0.3 +pydata-sphinx-theme==0.15.4 +pygments==2.18.0 +pyparsing==3.1.4 +python-dateutil==2.9.0.post0 +pyyaml==6.0.2 +requests==2.32.3 +restructuredtext-lint==1.4.0 +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' +tqdm==4.66.5 +typing-extensions==4.12.2 +urllib3==2.2.3 +xlrd==1.2.0 diff --git a/pyproject.toml b/pyproject.toml index 0687e6f..0ee1d44 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,16 @@ -[tool.poetry] +[project] name = "colour-datasets" version = "0.2.5" description = "Colour science datasets for use with Colour" -license = "BSD-3-Clause" -authors = [ "Colour Developers " ] -maintainers = [ "Colour Developers " ] -readme = 'README.rst' -repository = "https://github.com/colour-science/colour-datasets" -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", @@ -41,42 +44,64 @@ classifiers = [ "Topic :: Scientific/Engineering", "Topic :: Software Development" ] +dependencies = [ + "cachetools", + "colour-science>=0.4.4", + "imageio>=2,<3", + "numpy>=1.24,<3", + "opencv-python>=4,<5", + "scipy>=1.10,<2", + "tqdm", + "typing-extensions>=4,<5", + "xlrd>=1.2,<2", +] -[tool.poetry.dependencies] -python = ">= 3.9, < 3.13" -cachetools = "*" -colour-science = ">= 0.4.4" -imageio = ">= 2, < 3" -numpy = ">= 1.22, < 2" -opencv-python = ">= 4, < 5" -scipy = ">= 1.8, < 2" -tqdm = "*" -typing-extensions = ">= 4, < 5" -xlrd = ">= 1.2, < 2" +[project.optional-dependencies] +optional = [ + "matplotlib>=3.7", +] +docs = [ + "biblib-simple", + "pydata-sphinx-theme", + "restructuredtext-lint", + "sphinx", + "sphinxcontrib-bibtex", +] -[tool.poetry.group.dev.dependencies] -coverage = ">= 6, < 7" -coveralls = "*" -invoke = "*" -jupyter = "*" -pre-commit = ">= 3.5" -pyright = "*" -pytest = "*" -pytest-cov = "*" -pytest-xdist = "*" -toml = "*" -twine = "*" +[project.urls] +Homepage = "https://www.colour-science.org" +Documentation = "https://colour-datasets.readthedocs.org" +Repository = "https://github.com/colour-science/colour-datasets" +Issues = "https://github.com/colour-science/colour-datasets/issues" +Changelog = "https://github.com/colour-science/colour-datasets/releases" -[tool.poetry.group.docs.dependencies] -biblib-simple = "*" -pydata-sphinx-theme = "*" -restructuredtext-lint = "*" -sphinx = "*" -sphinxcontrib-bibtex = "*" +[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.hatch.build.targets.wheel] +packages = [ "colour_datasets" ] [tool.codespell] -ignore-words-list = 'exitance,seperately' -skip = 'BIBLIOGRAPHY.bib,CONTRIBUTORS.rst' +ignore-words-list = "exitance,seperately" +skip = "BIBLIOGRAPHY.bib,CONTRIBUTORS.rst" [tool.flynt] line_length=999 @@ -198,7 +223,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 5dd6bd1..58ca8da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,168 +1,190 @@ -accessible-pygments==0.0.4 ; python_version >= "3.9" and python_version < "3.13" -alabaster==0.7.13 ; python_version >= "3.9" and python_version < "3.13" -anyio==4.2.0 ; python_version >= "3.9" and python_version < "3.13" -appnope==0.1.3 ; 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.1.0 ; 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.2 ; python_version >= "3.9" and python_version < "3.13" -biblib-simple==0.1.2 ; python_version >= "3.9" and python_version < "3.13" -bleach==6.1.0 ; python_version >= "3.9" and python_version < "3.13" -cachetools==5.3.2 ; python_version >= "3.9" and python_version < "3.13" -certifi==2023.11.17 ; 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 (platform_system == "Windows" or sys_platform == "win32") -colour-science==0.4.4 ; python_version >= "3.9" and python_version < "3.13" -comm==0.2.0 ; python_version >= "3.9" and python_version < "3.13" -coverage==7.3.3 ; python_version >= "3.9" and python_version < "3.13" -coverage[toml]==7.3.3 ; python_version >= "3.9" and python_version < "3.13" -coveralls==1.8.0 ; python_version >= "3.9" and python_version < "3.13" -cryptography==41.0.7 ; python_version >= "3.9" and python_version < "3.13" and sys_platform == "linux" -debugpy==1.8.0 ; 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.20.1 ; python_version >= "3.9" and python_version < "3.13" -exceptiongroup==1.2.0 ; python_version >= "3.9" and python_version < "3.11" -execnet==2.0.2 ; 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.0 ; python_version >= "3.9" and python_version < "3.13" -filelock==3.13.1 ; python_version >= "3.9" and python_version < "3.13" -fqdn==1.5.1 ; python_version >= "3.9" and python_version < "3.13" -identify==2.5.33 ; python_version >= "3.9" and python_version < "3.13" -idna==3.6 ; python_version >= "3.9" and python_version < "3.13" -imageio==2.33.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.0.0 ; python_version >= "3.9" and python_version < "3.13" -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.27.1 ; 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.1 ; 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.3.0 ; 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.2 ; python_version >= "3.9" and python_version < "3.13" -json5==0.9.14 ; python_version >= "3.9" and python_version < "3.13" -jsonpointer==2.4 ; python_version >= "3.9" and python_version < "3.13" -jsonschema==4.20.0 ; python_version >= "3.9" and python_version < "3.13" -jsonschema-specifications==2023.11.2 ; python_version >= "3.9" and python_version < "3.13" -jsonschema[format-nongpl]==4.20.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.0 ; 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.5.1 ; python_version >= "3.9" and python_version < "3.13" -jupyter-events==0.9.0 ; python_version >= "3.9" and python_version < "3.13" -jupyter-lsp==2.2.1 ; python_version >= "3.9" and python_version < "3.13" -jupyter-server==2.12.1 ; python_version >= "3.9" and python_version < "3.13" -jupyter-server-terminals==0.5.0 ; python_version >= "3.9" and python_version < "3.13" -jupyterlab==4.0.9 ; 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.25.2 ; python_version >= "3.9" and python_version < "3.13" -jupyterlab-widgets==3.0.9 ; python_version >= "3.9" and python_version < "3.13" -keyring==24.3.0 ; python_version >= "3.9" and python_version < "3.13" -latexcodec==2.0.1 ; 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.3 ; python_version >= "3.9" and python_version < "3.13" -matplotlib-inline==0.1.6 ; 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.1.0 ; python_version >= "3.9" and python_version < "3.13" -nbclient==0.9.0 ; python_version >= "3.9" and python_version < "3.13" -nbconvert==7.13.0 ; python_version >= "3.9" and python_version < "3.13" -nbformat==5.9.2 ; python_version >= "3.9" and python_version < "3.13" -nest-asyncio==1.5.8 ; python_version >= "3.9" and python_version < "3.13" -nh3==0.2.15 ; python_version >= "3.9" and python_version < "3.13" -nodeenv==1.8.0 ; python_version >= "3.9" and python_version < "3.13" -notebook==7.0.6 ; python_version >= "3.9" and python_version < "3.13" -notebook-shim==0.2.3 ; python_version >= "3.9" and python_version < "3.13" -numpy==1.26.2 ; python_version >= "3.9" and python_version < "3.13" -opencv-python==4.8.1.78 ; python_version >= "3.9" and python_version < "3.13" -overrides==7.4.0 ; python_version >= "3.9" and python_version < "3.13" -packaging==23.2 ; python_version >= "3.9" and python_version < "3.13" -pandocfilters==1.5.0 ; python_version >= "3.9" and python_version < "3.13" -parso==0.8.3 ; 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.1.0 ; python_version >= "3.9" and python_version < "3.13" -pkginfo==1.9.6 ; python_version >= "3.9" and python_version < "3.13" -platformdirs==4.1.0 ; python_version >= "3.9" and python_version < "3.13" -pluggy==1.3.0 ; python_version >= "3.9" and python_version < "3.13" -pre-commit==3.6.0 ; python_version >= "3.9" and python_version < "3.13" -prometheus-client==0.19.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.7 ; 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" -pybtex==0.24.0 ; python_version >= "3.9" and python_version < "3.13" -pybtex-docutils==1.0.3 ; python_version >= "3.9" and python_version < "3.13" -pycparser==2.21 ; python_version >= "3.9" and python_version < "3.13" -pydata-sphinx-theme==0.14.4 ; python_version >= "3.9" and python_version < "3.13" -pygments==2.17.2 ; python_version >= "3.9" and python_version < "3.13" -pyright==1.1.341 ; python_version >= "3.9" and python_version < "3.13" -pytest==7.4.3 ; python_version >= "3.9" and python_version < "3.13" -pytest-cov==4.1.0 ; python_version >= "3.9" and python_version < "3.13" -pytest-xdist==3.5.0 ; python_version >= "3.9" and python_version < "3.13" -python-dateutil==2.8.2 ; 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.12 ; 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==25.1.2 ; 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==42.0 ; python_version >= "3.9" and python_version < "3.13" -referencing==0.32.0 ; 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.0 ; python_version >= "3.9" and python_version < "3.13" -rpds-py==0.15.2 ; python_version >= "3.9" and python_version < "3.13" -scipy==1.11.4 ; 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.2 ; python_version >= "3.9" and python_version < "3.13" -setuptools==69.0.2 ; 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.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.2.6 ; python_version >= "3.9" and python_version < "3.13" -sphinxcontrib-applehelp==1.0.7 ; python_version >= "3.9" and python_version < "3.13" -sphinxcontrib-bibtex==2.6.1 ; python_version >= "3.9" and python_version < "3.13" -sphinxcontrib-devhelp==1.0.5 ; python_version >= "3.9" and python_version < "3.13" -sphinxcontrib-htmlhelp==2.0.4 ; 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.6 ; python_version >= "3.9" and python_version < "3.13" -sphinxcontrib-serializinghtml==1.1.9 ; 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.0 ; python_version >= "3.9" and python_version < "3.13" -tinycss2==1.2.1 ; 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" -tqdm==4.66.1 ; python_version >= "3.9" and python_version < "3.13" -traitlets==5.14.0 ; python_version >= "3.9" and python_version < "3.13" -twine==4.0.2 ; python_version >= "3.9" and python_version < "3.13" -types-python-dateutil==2.8.19.14 ; python_version >= "3.9" and python_version < "3.13" -typing-extensions==4.9.0 ; 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.1.0 ; python_version >= "3.9" and python_version < "3.13" -virtualenv==20.25.0 ; python_version >= "3.9" and python_version < "3.13" -wcwidth==0.2.12 ; 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.7.0 ; python_version >= "3.9" and python_version < "3.13" -widgetsnbextension==4.0.9 ; python_version >= "3.9" and python_version < "3.13" -xlrd==1.2.0 ; python_version >= "3.9" and python_version < "3.13" -zipp==3.17.0 ; 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 +cachetools==5.5.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 +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 +nh3==0.2.18 +nodeenv==1.9.1 +notebook==7.2.2 +notebook-shim==0.2.4 +numpy==2.1.2 +opencv-python==4.10.0.84 +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 +pygments==2.18.0 +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==307 ; 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 +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 +tqdm==4.66.5 +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 +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 +widgetsnbextension==4.0.13 +xlrd==1.2.0 +zipp==3.20.2 +zstandard==0.23.0 diff --git a/tasks.py b/tasks.py index 8bb57a2..8442958 100644 --- a/tasks.py +++ b/tasks.py @@ -172,7 +172,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...') @@ -304,19 +304,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" ) @@ -333,7 +326,7 @@ def build(ctx: Context): """ message_box("Building...") - ctx.run("poetry build") + ctx.run("uv build") ctx.run("twine check dist/*") @@ -354,15 +347,26 @@ def virtualise(ctx: Context, tests: bool = True): with ctx.cd("dist"): ctx.run(f"tar -xvf {PYPI_ARCHIVE_NAME}-{APPLICATION_VERSION}.tar.gz") ctx.run(f"mv {PYPI_ARCHIVE_NAME}-{APPLICATION_VERSION} {unique_name}") + ctx.run(f"rm -rf {unique_name}/{PYTHON_PACKAGE_NAME}/resources") + ctx.run( + "ln -s ../../../{0}/resources {1}/{0}".format( + PYTHON_PACKAGE_NAME, unique_name + ) + ) + with ctx.cd(unique_name): - ctx.run("poetry install") - ctx.run("source $(poetry env info -p)/bin/activate") + 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"}, )