Skip to content

Commit 33f4c7a

Browse files
committed
Merge branch 'release/v0.1.5'
2 parents 16ee05e + 68429ce commit 33f4c7a

26 files changed

+564
-636
lines changed

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[run]
22
source = colour_checker_detection
3+
sigterm = True
34
[report]
45
exclude_lines =
56
pragma: no cover

.flake8

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ is available to guide the process: https://www.colour-science.org/contributing/.
1515
**Code Style and Quality**
1616

1717
- [ ] Unit tests have been implemented and passed.
18-
- [ ] Mypy static checking has been run and passed.
18+
- [ ] Pyright static checking has been run and passed.
1919
- [ ] Pre-commit hooks have been run and passed.
2020

2121
<!-- The unit tests can be invoked with `poetry run invoke tests` -->
22-
<!-- Mypy can be started with `dmypy run -- --show-error-codes --warn-unused-ignores --warn-redundant-casts --install-types --non-interactive -p colour-checker-detection` -->
22+
<!-- Pyright can be started with `pyright --skipunannotated` -->
2323

2424
**Documentation**
2525

.github/workflows/continuous-integration-documentation.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@ jobs:
3030
sudo apt-get update
3131
sudo apt-get --yes install latexmk texlive-full
3232
- name: Install Poetry
33+
env:
34+
POETRY_VERSION: 1.4.0
3335
run: |
3436
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
3537
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
3638
shell: bash
3739
- name: Install Package Dependencies
3840
run: |
3941
poetry run python -m pip install --upgrade pip
40-
poetry install --extras "read-the-docs"
42+
poetry install
4143
poetry run python -c "import imageio;imageio.plugins.freeimage.download()"
4244
shell: bash
4345
- name: Build Documentation

.github/workflows/continuous-integration-quality-unit-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
with:
3232
python-version: ${{ matrix.python-version }}
3333
- name: Install Poetry
34+
env:
35+
POETRY_VERSION: 1.4.0
3436
run: |
3537
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
3638
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
@@ -51,9 +53,10 @@ jobs:
5153
shell: bash
5254
- name: Test with Pytest
5355
run: |
54-
poetry run python -W ignore -m pytest --disable-warnings --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE
56+
poetry run python -W ignore -m pytest --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE
5557
shell: bash
5658
- name: Upload Coverage to coveralls.io
59+
if: matrix.os == 'macOS-latest' && matrix.python-version == '3.11'
5760
run: |
5861
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi
5962
shell: bash

.github/workflows/continuous-integration-static-type-checking.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
pip install -r requirements.txt
2727
- name: Static Type Checking
2828
run: |
29-
mypy --install-types --non-interactive --show-error-codes --warn-unused-ignores --warn-redundant-casts $CI_PACKAGE
29+
pyright --skipunannotated

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
*.pyc
33
*.pyo
44
.DS_Store
5-
.coverage
6-
.dmypy.json
5+
.coverage*
76
.fleet
87
.idea
98
.ipynb_checkpoints
10-
.mypy_cache
119
.sandbox
1210
.vs
1311
.vscode

.pre-commit-config.yaml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
repos:
2-
- repo: https://github.com/asottile/pyupgrade
3-
rev: v3.2.2
4-
hooks:
5-
- id: pyupgrade
6-
args: [--py39-plus]
72
- repo: https://github.com/ikamensh/flynt/
8-
rev: '0.77'
3+
rev: '1.0.1'
94
hooks:
105
- id: flynt
6+
- repo: https://github.com/charliermarsh/ruff-pre-commit
7+
rev: 'v0.0.285'
8+
hooks:
9+
- id: ruff
1110
- repo: https://github.com/psf/black
12-
rev: 22.10.0
11+
rev: 23.7.0
1312
hooks:
1413
- id: black
1514
language_version: python3.9
@@ -18,14 +17,3 @@ repos:
1817
hooks:
1918
- id: blackdoc
2019
language_version: python3.9
21-
- repo: https://github.com/PyCQA/flake8
22-
rev: 6.0.0
23-
hooks:
24-
- id: flake8
25-
- repo: https://github.com/pycqa/pydocstyle
26-
rev: 6.1.1
27-
hooks:
28-
- id: pydocstyle
29-
args:
30-
- --convention=numpy
31-
- --add-ignore=D104,D200,D202,D205,D301,D400

.readthedocs.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,5 @@ formats:
1313
- pdf
1414

