Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Auto-generated] Check & update dependencies (pyproject.toml) #220

Merged
merged 3 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions entities_service/cli/commands/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ def login(
with httpx.Client(base_url=str(CONFIG.base_url), timeout=10) as client:
try:
response = client.post("/_admin/create", json=[], auth=oauth)
except httpx.HTTPError as exc:
ERROR_CONSOLE.print(
f"[bold red]Error[/bold red]: Could not login. HTTP exception: {exc}"
)
raise typer.Exit(1) from exc
except AuthenticationError as exc:
ERROR_CONSOLE.print(
f"[bold red]Error[/bold red]: Could not login. Authentication failed "
f"({exc.__class__.__name__}): {exc}"
)
raise typer.Exit(1) from exc
except httpx.HTTPError as exc:
ERROR_CONSOLE.print(
f"[bold red]Error[/bold red]: Could not login. HTTP exception: {exc}"
)
raise typer.Exit(1) from exc
except json.JSONDecodeError as exc:
ERROR_CONSOLE.print(
f"[bold red]Error[/bold red]: Could not login. JSON decode error: {exc}"
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ dependencies = [

[project.optional-dependencies]
cli = [
"httpx-auth ~=0.22.0",
"httpx-auth ~=0.23.1",
"pyyaml ~=6.0",
"typer ~=0.15.1",
]
testing = [
"cryptography >=43.0.0,<45",
# Pytest runs, end in Segmentation Fault for dlite-python versions >0.5.23
"dlite-python <=0.5.23; python_version<'3.13'", # DLite is not yet compatible with Python 3.13
"dlite-python <=0.5.23; python_version < '3.13'", # DLite is not yet compatible with Python 3.13
"mongomock ~=4.3",
"pytest ~=8.3",
"pytest-asyncio ~=0.25.1",
"pytest-asyncio ~=0.25.2",
"pytest-cov ~=6.0",
"pytest-httpx >=0.34.0,<1",
"entities-service[cli]",
Expand Down
10 changes: 8 additions & 2 deletions tests/service/test_security.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,10 @@ async def test_verify_user_access_token_parse_error_user(
assert await verify_user_access_token("mock_token") == (False, None, None)

assert "Could not parse user info from GitLab provider." in caplog.messages
assert f"Response:\n{json.dumps({'invalid': 'response'})}" in caplog.messages
response = json.dumps(
{"invalid": "response"}, indent=0, separators=(",", ":")
).replace("\n", "")
assert f"Response:\n{response}" in caplog.messages


async def test_verify_user_access_token_parse_error_member(
Expand Down Expand Up @@ -511,7 +514,10 @@ async def test_verify_user_access_token_parse_error_member(

assert "Could not parse user info from GitLab provider." not in caplog.messages
assert "Could not parse member role from GitLab provider." in caplog.messages
assert f"Response:\n{json.dumps({'invalid': 'response'})}" in caplog.messages
response = json.dumps(
{"invalid": "response"}, indent=0, separators=(",", ":")
).replace("\n", "")
assert f"Response:\n{response}" in caplog.messages


async def test_verify_user_access_token_is_called(
Expand Down
Loading