Skip to content

Commit 43fc112

Browse files
committed
Merge branch 'feature/v0.1.3' into develop
2 parents 1b93f30 + c8de25b commit 43fc112

File tree

5 files changed

+84
-80
lines changed

5 files changed

+84
-80
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@ repos:
1717
rev: 4.0.1
1818
hooks:
1919
- id: flake8
20+
- repo: https://github.com/pycqa/pydocstyle
21+
rev: 6.1.1
22+
hooks:
23+
- id: pydocstyle
24+
args:
25+
- --convention=numpy
26+
- --add-ignore=D104,D200,D202,D205,D301,D400

colour_checker_detection/detection/segmentation.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,7 @@
145145
"""
146146

147147
FLOAT_DTYPE_DEFAULT: Type[DTypeFloating] = np.float32
148-
"""
149-
Dtype used for the computations.
150-
"""
148+
"""Dtype used for the computations."""
151149

152150

153151
@dataclass

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ mypy = { version = "*", optional = true } # Development dependency.
6161
numpy = { version = ">= 1.19, < 2", optional = true }
6262
pre-commit = { version = "*", optional = true } # Development dependency.
6363
pydata-sphinx-theme = { version = "*", optional = true } # Development dependency.
64+
pydocstyle = { version = "*", optional = true } # Development dependency.
6465
pytest = { version = "*", optional = true } # Development dependency.
6566
pytest-cov = { version = "*", optional = true } # Development dependency.
6667
pyupgrade = { version = "*", optional = true } # Development dependency.
@@ -82,6 +83,7 @@ jupyter = "*"
8283
mypy = "*"
8384
pre-commit = "*"
8485
pydata-sphinx-theme = "*"
86+
pydocstyle = "*"
8587
pytest = "*"
8688
pytest-cov = "*"
8789
pyupgrade = "*"
@@ -104,6 +106,7 @@ development = [
104106
"mypy",
105107
"pre-commit",
106108
"pydata-sphinx-theme",
109+
"pydocstyle",
107110
"pytest",
108111
"pytest-cov",
109112
"pyupgrade",
@@ -139,6 +142,10 @@ line_length=999
139142
plugins = "numpy.typing.mypy_plugin"
140143
ignore_missing_imports = true
141144

145+
[tool.pydocstyle]
146+
convention = "numpy"
147+
add-ignore = "D104,D200,D202,D205,D301,D400"
148+
142149
[build-system]
143150
requires = [ "poetry>=0.12" ]
144151
build-backend = "poetry.masonry.api"

setup.py

Lines changed: 52 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,65 @@
1-
# -*- coding: utf-8 -*-
1+
"""
2+
Colour - Checker Detection - Setup
3+
==================================
4+
"""
5+
26
import codecs
37
from setuptools import setup
48

5-
packages = \
6-
['colour_checker_detection',
7-
'colour_checker_detection.detection',
8-
'colour_checker_detection.detection.tests']
9+
packages = [
10+
"colour_checker_detection",
11+
"colour_checker_detection.detection",
12+
"colour_checker_detection.detection.tests",
13+
]
914

10-
package_data = \
11-
{'': ['*'],
12-
'colour_checker_detection': ['examples/*',
13-
'resources/colour-checker-detection-examples-datasets/*',
14-
'resources/colour-checker-detection-tests-datasets/*']}
15+
package_data = {
16+
"": ["*"],
17+
"colour_checker_detection": [
18+
"examples/*",
19+
"resources/colour-checker-detection-examples-datasets/*",
20+
"resources/colour-checker-detection-tests-datasets/*",
21+
],
22+
}
1523

16-
install_requires = \
17-
['colour-science>=0.3.16,<0.4.0', 'opencv-python>=4,<5']
24+
install_requires = ["colour-science>=0.3.16,<0.4.0", "opencv-python>=4,<5"]
1825

19-
extras_require = \
20-
{'development': ['biblib-simple',
21-
'coverage',
22-
'coveralls',
23-
'flake8',
24-
'invoke',
25-
'jupyter',
26-
'matplotlib',
27-
'mock',
28-
'nose',
29-
'pre-commit',
30-
'pytest',
31-
'restructuredtext-lint',
32-
'sphinx<=3.1.2',
33-
'sphinx_rtd_theme',
34-
'sphinxcontrib-bibtex',
35-
'toml',
36-
'twine',
37-
'yapf==0.23'],
38-
'read-the-docs': ['mock', 'numpy', 'sphinxcontrib-bibtex']}
26+
extras_require = {
27+
"development": [
28+
"biblib-simple",
29+
"coverage",
30+
"coveralls",
31+
"flake8",
32+
"invoke",
33+
"jupyter",
34+
"matplotlib",
35+
"mock",
36+
"nose",
37+
"pre-commit",
38+
"pytest",
39+
"restructuredtext-lint",
40+
"sphinx<=3.1.2",
41+
"sphinx_rtd_theme",
42+
"sphinxcontrib-bibtex",
43+
"toml",
44+
"twine",
45+
"yapf==0.23",
46+
],
47+
"read-the-docs": ["mock", "numpy", "sphinxcontrib-bibtex"],
48+
}
3949

4050
setup(
41-
name='colour-checker-detection',
42-
version='0.1.2',
43-
description='Colour checker detection with Python',
44-
long_description=codecs.open('README.rst', encoding='utf8').read(),
45-
author='Colour Developers',
46-
author_email='colour-developers@colour-science.org',
47-
maintainer='Colour Developers',
48-
maintainer_email='colour-developers@colour-science.org',
49-
url='https://www.colour-science.org/',
51+
name="colour-checker-detection",
52+
version="0.1.2",
53+
description="Colour checker detection with Python",
54+
long_description=codecs.open("README.rst", encoding="utf8").read(),
55+
author="Colour Developers",
56+
author_email="colour-developers@colour-science.org",
57+
maintainer="Colour Developers",
58+
maintainer_email="colour-developers@colour-science.org",
59+
url="https://www.colour-science.org/",
5060
packages=packages,
5161
package_data=package_data,
5262
install_requires=install_requires,
5363
extras_require=extras_require,
54-
python_requires='>=3.6,<4.0',
64+
python_requires=">=3.6,<4.0",
5565
)

tasks.py

Lines changed: 17 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
Invoke - Tasks
1+
"""Invoke - Tasks
32
==============
43
"""
54

@@ -59,9 +58,7 @@
5958

6059

6160
def _patch_invoke_annotations_support():
62-
"""
63-
See https://github.com/pyinvoke/invoke/issues/357
64-
"""
61+
"""See https://github.com/pyinvoke/invoke/issues/357."""
6562