1515
python:
16-
install:
17-
- method: pip
18-
path: .
19-
extra_requirements:
20-
- read-the-docs
16+
install:
17+
- requirements: docs/requirements.txt

CONTRIBUTORS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ About
1717

1818
| **Colour - Checker Detection** by Colour Developers
1919
| Copyright 2018 Colour Developers – `colour-developers@colour-science.org <colour-developers@colour-science.org>`__
20-
| This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause
20+
| This software is released under terms of BSD-3-Clause: https://opensource.org/licenses/BSD-3-Clause
2121
| `https://github.com/colour-science/colour-checker-detection <https://github.com/colour-science/colour-checker-detection>`__

LICENSE

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
11
Copyright 2018 Colour Developers
2-
All rights reserved.
32

4-
Redistribution and use in source and binary forms, with or without
5-
modification, are permitted provided that the following conditions are met:
6-
* Redistributions of source code must retain the above copyright
7-
notice, this list of conditions and the following disclaimer.
8-
* Redistributions in binary form must reproduce the above copyright
9-
notice, this list of conditions and the following disclaimer in the
10-
documentation and/or other materials provided with the distribution.
11-
* Neither the name of the Colour Developers nor the
12-
names of its contributors may be used to endorse or promote products
13-
derived from this software without specific prior written permission.
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
144

15-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18-
DISCLAIMED. IN NO EVENT SHALL COLOUR DEVELOPERS BE LIABLE FOR ANY
19-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22-
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
11+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE

README.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Colour - Checker Detection
55
66
|actions| |coveralls| |codacy| |version|
77

8-
.. |actions| image:: https://img.shields.io/github/workflow/status/colour-science/colour-checker-detection/Continuous%20Integration%20-%20Quality%20&%20Unit%20Tests?label=actions&logo=github&style=flat-square
8+
.. |actions| image:: https://img.shields.io/github/actions/workflow/status/colour-science/colour-checker-detection/.github/workflows/continuous-integration-quality-unit-tests.yml?branch=develop&style=flat-square
99
:target: https://github.com/colour-science/colour-checker-detection/actions
1010
:alt: Develop Build Status
1111
.. |coveralls| image:: http://img.shields.io/coveralls/colour-science/colour-checker-detection/develop.svg?style=flat-square
@@ -21,11 +21,11 @@ Colour - Checker Detection
2121
.. end-badges
2222
2323
24-
A `Python <https://www.python.org/>`__ package implementing various colour
24+
A `Python <https://www.python.org>`__ package implementing various colour
2525
checker detection algorithms and related utilities.
2626

2727
It is open source and freely available under the
28-
`New BSD License <https://opensource.org/licenses/BSD-3-Clause>`__ terms.
28+
`BSD-3-Clause <https://opensource.org/licenses/BSD-3-Clause>`__ terms.
2929

3030
.. image:: https://raw.githubusercontent.com/colour-science/colour-checker-detection/master/docs/_static/ColourCheckerDetection_001.png
3131

@@ -66,12 +66,12 @@ Primary Dependencies
6666

6767
**Colour - Checker Detection** requires various dependencies in order to run:
6868

69-
- `python >= 3.8, < 4 <https://www.python.org/download/releases/>`__
70-
- `colour-science >= 4 <https://pypi.org/project/colour-science/>`__
71-
- `imageio >= 2, < 3 <https://imageio.github.io/>`__
72-
- `numpy >= 1.19, < 2 <https://pypi.org/project/numpy/>`__
73-
- `opencv-python >= 4, < 5 <https://pypi.org/project/opencv-python/>`__
74-
- `scipy >= 1.5, < 2 <https://pypi.org/project/scipy/>`__
69+
- `python >= 3.9, < 4 <https://www.python.org/download/releases>`__
70+
- `colour-science >= 4.3 <https://pypi.org/project/colour-science>`__
71+
- `imageio >= 2, < 3 <https://imageio.github.io>`__
72+
- `numpy >= 1.22, < 2 <https://pypi.org/project/numpy>`__
73+
- `opencv-python >= 4, < 5 <https://pypi.org/project/opencv-python>`__
74+
- `scipy >= 1.8, < 2 <https://pypi.org/project/scipy>`__
7575

7676
Pypi
7777
~~~~
@@ -90,7 +90,7 @@ Contributing
9090
^^^^^^^^^^^^
9191

