Skip to content

Commit 1e1400e

Browse files
committed
version 4.0.0
1 parent 79cbdd9 commit 1e1400e

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

docs/additional_info/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Changelog
44
=========
55

6-
4.0.0 (28-Sep-2025)
6+
4.0.0 (29-Sep-2025)
77
-------------------
88

99
* Require Python 3.10+

lokalise/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def get_endpoint(self, name: str) -> BaseEndpoint:
9595
is "projects", then it will load .endpoints.projects_endpoint module
9696
and then set attribute like this:
9797
self._projects_endpoint = ProjectsEndpoint(self)
98-
98+
9999
This is internal; prefer calling mixin methods like client.projects().
100100
101101
:param str name: Endpoint name to load
@@ -109,7 +109,7 @@ def get_endpoint(self, name: str) -> BaseEndpoint:
109109
endpoint_klass = getattr(module, camelized_name)
110110
except (ModuleNotFoundError, AttributeError) as e:
111111
raise ValueError(f"Unknown endpoint: {name}") from e
112-
112+
113113
# Find endpoint class in the module
114114
endpoint_klass: type[BaseEndpoint] = getattr(module, camelized_name)
115115
return self._fetch_attr(f"_{endpoint_name}", lambda: endpoint_klass(self))

lokalise/collections/base_collection.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def __init__(self, raw_data: dict[str, Any]) -> None:
8282
self.current_page = 0
8383
self.next_cursor = None
8484

85-
8685
def __iter__(self):
8786
return iter(self.items)
8887

lokalise/oauth2/request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import requests
1010

1111
from lokalise._version import __version__
12-
from lokalise.request_utils import format_params, raise_on_error, join_url
12+
from lokalise.request_utils import format_params, join_url, raise_on_error
1313

1414
BASE_URL = "https://app.lokalise.com/oauth2/"
1515

@@ -45,4 +45,4 @@ def options() -> dict[str, Any]:
4545
"User-Agent": f"python-lokalise-api plugin/{__version__}",
4646
"Content-Type": "application/json",
4747
}
48-
return {"headers": headers}
48+
return {"headers": headers}

lokalise/request.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,11 @@ def options(
174174
"Accept": "application/json",
175175
"User-Agent": f"python-lokalise-api plugin/{__version__}",
176176
}
177-
177+
178178
if client.token is None:
179-
raise RuntimeError("Cannot build headers: API token is not set. Did you call reset_client()?")
179+
raise RuntimeError(
180+
"Cannot build headers: API token is not set. Did you call reset_client()?"
181+
)
180182

181183
headers[client.token_header] = client.token
182184

@@ -207,4 +209,4 @@ def _build_timeout(client: FullClientProto) -> float | tuple[float, float] | Non
207209
if ct is not None and rt is not None:
208210
return (ct, rt)
209211

210-
return ct if ct is not None else rt
212+
return ct if ct is not None else rt

tests/client/client_setup_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_reset_client():
5959

6060
client.reset_client()
6161

62-
assert client.token == None
62+
assert client.token is None
6363
assert client.connect_timeout is None
6464
assert client.read_timeout is None
6565
assert not client.enable_compression
@@ -184,7 +184,7 @@ def test_reset_client_allows_reloading_endpoints(client: lokalise.Client) -> Non
184184

185185

186186
def test_get_endpoint_populates_when_attr_is_none(client: lokalise.Client) -> None:
187-
setattr(client, "_projects_endpoint", None)
187+
client._projects_endpoint = None
188188
ep = client.get_endpoint("projects")
189189
assert ep is not None
190190

@@ -195,7 +195,7 @@ def test_reset_client_requires_new_token() -> None:
195195
assert client.token == "valid-token"
196196

197197
client.reset_client()
198-
assert client.token == None
198+
assert client.token is None
199199

200200
with pytest.raises(ValueError, match="token must be a non-empty string"):
201201
client.token = ""

tests/client/oauth_client_setup_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def test_client_arguments(oauth_client: OAuthClient) -> None:
1010
token = oauth_client.token
1111
assert token is not None, "OAuthClient.token must not be None"
1212
assert "Bearer" in token
13-
13+
1414
assert oauth_client.connect_timeout == 4
1515
assert oauth_client.read_timeout == 2
1616
assert oauth_client.enable_compression
@@ -23,4 +23,4 @@ def test_reset_client(oauth_client: OAuthClient) -> None:
2323

2424
oauth_client.reset_client()
2525

26-
assert oauth_client.token == None
26+
assert oauth_client.token is None

0 commit comments

Comments
 (0)