Skip to content

Commit 38b142f

Browse files
committed
Switch from pydocstringformatter
1 parent b57ba66 commit 38b142f

21 files changed

+281
-101
lines changed

conftest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
"""Setup for Sybil."""
1+
"""
2+
Setup for Sybil.
3+
"""
24

35
import io
46
import uuid
@@ -19,7 +21,9 @@
1921

2022

2123
def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
22-
"""Apply the beartype decorator to all collected test functions."""
24+
"""
25+
Apply the beartype decorator to all collected test functions.
26+
"""
2327
for item in items:
2428
if isinstance(item, pytest.Function):
2529
item.obj = beartype(obj=item.obj)

docs/source/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
"""Documentation."""
1+
"""
2+
Documentation.
3+
"""

docs/source/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env python3
2-
"""Configuration for Sphinx."""
2+
"""
3+
Configuration for Sphinx.
4+
"""
35

46
import importlib.metadata
57
from pathlib import Path

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ reportUnnecessaryTypeIgnoreComment = true
344344
typeCheckingMode = "strict"
345345

346346
[tool.pydocstringformatter]
347-
write = true
347+
write = false
348348
split-summary-body = false
349349
beginning-quotes = false
350350
closing-quotes = false

src/vws/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
"""A library for Vuforia Web Services."""
1+
"""
2+
A library for Vuforia Web Services.
3+
"""
24

35
from .query import CloudRecoService
46
from .vws import VWS

src/vws/exceptions/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
"""Custom exceptions raised by this package."""
1+
"""
2+
Custom exceptions raised by this package.
3+
"""

src/vws/exceptions/base_exceptions.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
@beartype
1212
class CloudRecoError(Exception):
13-
"""Base class for Vuforia Cloud Recognition Web API exceptions."""
13+
"""
14+
Base class for Vuforia Cloud Recognition Web API exceptions.
15+
"""
1416

1517
def __init__(self, response: Response) -> None:
1618
"""
@@ -22,7 +24,9 @@ def __init__(self, response: Response) -> None:
2224

2325
@property
2426
def response(self) -> Response:
25-
"""The response returned by Vuforia which included this error."""
27+
"""
28+
The response returned by Vuforia which included this error.
29+
"""
2630
return self._response
2731

2832

@@ -44,5 +48,7 @@ def __init__(self, response: Response) -> None:
4448

4549
@property
4650
def response(self) -> Response:
47-
"""The response returned by Vuforia which included this error."""
51+
"""
52+
The response returned by Vuforia which included this error.
53+
"""
4854
return self._response

src/vws/exceptions/cloud_reco_exceptions.py

Lines changed: 11 additions & 5 deletions
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+
"""
2+
Exceptions which match errors raised by the Vuforia Cloud Recognition Web APIs.
3+
"""
24

35
from beartype import beartype
46

@@ -15,27 +17,31 @@ class MaxNumResultsOutOfRangeError(CloudRecoError):
1517

1618
@beartype
1719
class InactiveProjectError(CloudRecoError):
18-
"""Exception raised when Vuforia returns a response with a result code
20+
"""
21+
Exception raised when Vuforia returns a response with a result code
1922
'InactiveProject'.
2023
"""
2124

2225

2326
@beartype
2427
class BadImageError(CloudRecoError):
25-
"""Exception raised when Vuforia returns a response with a result code
28+
"""
29+
Exception raised when Vuforia returns a response with a result code
2630
'BadImage'.
2731
"""
2832

2933

3034
@beartype
3135
class AuthenticationFailureError(CloudRecoError):
32-
"""Exception raised when Vuforia returns a response with a result code
36+
"""
37+
Exception raised when Vuforia returns a response with a result code
3338
'AuthenticationFailure'.
3439
"""
3540

3641