9292
If you would like to contribute to `Colour - Checker Detection <https://github.com/colour-science/colour-checker-detection>`__,
93-
please refer to the following `Contributing <https://www.colour-science.org/contributing/>`__
93+
please refer to the following `Contributing <https://www.colour-science.org/contributing>`__
9494
guide for `Colour <https://github.com/colour-science/colour>`__.
9595

9696
Bibliography
@@ -110,7 +110,7 @@ Code of Conduct
110110
---------------
111111

112112
The *Code of Conduct*, adapted from the `Contributor Covenant 1.4 <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>`__,
113-
is available on the `Code of Conduct <https://www.colour-science.org/code-of-conduct/>`__ page.
113+
is available on the `Code of Conduct <https://www.colour-science.org/code-of-conduct>`__ page.
114114

115115
Contact & Social
116116
----------------
@@ -128,5 +128,5 @@ About
128128

129129
| **Colour - Checker Detection** by Colour Developers
130130
| Copyright 2018 Colour Developers – `colour-developers@colour-science.org <colour-developers@colour-science.org>`__
131-
| This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause
131+
| This software is released under terms of BSD-3-Clause: https://opensource.org/licenses/BSD-3-Clause
132132
| `https://github.com/colour-science/colour-checker-detection <https://github.com/colour-science/colour-checker-detection>`__

TODO.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ TODO
66

77
- colour_checker_detection/__init__.py
88

9-
- Line 81 : # TODO: Remove legacy printing support when deemed appropriate.
9+
- Line 84 : # TODO: Remove legacy printing support when deemed appropriate.
1010

1111

1212
- colour_checker_detection/detection/tests/test_segmentation.py
@@ -18,6 +18,6 @@ About
1818
-----
1919

2020
| **Colour - Checker Detection** by Colour Developers
21-
| Copyright 2018 Colour Developers `colour-developers@colour-science.org <colour-developers@colour-science.org>`__
22-
| This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause
21+
| Copyright 2018 Colour Developers - `colour-developers@colour-science.org <colour-developers@colour-science.org>`__
22+
| This software is released under terms of BSD-3-Clause: https://opensource.org/licenses/BSD-3-Clause
2323
| `https://github.com/colour-science/colour-checker-detection <https://github.com/colour-science/colour-checker-detection>`__

colour_checker_detection/__init__.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111

1212
from __future__ import annotations
1313

14+
import contextlib
1415
import cv2
1516
import numpy as np
1617
import os
17-
import subprocess # nosec
18+
import subprocess
1819

1920
import colour
2021

@@ -28,7 +29,7 @@
2829

2930
__author__ = "Colour Developers"
3031
__copyright__ = "Copyright 2018 Colour Developers"
31-
__license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause"
32+
__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause"
3233
__maintainer__ = "Colour Developers"
3334
__email__ = "colour-developers@colour-science.org"
3435
__status__ = "Production"
@@ -53,15 +54,15 @@
5354

5455
__major_version__ = "0"
5556
__minor_version__ = "1"
56-
__change_version__ = "4"
57+
__change_version__ = "5"
5758
__version__ = ".".join(
5859
(__major_version__, __minor_version__, __change_version__)
5960
)
6061

6162
try:
6263
_version = (
63-
subprocess.check_output( # nosec
64-
["git", "describe"],
64+
subprocess.check_output(
65+
["git", "describe"], # noqa: S603, S607
6566
cwd=os.path.dirname(__file__),
6667
stderr=subprocess.STDOUT,
6768
)
@@ -71,15 +72,15 @@
7172
except Exception:
7273
_version = __version__
7374

74-
colour.utilities.ANCILLARY_COLOUR_SCIENCE_PACKAGES[
75+
colour.utilities.ANCILLARY_COLOUR_SCIENCE_PACKAGES[ # pyright: ignore
7576
"colour-checker-detection"
7677
] = _version
77-
colour.utilities.ANCILLARY_RUNTIME_PACKAGES["opencv"] = cv2.__version__
78+
colour.utilities.ANCILLARY_RUNTIME_PACKAGES[ # pyright: ignore
79+
"opencv"
80+
] = cv2.__version__ # pyright: ignore
7881

7982
del _version
8083

8184
# TODO: Remove legacy printing support when deemed appropriate.
82-
try:
85+
with contextlib.suppress(TypeError):
8386
np.set_printoptions(legacy="1.13")
84-
except TypeError:
85-
pass

0 commit comments

Comments
 (0)