Skip to content

Commit 0ed9be6

Browse files
committed
Linewrap with pydocstringformatter
1 parent 8486867 commit 0ed9be6

File tree

8 files changed

+48
-19
lines changed

8 files changed

+48
-19
lines changed

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ typeCheckingMode = "strict"
346346
[tool.pydocstringformatter]
347347
write = true
348348
split-summary-body = false
349+
max-line-length = 79
350+
linewrap-full-docstring = true
349351

350352
[tool.interrogate]
351353
fail-under = 100

src/vws/exceptions/cloud_reco_exceptions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
"""Exceptions which match errors raised by the Vuforia Cloud Recognition Web APIs."""
1+
"""Exceptions which match errors raised by the Vuforia Cloud Recognition Web
2+
APIs.
3+
"""
24

35
from beartype import beartype
46

src/vws/exceptions/custom_exceptions.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Exceptions which do not map to errors at
3-
https://developer.vuforia.com/library/web-api/cloud-targets-web-services-api#result-codes
3+
https://developer.vuforia.com/library/web-api/cloud-targets-web-services-
4+
api#result-codes
45
or simple errors given by the cloud recognition service.
56
"""
67

@@ -29,7 +30,9 @@ def response(self) -> Response:
2930

3031
@beartype
3132
class TargetProcessingTimeoutError(Exception):
32-
"""Exception raised when waiting for a target to be processed times out."""
33+
"""Exception raised when waiting for a target to be processed times
34+
out.
35+
"""
3336

3437

3538
@beartype

src/vws/exceptions/vws_exceptions.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""
22
Exception raised when Vuforia returns a response with a result code matching
33
one of those documented at
4-
https://developer.vuforia.com/library/web-api/cloud-targets-web-services-api#result-codes.
4+
https://developer.vuforia.com/library/web-api/cloud-targets-web-services-
5+
api#result-codes.
56
"""
67

78
import json
@@ -29,7 +30,9 @@ def target_id(self) -> str:
2930

3031
@beartype
3132
class FailError(VWSError):
32-
"""Exception raised when Vuforia returns a response with a result code 'Fail'."""
33+
"""Exception raised when Vuforia returns a response with a result code
34+
'Fail'.
35+
"""
3336

3437

3538
@beartype