3742
@beartype
3843
class RequestTimeTooSkewedError(CloudRecoError):
39-
"""Exception raised when Vuforia returns a response with a result code
44+
"""
45+
Exception raised when Vuforia returns a response with a result code
4046
'RequestTimeTooSkewed'.
4147
"""

src/vws/exceptions/custom_exceptions.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
@beartype
1313
class RequestEntityTooLargeError(Exception):
14-
"""Exception raised when the given image is too large."""
14+
"""
15+
Exception raised when the given image is too large.
16+
"""
1517

1618
def __init__(self, response: Response) -> None:
1719
"""
@@ -23,18 +25,24 @@ def __init__(self, response: Response) -> None:
2325

2426
@property
2527
def response(self) -> Response:
26-
"""The response returned by Vuforia which included this error."""
28+
"""
29+
The response returned by Vuforia which included this error.
30+
"""
2731
return self._response
2832

2933

3034
@beartype
3135
class TargetProcessingTimeoutError(Exception):
32-
"""Exception raised when waiting for a target to be processed times out."""
36+
"""
37+
Exception raised when waiting for a target to be processed times out.
38+
"""
3339

3440

3541
@beartype
3642
class ServerError(Exception): # pragma: no cover
37-
"""Exception raised when VWS returns a server error."""
43+
"""
44+
Exception raised when VWS returns a server error.
45+
"""
3846

3947
def __init__(self, response: Response) -> None:
4048
"""
@@ -46,5 +54,7 @@ def __init__(self, response: Response) -> None:
4654

4755
@property
4856
def response(self) -> Response:
49-
"""The response returned by Vuforia which included this error."""
57+
"""
58+
The response returned by Vuforia which included this error.
59+
"""
5060
return self._response

src/vws/exceptions/vws_exceptions.py

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@
1414

1515
@beartype
1616
class UnknownTargetError(VWSError):
17-
"""Exception raised when Vuforia returns a response with a result code
17+
"""
18+
Exception raised when Vuforia returns a response with a result code
1819
'UnknownTarget'.
1920
"""
2021

2122
@property
2223
def target_id(self) -> str:
23-
"""The unknown target ID."""
24+
"""
25+
The unknown target ID.
26+
"""
2427
path = urlparse(url=self.response.url).path
2528
# Every HTTP path which can raise this error is in the format
2629
# `/something/{target_id}`.
@@ -29,40 +32,48 @@ def target_id(self) -> str:
2932

3033
@beartype
3134
class FailError(VWSError):
32-
"""Exception raised when Vuforia returns a response with a result code 'Fail'."""
35+
"""
36+
Exception raised when Vuforia returns a response with a result code 'Fail'.
37+
"""
3338

3439

3540
@beartype
3641
class BadImageError(VWSError):
37-
"""Exception raised when Vuforia returns a response with a result code
42+
"""
43+
Exception raised when Vuforia returns a response with a result code
3844
'BadImage'.
3945
"""
4046

4147

4248
@beartype
4349
class AuthenticationFailureError(VWSError):
44-
"""Exception raised when Vuforia returns a response with a result code
50+
"""
51+
Exception raised when Vuforia returns a response with a result code
4552
'AuthenticationFailure'.
4653
"""
4754

4855

4956
# See https://github.com/VWS-Python/vws-python/issues/822.
5057
@beartype
5158
class RequestQuotaReachedError(VWSError): # pragma: no cover
52-
"""Exception raised when Vuforia returns a response with a result code
59+
"""
60+
Exception raised when Vuforia returns a response with a result code
5361
'RequestQuotaReached'.
5462
"""
5563

5664

5765
@beartype
5866
class TargetStatusProcessingError(VWSError):
59-
"""Exception raised when Vuforia returns a response with a result code
67+
"""
68+
Exception raised when Vuforia returns a response with a result code
6069
'TargetStatusProcessing'.
6170
"""
6271

