From f2a1e04cb103b1f45d66e057445fc19e0d2171f0 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Fri, 11 Oct 2024 08:15:28 +1300 Subject: [PATCH 1/5] Add various resources globals to base namespace. --- colour_checker_detection/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/colour_checker_detection/__init__.py b/colour_checker_detection/__init__.py index 675befc..1073089 100644 --- a/colour_checker_detection/__init__.py +++ b/colour_checker_detection/__init__.py @@ -58,6 +58,8 @@ ROOT_RESOURCES, "colour-checker-detection-tests-datasets" ) +__all__ += ["ROOT_RESOURCES", "ROOT_RESOURCES_EXAMPLES", "ROOT_RESOURCES_TESTS"] + __application_name__ = "Colour - Checker Detection" __major_version__ = "0" From 9e9cc118131abf9a3ae72a997eb0b8b21da6c4bd Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Fri, 11 Oct 2024 08:16:05 +1300 Subject: [PATCH 2/5] Update various docstrings. `e.g.` -> `e.g.,` `i.e.` -> `i.e.,` --- colour_checker_detection/detection/common.py | 2 +- colour_checker_detection/detection/inference.py | 2 +- colour_checker_detection/detection/segmentation.py | 4 ++-- colour_checker_detection/detection/tests/test_common.py | 4 ++-- colour_checker_detection/detection/tests/test_inference.py | 4 ++-- colour_checker_detection/detection/tests/test_segmentation.py | 4 ++-- tasks.py | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/colour_checker_detection/detection/common.py b/colour_checker_detection/detection/common.py index 870f823..04961c6 100644 --- a/colour_checker_detection/detection/common.py +++ b/colour_checker_detection/detection/common.py @@ -999,7 +999,7 @@ def sample_colour_checker( image: ArrayLike, quadrilateral, rectangle, samples=32, **kwargs ) -> DataDetectionColourChecker: """ - Sample the colour checker using the given source quadrilateral, i.e. + Sample the colour checker using the given source quadrilateral, i.e., detected colour checker in the image, and the given target rectangle. Parameters diff --git a/colour_checker_detection/detection/inference.py b/colour_checker_detection/detection/inference.py index 4879bd0..b519737 100644 --- a/colour_checker_detection/detection/inference.py +++ b/colour_checker_detection/detection/inference.py @@ -267,7 +267,7 @@ def detect_colour_checkers_inference( Other Parameters ---------------- aspect_ratio - Colour checker aspect ratio, e.g. 1.5. + Colour checker aspect ratio, e.g., 1.5. aspect_ratio_minimum Minimum colour checker aspect ratio for detection: projective geometry might reduce the colour checker aspect ratio. diff --git a/colour_checker_detection/detection/segmentation.py b/colour_checker_detection/detection/segmentation.py index d58c556..3154e33 100644 --- a/colour_checker_detection/detection/segmentation.py +++ b/colour_checker_detection/detection/segmentation.py @@ -218,7 +218,7 @@ def segmenter_default( adaptive_threshold_kwargs Keyword arguments for :func:`cv2.adaptiveThreshold` definition. aspect_ratio - Colour checker aspect ratio, e.g. 1.5. + Colour checker aspect ratio, e.g., 1.5. aspect_ratio_minimum Minimum colour checker aspect ratio for detection: projective geometry might reduce the colour checker aspect ratio. @@ -433,7 +433,7 @@ def detect_colour_checkers_segmentation( adaptive_threshold_kwargs Keyword arguments for :func:`cv2.adaptiveThreshold` definition. aspect_ratio - Colour checker aspect ratio, e.g. 1.5. + Colour checker aspect ratio, e.g., 1.5. aspect_ratio_minimum Minimum colour checker aspect ratio for detection: projective geometry might reduce the colour checker aspect ratio. diff --git a/colour_checker_detection/detection/tests/test_common.py b/colour_checker_detection/detection/tests/test_common.py index a082294..7f7234e 100644 --- a/colour_checker_detection/detection/tests/test_common.py +++ b/colour_checker_detection/detection/tests/test_common.py @@ -138,7 +138,7 @@ def test_reformat_image(self): definition unit tests methods. """ - # Skipping unit test when "png" files are missing, e.g. when testing + # Skipping unit test when "png" files are missing, e.g., when testing # the distributed "Python" package. if len(PNG_FILES) == 0: return @@ -392,7 +392,7 @@ def test_sample_colour_checker(self): sample_colour_checker` definition unit tests methods. """ - # Skipping unit test when "png" files are missing, e.g. when testing + # Skipping unit test when "png" files are missing, e.g., when testing # the distributed "Python" package. if len(PNG_FILES) == 0: return diff --git a/colour_checker_detection/detection/tests/test_inference.py b/colour_checker_detection/detection/tests/test_inference.py index 2024913..d46f243 100644 --- a/colour_checker_detection/detection/tests/test_inference.py +++ b/colour_checker_detection/detection/tests/test_inference.py @@ -50,7 +50,7 @@ def test_inferencer_default(self): inferencer_default` definition unit tests methods. """ - # Skipping unit test when "png" files are missing, e.g. when testing + # Skipping unit test when "png" files are missing, e.g., when testing # the distributed "Python" package. if len(PNG_FILES) == 0: return @@ -89,7 +89,7 @@ def test_detect_colour_checkers_inference(self): detect_colour_checkers_inference` definition unit tests methods. """ - # Skipping unit test when "png" files are missing, e.g. when testing + # Skipping unit test when "png" files are missing, e.g., when testing # the distributed "Python" package. if len(PNG_FILES) == 0: return diff --git a/colour_checker_detection/detection/tests/test_segmentation.py b/colour_checker_detection/detection/tests/test_segmentation.py index d3df7dc..b7700ad 100644 --- a/colour_checker_detection/detection/tests/test_segmentation.py +++ b/colour_checker_detection/detection/tests/test_segmentation.py @@ -49,7 +49,7 @@ def test_segmenter_default(self): segmenter_default` definition unit tests methods. """ - # Skipping unit test when "png" files are missing, e.g. when testing + # Skipping unit test when "png" files are missing, e.g., when testing # the distributed "Python" package. if len(PNG_FILES) == 0: return @@ -139,7 +139,7 @@ def test_detect_colour_checkers_segmentation(self): detect_colour_checkers_segmentation` definition unit tests methods. """ - # Skipping unit test when "png" files are missing, e.g. when testing + # Skipping unit test when "png" files are missing, e.g., when testing # the distributed "Python" package. if len(PNG_FILES) == 0: return diff --git a/tasks.py b/tasks.py index 78d2c47..c0bbf9d 100644 --- a/tasks.py +++ b/tasks.py @@ -81,7 +81,7 @@ def clean( docs Whether to clean the *docs* directory. bytecode - Whether to clean the bytecode files, e.g. *.pyc* files. + Whether to clean the bytecode files, e.g., *.pyc* files. pytest Whether to clean the *Pytest* cache directory. """ From ce624a1018f43f99afedda80454696a7a1e05209 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Fri, 11 Oct 2024 08:16:32 +1300 Subject: [PATCH 3/5] Update affiliation. --- CONTRIBUTORS.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index d2860e2..a9c7641 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -4,7 +4,7 @@ Contributors Development & Technical Support ------------------------------- -- **Thomas Mansencal**, *Technology Supervisor @ Wētā FX* +- **Thomas Mansencal**, *Principal Pipeline Programmer @ Epic Games* Project coordination, overall development. From 93ab02467010b9cf9b2255e05bc8ec6b527656b4 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Fri, 11 Oct 2024 08:16:48 +1300 Subject: [PATCH 4/5] Update `actions/setup-python` to v5. --- .github/workflows/continuous-integration-documentation.yml | 2 +- .../workflows/continuous-integration-quality-unit-tests.yml | 4 ++-- .../workflows/continuous-integration-static-type-checking.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continuous-integration-documentation.yml b/.github/workflows/continuous-integration-documentation.yml index 47fdc23..4150672 100644 --- a/.github/workflows/continuous-integration-documentation.yml +++ b/.github/workflows/continuous-integration-documentation.yml @@ -22,7 +22,7 @@ jobs: echo "COLOUR_SCIENCE__DOCUMENTATION_BUILD=True" >> $GITHUB_ENV shell: bash - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install Dependencies diff --git a/.github/workflows/continuous-integration-quality-unit-tests.yml b/.github/workflows/continuous-integration-quality-unit-tests.yml index 51697c8..b460dca 100644 --- a/.github/workflows/continuous-integration-quality-unit-tests.yml +++ b/.github/workflows/continuous-integration-quality-unit-tests.yml @@ -23,11 +23,11 @@ jobs: echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV shell: bash - name: Set up Python 3.9 for Pre-Commit - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.9 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install Poetry diff --git a/.github/workflows/continuous-integration-static-type-checking.yml b/.github/workflows/continuous-integration-static-type-checking.yml index 1064de6..540e16e 100644 --- a/.github/workflows/continuous-integration-static-type-checking.yml +++ b/.github/workflows/continuous-integration-static-type-checking.yml @@ -18,7 +18,7 @@ jobs: echo "CI_PACKAGE=colour_checker_detection" >> $GITHUB_ENV shell: bash - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install Package Dependencies From 143556650e37d7acdd1ed021e176a5c506ead576 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 13 Oct 2024 10:28:45 +1300 Subject: [PATCH 5/5] 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 | 30 +- ...nuous-integration-static-type-checking.yml | 4 +- .gitignore | 3 +- README.rst | 9 +- TODO.rst | 16 +- .../detection/inference.py | 7 +- .../detection/segmentation.py | 5 +- .../detection/tests/test_inference.py | 220 +++++----- colour_checker_detection/scripts/inference.py | 12 +- docs/installation.rst | 9 +- docs/requirements.txt | 133 +++--- pyproject.toml | 120 +++--- requirements.txt | 386 ++++++++++-------- tasks.py | 39 +- 16 files changed, 556 insertions(+), 455 deletions(-) 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 4150672..824b4a5 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 b460dca..65f25f4 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, ubuntu-latest, windows-2019] - python-version: [3.9, "3.10", 3.11, 3.12] + 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: | - 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 --ignore=$CI_PACKAGE/scripts/inference.py --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 540e16e..25055bc 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 4032ce2..d539a65 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ .fleet .idea .ipynb_checkpoints +.python-version .sandbox .vs .vscode @@ -17,4 +18,4 @@ colour_checker_detection.egg-info dist docs/_build docs/generated -poetry.lock +uv.lock diff --git a/README.rst b/README.rst index 562c757..c215bbb 100644 --- a/README.rst +++ b/README.rst @@ -75,16 +75,17 @@ Primary Dependencies **Colour - Checker Detection** requires various dependencies in order to run: -- `python >= 3.9, < 4 `__ -- `colour-science >= 4.3 `__ +- `python >= 3.10, < 3.14 `__ +- `colour-science >= 4.5 `__ - `imageio >= 2, < 3 `__ -- `numpy >= 1.22, < 2 `__ +- `numpy >= 1.24, < 3 `__ - `opencv-python >= 4, < 5 `__ -- `scipy >= 1.8, < 2 `__ +- `scipy >= 1.10, < 2 `__ Secondary Dependencies ~~~~~~~~~~~~~~~~~~~~~~ +- `click >= 8, < 9 `__ - `ultralytics >= 8, < 9 `__ Pypi diff --git a/TODO.rst b/TODO.rst index 3a2324b..df1b786 100644 --- a/TODO.rst +++ b/TODO.rst @@ -6,27 +6,27 @@ TODO - colour_checker_detection/__init__.py - - Line 92 : # TODO: Remove legacy printing support when deemed appropriate. + - Line 90 : # TODO: Remove legacy printing support when deemed appropriate. - colour_checker_detection/detection/common.py - Line 126 : # TODO: Update when "Colour" 0.4.5 is released. - - Line 1131 : # TODO: Update when "Colour" 0.4.5 is released. + - Line 1120 : # TODO: Update when "Colour" 0.4.5 is released. - colour_checker_detection/detection/tests/test_inference.py - - Line 62 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes. - - Line 66 : # TODO: Enable when "torch" is available on Python 3.12. - - Line 101 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes. - - Line 105 : # TODO: Enable when "torch" is available on Python 3.12. + - Line 58 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes. + - Line 62 : # TODO: Enable when "torch" is available on Python 3.12. + - Line 97 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes. + - Line 101 : # TODO: Enable when "torch" is available on Python 3.12. - colour_checker_detection/detection/tests/test_segmentation.py - - Line 59 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes. - - Line 151 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes. + - Line 57 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes. + - Line 147 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes. About ----- diff --git a/colour_checker_detection/detection/inference.py b/colour_checker_detection/detection/inference.py index b519737..4707bac 100644 --- a/colour_checker_detection/detection/inference.py +++ b/colour_checker_detection/detection/inference.py @@ -37,7 +37,6 @@ from colour.utilities import ( Structure, as_int_scalar, - is_string, ) from colour.utilities.documentation import ( DocstringDict, @@ -193,7 +192,7 @@ def inferencer_default( temp_directory = tempfile.mkdtemp() try: - if not is_string(image): + if not isinstance(image, str): input_image = os.path.join(temp_directory, "input-image.png") if apply_cctf_encoding: @@ -366,8 +365,8 @@ def detect_colour_checkers_inference( results = inferencer(image, **inferencer_kwargs) - if is_string(image): - image = read_image(cast(str, image)) + if isinstance(image, str): + image = read_image(image) else: image = convert_bit_depth( image, diff --git a/colour_checker_detection/detection/segmentation.py b/colour_checker_detection/detection/segmentation.py index 3154e33..cc68eae 100644 --- a/colour_checker_detection/detection/segmentation.py +++ b/colour_checker_detection/detection/segmentation.py @@ -40,7 +40,6 @@ from colour.utilities import ( MixinDataclassIterable, Structure, - is_string, ) from colour.utilities.documentation import ( DocstringDict, @@ -541,8 +540,8 @@ def detect_colour_checkers_segmentation( working_width = settings.working_width working_height = int(working_width / settings.aspect_ratio) - if is_string(image): - image = read_image(cast(str, image)) + if isinstance(image, str): + image = read_image(image) else: image = convert_bit_depth( image, diff --git a/colour_checker_detection/detection/tests/test_inference.py b/colour_checker_detection/detection/tests/test_inference.py index d46f243..45a07e2 100644 --- a/colour_checker_detection/detection/tests/test_inference.py +++ b/colour_checker_detection/detection/tests/test_inference.py @@ -98,130 +98,130 @@ def test_detect_colour_checkers_inference(self): if platform.system() in ("Windows", "Microsoft", "Linux"): return - # TODO: Enable when "torch" is available on Python 3.12. - if sys.version_info[1] > 11: # noqa: YTT203 + # TODO: Enable when "torch" is available on Python 3.13. + if sys.version_info[1] > 12: # noqa: YTT203 return test_swatches = [ - ( - np.array( + np.array( + [ [ - [0.24915336, 0.15333557, 0.08062609], - [0.41582590, 0.25704128, 0.15597928], - [0.21691470, 0.19983344, 0.18059847], - [0.19566718, 0.17250466, 0.06643628], - [0.27478909, 0.20288917, 0.19493811], - [0.23374973, 0.28814146, 0.19005357], - [0.45762375, 0.23317388, 0.05121415], - [0.18061841, 0.16022089, 0.20770057], - [0.39544231, 0.16719289, 0.11211669], - [0.19535244, 0.10992710, 0.11463679], - [0.31359121, 0.29133955, 0.02011782], - [0.43297896, 0.25808954, 0.00887722], - [0.13763773, 0.12528725, 0.17699082], - [0.18486719, 0.24581401, 0.07584951], - [0.35452405, 0.13150652, 0.07456490], - [0.46239638, 0.32247591, 0.00122477], - [0.37084514, 0.15799911, 0.16431224], - [0.11738659, 0.20026121, 0.18583715], - [0.50368768, 0.41160455, 0.29139283], - [0.41439033, 0.33571342, 0.23684677], - [0.32857990, 0.26543081, 0.18447344], - [0.23778303, 0.18715258, 0.12640880], - [0.16784327, 0.13128684, 0.08443624], - [0.10924070, 0.07945030, 0.04722051], + [0.24868909, 0.15350598, 0.08116075], + [0.41540268, 0.25717098, 0.15545619], + [0.21684574, 0.20027032, 0.18109877], + [0.19675766, 0.17302327, 0.06548654], + [0.27416429, 0.20367995, 0.19459581], + [0.23362409, 0.28895241, 0.18982816], + [0.45757887, 0.23318496, 0.05019996], + [0.18031126, 0.16013199, 0.20791255], + [0.39581251, 0.16763814, 0.11296371], + [0.19527651, 0.10987040, 0.11621131], + [0.31525213, 0.29152983, 0.02060614], + [0.43262833, 0.25884929, 0.00885420], + [0.13825633, 0.12534967, 0.17780316], + [0.18896411, 0.24588297, 0.07770619], + [0.35498002, 0.13155451, 0.07399154], + [0.46168804, 0.32344660, 0.00148291], + [0.37211949, 0.15806609, 0.16444303], + [0.11952692, 0.20040615, 0.18599187], + [0.50398535, 0.41233703, 0.29100367], + [0.41492999, 0.33637702, 0.23704307], + [0.32918635, 0.26559123, 0.18590339], + [0.23806982, 0.18820626, 0.12598225], + [0.16772291, 0.13166212, 0.08472667], + [0.10938574, 0.07928163, 0.04741153], ] - ), + ] ), - ( - np.array( + np.array( + [ [ - [0.35930955, 0.22294356, 0.11652736], - [0.62508970, 0.39426908, 0.24249625], - [0.33216712, 0.31617990, 0.28927535], - [0.30448821, 0.27402756, 0.10357682], - [0.41776320, 0.31983960, 0.30784929], - [0.34831995, 0.44018656, 0.29236460], - [0.68040967, 0.35255539, 0.06841964], - [0.27309224, 0.25288051, 0.33048338], - [0.62147486, 0.27055049, 0.18659429], - [0.30654705, 0.18056440, 0.19198996], - [0.48673603, 0.45989344, 0.03273499], - [0.65062267, 0.40057424, 0.01651634], - [0.19466802, 0.18593474, 0.27454826], - [0.28092542, 0.38499087, 0.12309728], - [0.55481929, 0.21417859, 0.12555254], - [0.72179741, 0.51570368, 0.00593671], - [0.57785285, 0.25778547, 0.26881799], - [0.17877635, 0.31785583, 0.29541582], - [0.74003130, 0.61015379, 0.43858936], - [0.62925828, 0.51779926, 0.37218189], - [0.51435107, 0.42165166, 0.29885665], - [0.37107259, 0.30354372, 0.20976804], - [0.26378226, 0.21566097, 0.14350446], - [0.16334273, 0.13377619, 0.08050516], + [0.36078018, 0.22207782, 0.11697489], + [0.62627727, 0.39423054, 0.24255158], + [0.33202896, 0.31646109, 0.28833535], + [0.30576822, 0.27346721, 0.10463000], + [0.41724655, 0.31947500, 0.30804843], + [0.34876767, 0.43955785, 0.29208037], + [0.67817026, 0.35152173, 0.07043589], + [0.27260271, 0.25263956, 0.33063090], + [0.62258488, 0.27038357, 0.18698311], + [0.30695105, 0.18043391, 0.19091117], + [0.48766014, 0.45945448, 0.03280113], + [0.65045166, 0.40045342, 0.01603201], + [0.19251584, 0.18574022, 0.27414128], + [0.28029913, 0.38490412, 0.12232948], + [0.55480623, 0.21456560, 0.12517895], + [0.72210294, 0.51611030, 0.00603206], + [0.57790947, 0.25799227, 0.26868472], + [0.17926446, 0.31794888, 0.29533628], + [0.74142271, 0.61076266, 0.43976876], + [0.63066620, 0.51781225, 0.37297052], + [0.51444507, 0.42198676, 0.30036736], + [0.37206760, 0.30385801, 0.20999040], + [0.26381230, 0.21583907, 0.14343576], + [0.16325143, 0.13384773, 0.08024697], ] - ), + ] ), - ( - np.array( + np.array( + [ [ - [0.34787202, 0.22239830, 0.12071132], - [0.58308375, 0.37266096, 0.23445724], - [0.31696445, 0.30354100, 0.27743283], - [0.30365786, 0.27450961, 0.11830053], - [0.42217895, 0.32414007, 0.30887246], - [0.35737351, 0.43327817, 0.29111093], - [0.62362486, 0.32676762, 0.07449088], - [0.25730333, 0.23566855, 0.30452645], - [0.57681578, 0.25527635, 0.17708671], - [0.30016240, 0.18407927, 0.18981223], - [0.48437726, 0.45353514, 0.05076985], - [0.64548796, 0.39820802, 0.02829487], - [0.18757187, 0.17559552, 0.24984352], - [0.26328433, 0.35216329, 0.11459546], - [0.51652521, 0.20295261, 0.11941541], - [0.69001114, 0.49240762, 0.00375420], - [0.56554443, 0.25572431, 0.26536795], - [0.19376248, 0.31754220, 0.29425311], - [0.69671404, 0.56982183, 0.40269485], - [0.58879417, 0.48042127, 0.34024647], - [0.48349753, 0.39325854, 0.27507150], - [0.36126551, 0.29105616, 0.19889101], - [0.26881081, 0.21673009, 0.14677900], - [0.18107167, 0.14177044, 0.09304354], + [0.34837398, 0.22248265, 0.12170179], + [0.58388305, 0.37338290, 0.23275897], + [0.31933340, 0.30370870, 0.27962670], + [0.30756134, 0.27525371, 0.11792573], + [0.41984171, 0.32147259, 0.30852041], + [0.35473925, 0.42866808, 0.28895292], + [0.62471563, 0.32704774, 0.07252023], + [0.25692821, 0.23611195, 0.30394992], + [0.57950014, 0.25530624, 0.17775886], + [0.30231547, 0.18419002, 0.18951628], + [0.48620912, 0.45199829, 0.04738132], + [0.64306474, 0.39646858, 0.02802419], + [0.18743382, 0.17561989, 0.24962272], + [0.26411217, 0.35147783, 0.11445957], + [0.51501918, 0.20269375, 0.12031434], + [0.69076639, 0.49227387, 0.00245023], + [0.56558263, 0.25513411, 0.26413113], + [0.18770075, 0.31425264, 0.29354358], + [0.69720978, 0.56977922, 0.40252122], + [0.58962691, 0.48107553, 0.33920413], + [0.48512009, 0.39316276, 0.27548853], + [0.36088896, 0.29062313, 0.19837178], + [0.26906908, 0.21666811, 0.14570932], + [0.17873077, 0.14149866, 0.09204219], ] - ), + ] ), - ( - np.array( + np.array( + [ [ - [0.21935888, 0.12829103, 0.05823010], - [0.38621023, 0.23481502, 0.13791171], - [0.19868790, 0.18798569, 0.17158148], - [0.19399667, 0.17182195, 0.06093559], - [0.27950001, 0.21304348, 0.20691113], - [0.24463765, 0.30781290, 0.20621555], - [0.42518276, 0.21057689, 0.03164171], - [0.15967241, 0.14403240, 0.19099186], - [0.39287907, 0.16042854, 0.10488193], - [0.19517671, 0.11038135, 0.11735366], - [0.33836949, 0.31697488, 0.02259050], - [0.48356858, 0.29514906, 0.01217067], - [0.11187637, 0.10295546, 0.15011585], - [0.17635491, 0.23033310, 0.06228105], - [0.35300460, 0.12854379, 0.06986750], - [0.48630539, 0.34021181, 0.00108740], - [0.40561464, 0.17577751, 0.18303318], - [0.12991810, 0.23211640, 0.21919341], - [0.48198688, 0.37970755, 0.25524086], - [0.41261905, 0.32600898, 0.22289814], - [0.34072644, 0.27106091, 0.18362711], - [0.25940242, 0.20172483, 0.13366182], - [0.19378240, 0.15367146, 0.10122680], - [0.13230942, 0.10608750, 0.06544701], + [0.21954346, 0.12827335, 0.05807348], + [0.38594031, 0.23523375, 0.13748619], + [0.19902036, 0.18813717, 0.17216082], + [0.19323272, 0.17206185, 0.06205419], + [0.27916723, 0.21370420, 0.20743532], + [0.24624889, 0.30755320, 0.20590794], + [0.42592812, 0.21029468, 0.03172819], + [0.16014631, 0.14433359, 0.19122502], + [0.39261296, 0.16085321, 0.10504565], + [0.19512193, 0.11113719, 0.11700730], + [0.33913988, 0.31777325, 0.02248015], + [0.48319355, 0.29541984, 0.01134784], + [0.11160174, 0.10332654, 0.15007614], + [0.17605095, 0.23046510, 0.06220178], + [0.35337761, 0.12851048, 0.06960399], + [0.48561531, 0.34026867, 0.00105998], + [0.40623522, 0.17625771, 0.18369043], + [0.13130365, 0.23233752, 0.21957417], + [0.48197183, 0.37976372, 0.25521374], + [0.41217238, 0.32606238, 0.22287071], + [0.34036109, 0.27108088, 0.18371078], + [0.25957564, 0.20170440, 0.13371080], + [0.19509768, 0.15370770, 0.10181070], + [0.13300470, 0.10627789, 0.06550305], ] - ), + ] ), ] diff --git a/colour_checker_detection/scripts/inference.py b/colour_checker_detection/scripts/inference.py index 428870f..8dcec57 100755 --- a/colour_checker_detection/scripts/inference.py +++ b/colour_checker_detection/scripts/inference.py @@ -26,8 +26,6 @@ from colour import read_image from colour.hints import List, Literal, NDArray, Tuple from colour.io import convert_bit_depth -from ultralytics import YOLO -from ultralytics.utils.downloads import download __author__ = "Colour Developers" __copyright__ = "Copyright 2024 Colour Developers" @@ -71,7 +69,10 @@ def inference( - source: str | Path | NDArray, model: YOLO, show: bool = False, **kwargs + source: str | Path | NDArray, + model: YOLO, # noqa: F821 # pyright: ignore + show: bool = False, + **kwargs, ) -> List[Tuple[NDArray, NDArray, NDArray]]: """ Run the inference on the provided source. @@ -195,6 +196,9 @@ def segmentation( Inference results. """ + from ultralytics import YOLO + from ultralytics.utils.downloads import download + time_start = perf_counter() logging.getLogger().setLevel(getattr(logging, logging_level.upper())) @@ -232,4 +236,4 @@ def segmentation( if __name__ == "__main__": logging.basicConfig() - segmentation() # pyright: ignore + segmentation() diff --git a/docs/installation.rst b/docs/installation.rst index 0cf9d0e..9d6a896 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -13,16 +13,17 @@ Primary Dependencies **Colour - Checker Detection** requires various dependencies in order to run: -- `python >= 3.8, < 4 `__ -- `colour-science >= 4.3 `__ +- `python >= 3.10, < 3.14 `__ +- `colour-science >= 4.5 `__ - `imageio >= 2, < 3 `__ -- `numpy >= 1.22, < 2 `__ +- `numpy >= 1.24, < 3 `__ - `opencv-python >= 4, < 5 `__ -- `scipy >= 1.8, < 2 `__ +- `scipy >= 1.10, < 2 `__ Secondary Dependencies ~~~~~~~~~~~~~~~~~~~~~~ +- `click >= 8, < 9 `__ - `ultralytics >= 8, < 9 `__ Pypi diff --git a/docs/requirements.txt b/docs/requirements.txt index 39cff8f..41c71a7 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,51 +1,82 @@ -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.2 ; python_version >= "3.9" and python_version < "3.13" -biblib-simple==0.1.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 sys_platform == "win32" -colour-science==0.4.4 ; python_version >= "3.9" and python_version < "3.13" -contourpy==1.2.0 ; python_version >= "3.9" and python_version < "3.13" -cycler==0.12.1 ; python_version >= "3.9" and python_version < "3.13" -docutils==0.20.1 ; python_version >= "3.9" and python_version < "3.13" -fonttools==4.47.0 ; 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.1 ; python_version >= "3.9" and python_version < "3.10" -importlib-resources==6.1.1 ; 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" -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" -matplotlib==3.8.2 ; python_version >= "3.9" and python_version < "3.13" -numpy==1.26.3 ; python_version >= "3.9" and python_version < "3.13" -opencv-python==4.9.0.80 ; python_version >= "3.9" and python_version < "3.13" -packaging==23.2 ; python_version >= "3.9" and python_version < "3.13" -pillow==10.2.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.15.1 ; python_version >= "3.9" and python_version < "3.13" -pygments==2.17.2 ; python_version >= "3.9" and python_version < "3.13" -pyparsing==3.1.1 ; python_version >= "3.9" and python_version < "3.13" -python-dateutil==2.8.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.2 ; 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" -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" -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 +certifi==2024.8.30 +charset-normalizer==3.4.0 +click==8.1.7 ; python_full_version < '3.13' +colorama==0.4.6 ; (platform_system != 'Windows' and sys_platform == 'win32') or (python_full_version < '3.13' and platform_system == 'Windows') or (python_full_version >= '3.13' and sys_platform == 'win32') +colour-science==0.4.6 +contourpy==1.3.0 +cycler==0.12.1 +docutils==0.21.2 +filelock==3.16.1 ; python_full_version < '3.13' +fonttools==4.54.1 +fsspec==2024.9.0 ; python_full_version < '3.13' +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 +mpmath==1.3.0 ; python_full_version < '3.13' +networkx==3.4.1 ; python_full_version < '3.13' +numpy==2.1.2 +nvidia-cublas-cu12==12.1.3.1 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-cuda-cupti-cu12==12.1.105 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-cuda-nvrtc-cu12==12.1.105 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-cuda-runtime-cu12==12.1.105 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-cudnn-cu12==9.1.0.70 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-cufft-cu12==11.0.2.54 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-curand-cu12==10.3.2.106 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-cusolver-cu12==11.4.5.107 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-cusparse-cu12==12.1.0.106 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-nccl-cu12==2.20.5 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-nvjitlink-cu12==12.6.77 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-nvtx-cu12==12.1.105 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +opencv-python==4.10.0.84 +packaging==24.1 +pandas==2.2.3 ; python_full_version < '3.13' +pillow==10.4.0 +psutil==6.0.0 ; python_full_version < '3.13' +py-cpuinfo==9.0.0 ; python_full_version < '3.13' +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 +pytz==2024.2 ; python_full_version < '3.13' +pyyaml==6.0.2 +requests==2.32.3 +restructuredtext-lint==1.4.0 +scipy==1.14.1 +seaborn==0.13.2 ; python_full_version < '3.13' +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 +sympy==1.13.3 ; python_full_version < '3.13' +tomli==2.0.2 ; python_full_version < '3.11' +torch==2.4.1 ; python_full_version < '3.13' +torchvision==0.19.1 ; python_full_version < '3.13' +tqdm==4.66.5 ; python_full_version < '3.13' +triton==3.0.0 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +typing-extensions==4.12.2 +tzdata==2024.2 ; python_full_version < '3.13' +ultralytics==8.3.11 ; python_full_version < '3.13' +ultralytics-thop==2.0.9 ; python_full_version < '3.13' +urllib3==2.2.3 diff --git a/pyproject.toml b/pyproject.toml index 931ed12..e26e656 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,16 @@ -[tool.poetry] +[project] name = "colour-checker-detection" version = "0.2.0" description = "Colour checker detection with Python" -license = "BSD-3-Clause" -authors = ["Colour Developers "] -maintainers = ["Colour Developers "] -readme = 'README.rst' -repository = "https://github.com/colour-science/colour-checker-detection" -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", @@ -38,52 +41,73 @@ classifiers = [ "Topic :: Scientific/Engineering", "Topic :: Software Development" ] +dependencies = [ + "colour-science>=0.4.4", + "imageio>=2,<3", + "numpy>=1.24,<3", + "opencv-python>=4,<5", + "scipy>=1.10,<2", + "typing-extensions>=4,<5", +] + +[project.optional-dependencies] +optional = [ + "matplotlib>=3.7", +] +docs = [ + "biblib-simple", + "pydata-sphinx-theme", + "restructuredtext-lint", + "sphinx", + "sphinxcontrib-bibtex", +] +ultralytics = [ + "click>=8,<9; python_version<'3.13'", + "ultralytics>=8,<9; python_version<'3.13'", +] + +[project.urls] +Homepage = "https://www.colour-science.org" +Documentation = "https://colour-checker-detection.readthedocs.org" +Repository = "https://github.com/colour-science/colour-checker-detection" +Issues = "https://github.com/colour-science/colour-checker-detection/issues" +Changelog = "https://github.com/colour-science/colour-checker-detection/releases" + +[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_checker_detection" ] + +[tool.hatch.build.targets.sdist] exclude = [ "colour_checker_detection/resources/colour-checker-detection-examples-datasets/detection/*", "colour_checker_detection/resources/colour-checker-detection-tests-datasets/colour_checker_detection/detection/*", ] -[tool.poetry.scripts] -colour-checker-detection-inference = 'colour_checker_detection.scripts.inference:segmentation' - -[tool.poetry.dependencies] -python = ">= 3.9, < 3.13" -colour-science = ">= 0.4.4" -imageio = ">= 2, < 3" -numpy = ">= 1.22, < 2" -opencv-python = ">= 4, < 5" -scipy = ">= 1.8, < 2" -typing-extensions = ">= 4, < 5" - -[tool.poetry.group.optional.dependencies] -matplotlib = ">= 3.5, != 3.5.0, != 3.5.1" - -[tool.poetry.group.ultralytics.dependencies] -click = { version = ">= 8, < 9", python = "< 3.12" } -ultralytics = { version = ">= 8, < 9", python = "< 3.12" } - -[tool.poetry.group.dev.dependencies] -coverage = ">= 6, < 7" -coveralls = "*" -invoke = "*" -jupyter = "*" -pre-commit = ">= 3.5" -pyright = "*" -pytest = "*" -pytest-cov = "*" -pytest-xdist = "*" -toml = "*" -twine = "*" - -[tool.poetry.group.docs.dependencies] -biblib-simple = "*" -pydata-sphinx-theme = "*" -restructuredtext-lint = "*" -sphinx = "*" -sphinxcontrib-bibtex = "*" +[project.scripts] +colour-checker-detection-inference = "colour_checker_detection.scripts.inference:segmentation" [tool.codespell] -skip = 'BIBLIOGRAPHY.bib,CONTRIBUTORS.rst,*.ipynb' +skip = "BIBLIOGRAPHY.bib,CONTRIBUTORS.rst,*.ipynb" [tool.flynt] line_length = 999 @@ -205,7 +229,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 10bcc5a..188caa4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,172 +1,214 @@ -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.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.2.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" -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 sys_platform == "win32" -colour-science==0.4.4 ; python_version >= "3.9" and python_version < "3.13" -comm==0.2.1 ; python_version >= "3.9" and python_version < "3.13" -contourpy==1.2.0 ; python_version >= "3.9" and python_version < "3.13" -coverage==7.4.0 ; python_version >= "3.9" and python_version < "3.13" -coverage[toml]==7.4.0 ; 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" -cycler==0.12.1 ; python_version >= "3.9" and python_version < "3.13" -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.1 ; python_version >= "3.9" and python_version < "3.13" -filelock==3.13.1 ; python_version >= "3.9" and python_version < "3.13" -fonttools==4.47.0 ; 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.1 ; python_version >= "3.9" and python_version < "3.13" -importlib-resources==6.1.1 ; 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.28.0 ; 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.3 ; 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.12.1 ; 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.7.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.3 ; python_version >= "3.9" and python_version < "3.13" -jupyter-server-terminals==0.5.1 ; python_version >= "3.9" and python_version < "3.13" -jupyterlab==4.0.10 ; 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" -kiwisolver==1.4.5 ; 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==3.8.2 ; 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.2.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.14.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.3 ; python_version >= "3.9" and python_version < "3.13" -opencv-python==4.9.0.80 ; 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.2.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.15.1 ; python_version >= "3.9" and python_version < "3.13" -pygments==2.17.2 ; python_version >= "3.9" and python_version < "3.13" -pyparsing==3.1.1 ; python_version >= "3.9" and python_version < "3.13" -pyright==1.1.345 ; python_version >= "3.9" and python_version < "3.13" -pytest==7.4.4 ; 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.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.0 ; python_version >= "3.9" and python_version < "3.13" -rpds-py==0.16.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.3 ; 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.2 ; 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" -traitlets==5.14.1 ; 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.20240106 ; 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.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.7.0 ; python_version >= "3.9" and python_version < "3.13" -widgetsnbextension==4.0.9 ; 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 +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 +fsspec==2024.9.0 ; python_full_version < '3.13' +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 +mpmath==1.3.0 ; python_full_version < '3.13' +nbclient==0.10.0 +nbconvert==7.16.4 +nbformat==5.10.4 +nest-asyncio==1.6.0 +networkx==3.4.1 ; python_full_version < '3.13' +nh3==0.2.18 +nodeenv==1.9.1 +notebook==7.2.2 +notebook-shim==0.2.4 +numpy==2.1.2 +nvidia-cublas-cu12==12.1.3.1 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-cuda-cupti-cu12==12.1.105 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-cuda-nvrtc-cu12==12.1.105 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-cuda-runtime-cu12==12.1.105 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-cudnn-cu12==9.1.0.70 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-cufft-cu12==11.0.2.54 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-curand-cu12==10.3.2.106 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-cusolver-cu12==11.4.5.107 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-cusparse-cu12==12.1.0.106 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-nccl-cu12==2.20.5 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-nvjitlink-cu12==12.6.77 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +nvidia-nvtx-cu12==12.1.105 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +opencv-python==4.10.0.84 +overrides==7.7.0 +packaging==24.1 +pandas==2.2.3 ; python_full_version < '3.13' +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 +py-cpuinfo==9.0.0 ; python_full_version < '3.13' +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 +pytz==2024.2 ; python_full_version < '3.13' +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 +scipy==1.14.1 +seaborn==0.13.2 ; python_full_version < '3.13' +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 +sympy==1.13.3 ; python_full_version < '3.13' +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 +torch==2.4.1 ; python_full_version < '3.13' +torchvision==0.19.1 ; python_full_version < '3.13' +tornado==6.4.1 +tqdm==4.66.5 ; python_full_version < '3.13' +traitlets==5.14.3 +triton==3.0.0 ; python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' +trove-classifiers==2024.10.12 +twine==5.1.1 +types-python-dateutil==2.9.0.20241003 +typing-extensions==4.12.2 +tzdata==2024.2 ; python_full_version < '3.13' +ultralytics==8.3.11 ; python_full_version < '3.13' +ultralytics-thop==2.0.9 ; python_full_version < '3.13' +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 +zipp==3.20.2 +zstandard==0.23.0 diff --git a/tasks.py b/tasks.py index c0bbf9d..3e45a94 100644 --- a/tasks.py +++ b/tasks.py @@ -168,7 +168,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,optional " - "--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,optional " - "--output docs/requirements.txt" + 'uv export --no-hashes --all-extras --no-dev | grep -v "-e \\." > ' + "docs/requirements.txt" ) @@ -321,7 +314,7 @@ def build(ctx: Context): """ message_box("Building...") - ctx.run("poetry build") + ctx.run("uv build") ctx.run("twine check dist/*") @@ -341,18 +334,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('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: - # The test images are not available thus many doctests - # cannot be run properly: - # "--doctest-modules " 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"}, )