diff --git a/docs/README.rst b/docs/README.rst --- a/docs/README.rst +++ b/docs/README.rst @@ -9,7 +9,7 @@ .. code-block:: python - from swh.web.client import WebAPIClient + from swh.web.client.client import WebAPIClient cli = WebAPIClient() # retrieve any archived object via its PID diff --git a/docs/index.rst b/docs/index.rst --- a/docs/index.rst +++ b/docs/index.rst @@ -61,7 +61,7 @@ Note that if you intend to use the :class:`swh.web.client.client.WebAPIClient` class, you can activate authentication by using the following code snippet:: - from swh.web.client import WebAPIClient + from swh.web.client.client import WebAPIClient TOKEN = '.......' # Use "swh auth login" command to get it @@ -87,4 +87,4 @@ /apidoc/swh.web.client .. _Software Heritage Identity Provider: - https://auth.softwareheritage.org/auth/realms/SoftwareHeritage/account/ \ No newline at end of file + https://auth.softwareheritage.org/auth/realms/SoftwareHeritage/account/ diff --git a/swh/web/client/__init__.py b/swh/web/client/__init__.py --- a/swh/web/client/__init__.py +++ b/swh/web/client/__init__.py @@ -1 +0,0 @@ -from .client import WebAPIClient # NoQA: F401 diff --git a/swh/web/client/client.py b/swh/web/client/client.py --- a/swh/web/client/client.py +++ b/swh/web/client/client.py @@ -10,7 +10,7 @@ .. code-block:: python - from swh.web.client import WebAPIClient + from swh.web.client.client import WebAPIClient cli = WebAPIClient() # retrieve any archived object via its PID diff --git a/swh/web/client/tests/conftest.py b/swh/web/client/tests/conftest.py --- a/swh/web/client/tests/conftest.py +++ b/swh/web/client/tests/conftest.py @@ -6,7 +6,7 @@ import pytest from .api_data import API_URL, API_DATA -from swh.web.client import WebAPIClient +from swh.web.client.client import WebAPIClient @pytest.fixture @@ -19,11 +19,13 @@ headers = { "Link": f'<{API_URL}/{api_call}?branches_count=1000&branches_from=refs/tags/v3.0-rc7>; rel="next"' # NoQA: E501 } - elif api_call == "origin/https://github.com/NixOS/nixpkgs/visits/?last_visit=50&per_page=10": # NoQA: E501 + elif ( + api_call + == "origin/https://github.com/NixOS/nixpkgs/visits/?last_visit=50&per_page=10" # NoQA: E501 + ): # to make the client follow pagination headers = { - "Link": - f"<{API_URL}/origin/https://github.com/NixOS/nixpkgs/visits/?last_visit=40&per_page=10>; rel=\"next\"" # NoQA: E501 + "Link": f'<{API_URL}/origin/https://github.com/NixOS/nixpkgs/visits/?last_visit=40&per_page=10>; rel="next"' # NoQA: E501 } requests_mock.get(f"{API_URL}/{api_call}", text=data, headers=headers) return requests_mock