tests/test_cloud_reco_exceptions.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ def test_image_too_large(
6161

6262

6363
def test_cloudrecoexception_inheritance() -> None:
64-
"""CloudRecoService-specific exceptions inherit from CloudRecoException."""
64+
"""CloudRecoService-specific exceptions inherit from
65+
CloudRecoException.
66+
"""
6567
subclasses = [
6668
MaxNumResultsOutOfRangeError,
6769
InactiveProjectError,
@@ -77,7 +79,8 @@ def test_authentication_failure(
7779
high_quality_image: io.BytesIO,
7880
) -> None:
7981
"""
80-
An ``AuthenticationFailure`` exception is raised when the client access key
82+
An ``AuthenticationFailure`` exception is raised when the client access
83+
key
8184
exists but the client secret key is incorrect.
8285
"""
8386
database = VuforiaDatabase()

tests/test_query.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ class TestCustomBaseVWQURL:
4848
@staticmethod
4949
def test_custom_base_url(image: io.BytesIO | BinaryIO) -> None:
5050
"""
51-
It is possible to use query a target to a database under a custom VWQ
51+
It is possible to use query a target to a database under a custom
52+
VWQ
5253
URL.
5354
"""
5455
base_vwq_url = "http://example.com"
@@ -190,7 +191,8 @@ def test_top(
190191
image: io.BytesIO | BinaryIO,
191192
) -> None:
192193
"""
193-
When ``CloudRecoIncludeTargetData.TOP`` is given, target data is only
194+
When ``CloudRecoIncludeTargetData.TOP`` is given, target data is
195+
only
194196
returned in the top match.
195197
"""
196198
target_id = vws_client.add_target(
@@ -224,7 +226,8 @@ def test_none(
224226
image: io.BytesIO | BinaryIO,
225227
) -> None:
226228
"""
227-
When ``CloudRecoIncludeTargetData.NONE`` is given, target data is not
229+
When ``CloudRecoIncludeTargetData.NONE`` is given, target data is
230+
not
228231
returned in any match.
229232
"""
230233
target_id = vws_client.add_target(

tests/test_vws.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ def test_get_target_summary_report(
176176
vws_client: VWS,
177177
image: io.BytesIO | BinaryIO,
178178
) -> None:
179-
"""Details of a target are returned by ``get_target_summary_report``."""
179+
"""Details of a target are returned by
180+
``get_target_summary_report``.
181+
"""
180182
date = "2018-04-25"
181183
target_name = uuid.uuid4().hex
182184
with freeze_time(time_to_freeze=date):
@@ -224,7 +226,9 @@ class TestGetDatabaseSummaryReport:
224226

225227
@staticmethod
226228
def test_get_target(vws_client: VWS) -> None:
227-
"""Details of a database are returned by ``get_database_summary_report``."""
229+
"""Details of a database are returned by
230+
``get_database_summary_report``.
231+
"""
228232
report = vws_client.get_database_summary_report()
229233

230234
expected_report = DatabaseSummaryReport(
@@ -407,7 +411,9 @@ def test_default_seconds_between_requests(
407411
def test_custom_seconds_between_requests(
408412
image: io.BytesIO | BinaryIO,
409413
) -> None:
410-
"""It is possible to customize the time waited between polling requests."""
414+
"""It is possible to customize the time waited between polling
415+
requests.
416+
"""
411417
with MockVWS(processing_time_seconds=0.5) as mock:
412418
database = VuforiaDatabase()
413419
mock.add_database(database=database)

tests/test_vws_exceptions.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def test_image_too_large(
4040
png_too_large: io.BytesIO | io.BufferedRandom,
4141
) -> None:
4242
"""
43-
When giving an image which is too large, an ``ImageTooLarge`` exception is
43+
When giving an image which is too large, an ``ImageTooLarge`` exception
44+
is
4445
raised.
4546
"""
4647
with pytest.raises(expected_exception=ImageTooLargeError) as exc:
@@ -69,7 +70,8 @@ def test_invalid_given_id(vws_client: VWS) -> None:
6970

7071
def test_add_bad_name(vws_client: VWS, high_quality_image: io.BytesIO) -> None:
7172
"""
72-
When a name with a bad character is given, a ``ServerError`` exception is
73+
When a name with a bad character is given, a ``ServerError`` exception
74+
is
7375
raised.
7476
"""
7577
max_char_value = 65535
@@ -96,7 +98,9 @@ def test_request_quota_reached() -> None:
9698

9799

98100
def test_fail(high_quality_image: io.BytesIO) -> None:
99-
"""A ``Fail`` exception is raised when the server access key does not exist."""
101+
"""A ``Fail`` exception is raised when the server access key does not
102+
exist.
103+
"""
100104
with MockVWS():
101105
vws_client = VWS(
102106
server_access_key=uuid.uuid4().hex,
@@ -135,7 +139,8 @@ def test_target_name_exist(
135139
high_quality_image: io.BytesIO,
136140
) -> None:
137141
"""
138-
A ``TargetNameExist`` exception is raised after adding two targets with the
142+
A ``TargetNameExist`` exception is raised after adding two targets with
143+
the
139144
same name.
140145
"""
141146
vws_client.add_target(
@@ -162,7 +167,8 @@ def test_project_inactive(
162167
high_quality_image: io.BytesIO,
163168
) -> None:
164169
"""
165-
A ``ProjectInactive`` exception is raised if adding a target to an inactive
170+
A ``ProjectInactive`` exception is raised if adding a target to an
171+
inactive
166172
database.
167173
"""
168174
database = VuforiaDatabase(state=States.PROJECT_INACTIVE)
@@ -267,7 +273,8 @@ def test_authentication_failure(
267273
high_quality_image: io.BytesIO,
268274
) -> None:
269275
"""
270-
An ``AuthenticationFailure`` exception is raised when the server access key
276+
An ``AuthenticationFailure`` exception is raised when the server access
277+
key
271278
exists but the server secret key is incorrect, or when a client key is
272279
incorrect.
273280
"""

0 commit comments

Comments
 (0)