Skip to content

Commit

Permalink
fix: remove dependency on packaging introduced in 6fe6c24 "fix: worka…
Browse files Browse the repository at this point in the history
…round...
  • Loading branch information
daniel-jones-dev authored and JanEbbing committed Nov 7, 2023
1 parent ea36bd8 commit 39efaa2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Fixed
* Fixed typo in error message when no auth key is provided.
* Removed dependency on `packaging` by replacing version comparison.


## [1.16.0] - 2023-11-03
Expand Down
7 changes: 3 additions & 4 deletions deepl/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 14,6 @@
from typing import Dict, Optional, Tuple, Union
from .util import log_info
from deepl import util
from packaging import version as packaging_version_module
import json as json_module


Expand Down Expand Up @@ -230,9 229,9 @@ def _prepare_request(
self._app_info_version,
),
)
if packaging_version_module.parse(
requests.__version__
) >= packaging_version_module.parse("2.4.2"):

# TODO review when minimum Python version is raised
if tuple(map(int, requests.__version__.split("."))) >= (2, 4, 2):
kwargs["json"] = json
elif json is not None:
# This is fine, see official docs
Expand Down

0 comments on commit 39efaa2

Please sign in to comment.