Skip to content

Commit

Permalink
Fix import of removed httpx type (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
pederhan authored Jan 21, 2025
1 parent e5eeccb commit 8bb9ef8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ While the project is still on major version 0, breaking changes may be introduce

<!-- changelog follows -->

<!-- ## Unreleased -->
## Unreleased

### Fixed

- Missing import error when using httpx>=0.28.0. ([#102](https://github.com/unioslo/harborapi/issues/102))

## [0.26.1](https://github.com/unioslo/harborapi/tree/harborapi-v0.26.1) - 2024-11-26

Expand Down
14 changes: 7 additions & 7 deletions harborapi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import contextlib
import os
import ssl
import warnings
from http.cookiejar import CookieJar
from pathlib import Path
Expand All @@ -22,7 +23,6 @@
import httpx
from httpx import Response
from httpx import Timeout
from httpx._types import VerifyTypes
from pydantic import BaseModel
from pydantic import SecretStr
from pydantic import ValidationError
Expand Down Expand Up @@ -184,7 +184,7 @@ def __init__(
# HTTPX client options
follow_redirects: bool = True,
timeout: Union[float, Timeout] = 10.0,
verify: VerifyTypes = True,
verify: Union[ssl.SSLContext, str, bool] = True,
# Retry options
retry: Optional[RetrySettings] = RetrySettings(), # type: ignore[call-arg]
**kwargs: Any,
Expand Down Expand Up @@ -226,10 +226,10 @@ def __init__(
timeout : Union[float, Timeout]
The timeout to use for requests.
Can be either a float or a `httpx.Timeout` object.
verify : VerifyTypes
verify : Union[ssl.SSLContext, str, bool]
Control verification of the server's TLS certificate.
See `httpx._types.VerifyTypes` for more information or
<https://www.python-httpx.org/advanced/ssl/>.
Can be an SSL context, a path to a CA bundle, or a boolean.
Defaults to True.
**kwargs : Any
Backwards-compatibility with deprecated parameters.
Unknown kwargs are ignored.
Expand Down Expand Up @@ -271,7 +271,7 @@ def authenticate(
basicauth: Optional[str] = None,
credentials_file: Optional[Union[str, Path]] = None,
url: Optional[str] = None,
verify: Optional[VerifyTypes] = None,
verify: Optional[Union[ssl.SSLContext, str, bool]] = None,
**kwargs: Any,
) -> None:
"""(Re-)Authenticate the client with the provided credentials.
Expand All @@ -291,7 +291,7 @@ def authenticate(
`username`, `secret` and `basicauth` must not be provided if this is used.
url : Optional[str]
The URL of the Harbor server in the format `http://host:[port]/api/v<version>`
verify : Optional[VerifyTypes]
verify : Optional[Union[ssl.SSLContext, str, bool]]
Control verification of the server's TLS certificate.
**kwargs : Any
Additional keyword arguments to pass in.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ classifiers = [
"Typing :: Typed",
]
dependencies = [
"httpx>=0.22.0",
"httpx>=0.28.1",
"pydantic>=2.2.1",
"backoff>=2.1.2",
"typing_extensions>=4.4.0",
Expand Down

0 comments on commit 8bb9ef8

Please sign in to comment.