Skip to content

Commit bdd94fb

Browse files
committed
Implement support for Python 3.11.
1 parent 68fc04a commit bdd94fb

10 files changed

+166
-169
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ jobs:
77
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
88
strategy:
99
matrix:
10-
os: [ubuntu-20.04]
11-
python-version: [3.8]
10+
os: [ubuntu-22.04]
11+
python-version: [3.11]
1212
fail-fast: false
1313
runs-on: ${{ matrix.os }}
1414
steps:
1515
- uses: actions/checkout@v1
1616
- name: Environment Variables
1717
run: |
1818
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
19-
echo "CI_PACKAGE=colour" >> $GITHUB_ENV
19+
echo "CI_PACKAGE=colour_checker_detection" >> $GITHUB_ENV
2020
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV
2121
echo "MPLBACKEND=AGG" >> $GITHUB_ENV
2222
echo "COLOUR_SCIENCE__DOCUMENTATION_BUILD=True" >> $GITHUB_ENV
@@ -31,8 +31,7 @@ jobs:
3131
sudo apt-get --yes install latexmk texlive-full
3232
- name: Install Poetry
3333
run: |
34-
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
35-
python get-poetry.py
34+
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
3635
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
3736
shell: bash
3837
- name: Install Package Dependencies

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ jobs:
77
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
88
strategy:
99
matrix:
10-
os: [macOS-latest, ubuntu-20.04, windows-2019]
11-
python-version: [3.8, 3.9, '3.10']
12-
exclude:
13-
- os: windows-latest
14-
python-version: 3.8
10+
os: [macOS-latest, ubuntu-22.04, windows-2019]
11+
python-version: [3.9, '3.10', 3.11]
1512
fail-fast: false
1613
runs-on: ${{ matrix.os }}
1714
steps:
@@ -25,14 +22,17 @@ jobs:
2522
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV
2623
echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV
2724
shell: bash
25+
- name: Set up Python 3.9 for Pre-Commit
26+
uses: actions/setup-python@v1
27+
with:
28+
python-version: 3.9
2829
- name: Set up Python ${{ matrix.python-version }}
2930
uses: actions/setup-python@v1
3031
with:
3132
python-version: ${{ matrix.python-version }}
3233
- name: Install Poetry
3334
run: |
34-
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
35-
python get-poetry.py --version 1.1.12
35+
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
3636
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
3737
shell: bash
3838
- name: Install Package Dependencies

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@ jobs:
88
strategy:
99
matrix:
1010
os: [macOS-latest]
11-
python-version: [3.9]
11+
python-version: [3.11]
1212
fail-fast: false
1313
runs-on: ${{ matrix.os }}
1414
steps:
1515
- uses: actions/checkout@v1
1616
- name: Environment Variables
1717
run: |
18-
echo "CI_PACKAGE=colour" >> $GITHUB_ENV
18+
echo "CI_PACKAGE=colour_checker_detection" >> $GITHUB_ENV
1919
shell: bash
2020
- name: Set up Python ${{ matrix.python-version }}
2121
uses: actions/setup-python@v1
2222
with:
2323
python-version: ${{ matrix.python-version }}
24-
- name: Static Type Checking
24+
- name: Install Package Dependencies
2525
run: |
2626
pip install -r requirements.txt
27-
mypy --install-types --non-interactive --show-error-codes --warn-unused-ignores --warn-redundant-casts -p $CI_PACKAGE
27+
- name: Static Type Checking
28+
run: |
29+
mypy --install-types --non-interactive --show-error-codes --warn-unused-ignores --warn-redundant-casts $CI_PACKAGE

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
repos:
22
- repo: https://github.com/asottile/pyupgrade
3-
rev: v2.37.3
3+
rev: v3.2.2
44
hooks:
55
- id: pyupgrade
6-
args: [--py38-plus]
6+
args: [--py39-plus]
77
- repo: https://github.com/ikamensh/flynt/
8-
rev: '0.76'
8+
rev: '0.77'
99
hooks:
1010
- id: flynt
1111
- repo: https://github.com/psf/black
12-
rev: 22.6.0
12+
rev: 22.10.0
1313
hooks:
1414
- id: black
15-
language_version: python3.8
15+
language_version: python3.9
1616
- repo: https://github.com/keewis/blackdoc
1717
rev: v0.3.8
1818
hooks:
1919
- id: blackdoc
20-
language_version: python3.8
20+
language_version: python3.9
2121
- repo: https://github.com/PyCQA/flake8
22-
rev: 5.0.3
22+
rev: 6.0.0
2323
hooks:
2424
- id: flake8
2525
- repo: https://github.com/pycqa/pydocstyle
@@ -28,4 +28,4 @@ repos:
2828
- id: pydocstyle
2929
args:
3030
- --convention=numpy
31-
- --add-ignore=D104,D200,D202,D205,D301,D400
31+
- --add-ignore=D104,D200,D202,D205,D301,D400

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
build:
44
os: ubuntu-20.04
55
tools:
6-
python: "3.8"
6+
python: "3.11"
77

88
sphinx:
99
configuration: docs/conf.py

colour_checker_detection/detection/segmentation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def as_8_bit_BGR_image(image: ArrayLike) -> NDArray:
292292
def adjust_image(
293293
image: ArrayLike,
294294
target_width: Integer,
295-
interpolation_method: Literal[ # type: ignore[misc]
295+
interpolation_method: Literal[ # type: ignore[valid-type]
296296
cv2.INTER_AREA,
297297
cv2.INTER_BITS,
298298
cv2.INTER_BITS2,
@@ -465,7 +465,7 @@ def scale_contour(contour: ArrayLike, factor: Floating) -> NDArray:
465465
def crop_and_level_image_with_rectangle(
466466
image: ArrayLike,
467467
rectangle: Tuple[Tuple, Tuple, Floating],
468-
interpolation_method: Literal[ # type: ignore[misc]
468+
interpolation_method: Literal[ # type: ignore[valid-type]
469469
cv2.INTER_AREA,
470470
cv2.INTER_BITS,
471471
cv2.INTER_BITS2,

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
]
2727

2828
intersphinx_mapping = {
29-
"python": ("https://docs.python.org/3.8", None),
29+
"python": ("https://docs.python.org/3.11", None),
3030
"matplotlib": ("https://matplotlib.org/stable", None),
3131
"numpy": ("https://numpy.org/doc/stable", None),
3232
"pandas": ("https://pandas.pydata.org/pandas-docs/dev", None),

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ exclude = [
4444
]
4545

4646
[tool.poetry.dependencies]
47-
python = ">= 3.8, < 3.11"
48-
colour-science = ">= 0.4.0"
47+
python = ">= 3.9, < 3.12"
48+
colour-science = ">= 0.4.2"
4949
imageio = ">= 2, < 3"
50-
numpy = ">= 1.19, < 2"
50+
numpy = ">= 1.20, < 2"
5151
opencv-python = ">= 4, < 5"
52-
scipy = ">= 1.5, < 2"
52+
scipy = ">= 1.7, < 2"
5353
typing-extensions = ">= 4, < 5" # Convenience for Google Colab.
5454

55-
matplotlib = { version = ">= 3.2, != 3.5.0, != 3.5.1", optional = true }
55+
matplotlib = { version = ">= 3.4, != 3.5.0, != 3.5.1", optional = true }
5656

5757
biblib-simple = { version = "*", optional = true } # Development dependency.
5858
black = { version = "*", optional = true } # Development dependency.

0 commit comments

Comments
 (0)