6372
@property
6473
def target_id(self) -> str:
65-
"""The processing target ID."""
74+
"""
75+
The processing target ID.
76+
"""
6677
path = urlparse(url=self.response.url).path
6778
# Every HTTP path which can raise this error is in the format
6879
# `/something/{target_id}`.
@@ -72,86 +83,100 @@ def target_id(self) -> str:
7283
# This is not simulated by the mock.
7384
@beartype
7485
class DateRangeError(VWSError): # pragma: no cover
75-
"""Exception raised when Vuforia returns a response with a result code
86+
"""
87+
Exception raised when Vuforia returns a response with a result code
7688
'DateRangeError'.
7789
"""
7890

7991

8092
# This is not simulated by the mock.
8193
@beartype
8294
class TargetQuotaReachedError(VWSError): # pragma: no cover
83-
"""Exception raised when Vuforia returns a response with a result code
95+
"""
96+
Exception raised when Vuforia returns a response with a result code
8497
'TargetQuotaReached'.
8598
"""
8699

87100

88101
# This is not simulated by the mock.
89102
@beartype
90103
class ProjectSuspendedError(VWSError): # pragma: no cover
91-
"""Exception raised when Vuforia returns a response with a result code
104+
"""
105+
Exception raised when Vuforia returns a response with a result code
92106
'ProjectSuspended'.
93107
"""
94108

95109

96110
# This is not simulated by the mock.
97111
@beartype
98112
class ProjectHasNoAPIAccessError(VWSError): # pragma: no cover
99-
"""Exception raised when Vuforia returns a response with a result code
113+
"""
114+
Exception raised when Vuforia returns a response with a result code
100115
'ProjectHasNoAPIAccess'.
101116
"""
102117

103118

104119
@beartype
105120
class ProjectInactiveError(VWSError):
106-
"""Exception raised when Vuforia returns a response with a result code
121+
"""
122+
Exception raised when Vuforia returns a response with a result code
107123
'ProjectInactive'.
108124
"""
109125

110126

111127
@beartype
112128
class MetadataTooLargeError(VWSError):
113-
"""Exception raised when Vuforia returns a response with a result code
129+
"""
130+
Exception raised when Vuforia returns a response with a result code
114131
'MetadataTooLarge'.
115132
"""
116133

117134

118135
@beartype
119136
class RequestTimeTooSkewedError(VWSError):
120-
"""Exception raised when Vuforia returns a response with a result code
137+
"""
138+
Exception raised when Vuforia returns a response with a result code
121139
'RequestTimeTooSkewed'.
122140
"""
123141

124142

125143
@beartype
126144
class TargetNameExistError(VWSError):
127-
"""Exception raised when Vuforia returns a response with a result code
145+
"""
146+
Exception raised when Vuforia returns a response with a result code
128147
'TargetNameExist'.
129148
"""
130149

131150
@property
132151
def target_name(self) -> str:
133-
"""The target name which already exists."""
152+
"""
153+
The target name which already exists.
154+
"""
134155
response_body = self.response.request_body or b""
135156
request_json = json.loads(s=response_body)
136157
return str(object=request_json["name"])
137158

138159

139160
@beartype
140161
class ImageTooLargeError(VWSError):
141-
"""Exception raised when Vuforia returns a response with a result code
162+
"""
163+
Exception raised when Vuforia returns a response with a result code
142164
'ImageTooLarge'.
143165
"""
144166

145167

146168
@beartype
147169
class TargetStatusNotSuccessError(VWSError):
148-
"""Exception raised when Vuforia returns a response with a result code
170+
"""
171+
Exception raised when Vuforia returns a response with a result code
149172
'TargetStatusNotSuccess'.
150173
"""
151174

152175
@property
153176
def target_id(self) -> str:
154-
"""The unknown target ID."""
177+
"""
178+
The unknown target ID.
179+
"""
155180
path = urlparse(url=self.response.url).path
156181
# Every HTTP path which can raise this error is in the format
157182
# `/something/{target_id}`.
@@ -160,6 +185,7 @@ def target_id(self) -> str:
160185

161186
@beartype
162187
class TooManyRequestsError(VWSError): # pragma: no cover
163-
"""Exception raised when Vuforia returns a response with a result code
188+
"""
189+
Exception raised when Vuforia returns a response with a result code
164190
'TooManyRequests'.
165191
"""

0 commit comments

Comments
 (0)