6663
import invoke
6764
from unittest.mock import patch
@@ -93,8 +90,7 @@ def clean(
9390
mypy: Boolean = True,
9491
pytest: Boolean = True,
9592
):
96-
"""
97-
Clean the project.
93+
"""Clean the project.
9894
9995
Parameters
10096
----------
@@ -138,8 +134,7 @@ def formatting(
138134
asciify: Boolean = True,
139135
bibtex: Boolean = True,
140136
):
141-
"""
142-
Convert unicode characters to ASCII and cleanup the *BibTeX* file.
137+
"""Convert unicode characters to ASCII and cleanup the *BibTeX* file.
143138
144139
Parameters
145140
----------
@@ -185,8 +180,7 @@ def quality(
185180
mypy: Boolean = True,
186181
rstlint: Boolean = True,
187182
):
188-
"""
189-
Check the codebase with *Mypy* and lints various *restructuredText*
183+
"""Check the codebase with *Mypy* and lints various *restructuredText*
190184
files with *rst-lint*.
191185
192186
Parameters
@@ -221,8 +215,7 @@ def quality(
221215

222216
@task
223217
def precommit(ctx: Context):
224-
"""
225-
Run the "pre-commit" hooks on the codebase.
218+
"""Run the "pre-commit" hooks on the codebase.
226219
227220
Parameters
228221
----------
@@ -236,8 +229,7 @@ def precommit(ctx: Context):
236229

237230
@task
238231
def tests(ctx: Context):
239-
"""
240-
Run the unit tests with *Pytest*.
232+
"""Run the unit tests with *Pytest*.
241233
242234
Parameters
243235
----------
@@ -258,8 +250,7 @@ def tests(ctx: Context):
258250

259251
@task
260252
def examples(ctx: Context):
261-
"""
262-
Run the examples.
253+
"""Run the examples.
263254
264255
Parameters
265256
----------
@@ -278,8 +269,7 @@ def examples(ctx: Context):
278269

279270
@task(formatting, quality, precommit, tests, examples)
280271
def preflight(ctx: Context):
281-
"""
282-
Perform the preflight tasks, i.e., *formatting*, *tests*, *quality*, and
272+
"""Perform the preflight tasks, i.e., *formatting*, *tests*, *quality*, and
283273
*examples*.
284274
285275
Parameters
@@ -293,8 +283,7 @@ def preflight(ctx: Context):
293283

294284
@task
295285
def docs(ctx: Context, html: Boolean = True, pdf: Boolean = True):
296-
"""
297-
Build the documentation.
286+
"""Build the documentation.
298287
299288
Parameters
300289
----------
@@ -319,8 +308,7 @@ def docs(ctx: Context, html: Boolean = True, pdf: Boolean = True):
319308

320309
@task
321310
def todo(ctx: Context):
322-
"""
323-
Export the TODO items.
311+
"""Export the TODO items.
324312
325313
Parameters
326314
----------
@@ -336,8 +324,7 @@ def todo(ctx: Context):
336324

337325
@task
338326
def requirements(ctx: Context):
339-
"""
340-
Export the *requirements.txt* file.
327+
"""Export the *requirements.txt* file.
341328
342329
Parameters
343330
----------
@@ -355,8 +342,7 @@ def requirements(ctx: Context):
355342

356343
@task(clean, preflight, docs, todo, requirements)
357344
def build(ctx: Context):
358-
"""
359-
Build the project and runs dependency tasks, i.e., *docs*, *todo*, and
345+
"""Build the project and runs dependency tasks, i.e., *docs*, *todo*, and
360346
*preflight*.
361347
362348
Parameters
@@ -420,8 +406,7 @@ def sub_callable(match):
420406

421407
@task
422408
def virtualise(ctx: Context, tests: Boolean = True):
423-
"""
424-
Create a virtual environment for the project build.
409+
"""Create a virtual environment for the project build.
425410
426411
Parameters
427412
----------
@@ -449,8 +434,7 @@ def virtualise(ctx: Context, tests: Boolean = True):
449434

450435
@task
451436
def tag(ctx: Context):
452-
"""
453-
Tag the repository according to defined version using *git-flow*.
437+
"""Tag the repository according to defined version using *git-flow*.
454438
455439
Parameters
456440
----------
@@ -498,8 +482,7 @@ def tag(ctx: Context):
498482

499483
@task(build)
500484
def release(ctx: Context):
501-
"""
502-
Release the project to *Pypi* with *Twine*.
485+
"""Release the project to *Pypi* with *Twine*.
503486
504487
Parameters
505488
----------
@@ -515,8 +498,7 @@ def release(ctx: Context):
515498

516499
@task
517500
def sha256(ctx: Context):
518-
"""
519-
Compute the project *Pypi* package *sha256* with *OpenSSL*.
501+
"""Compute the project *Pypi* package *sha256* with *OpenSSL*.
520502
521503
Parameters
522504
----------

0 commit comments

Comments
 (0)