Skip to content

Commit 39efaa2

Browse files
daniel-jones-devJanEbbing
authored andcommitted
fix: remove dependency on packaging introduced in 6fe6c24 "fix: workaround...
1 parent ea36bd8 commit 39efaa2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99
### Fixed
1010
* Fixed typo in error message when no auth key is provided.
11+
* Removed dependency on `packaging` by replacing version comparison.
1112

1213

1314
## [1.16.0] - 2023-11-03

deepl/http_client.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from typing import Dict, Optional, Tuple, Union
1515
from .util import log_info
1616
from deepl import util
17-
from packaging import version as packaging_version_module
1817
import json as json_module
1918

2019

@@ -230,9 +229,9 @@ def _prepare_request(
230229
self._app_info_version,
231230
),
232231
)
233-
if packaging_version_module.parse(
234-
requests.__version__
235-
) >= packaging_version_module.parse("2.4.2"):
232+
233+
# TODO review when minimum Python version is raised
234+
if tuple(map(int, requests.__version__.split("."))) >= (2, 4, 2):
236235
kwargs["json"] = json
237236
elif json is not None:
238237
# This is fine, see official docs

0 commit comments

Comments
 (0)