Skip to content

Commit

Permalink
[Auto-generated] Update dependencies (#227)
Browse files Browse the repository at this point in the history
* [Auto-generated] Check & update dependencies (`pyproject.toml`) (#220)

* Update dependencies in `pyproject.toml`

* Update pyproject.toml

* Reorder exception catching

Fix expected JSON response formatting in tests.

---------

Co-authored-by: Casper Welzel Andersen <[email protected]>
Co-authored-by: Casper Welzel Andersen <[email protected]>

* Bump SINTEF/ci-cd from 2.8.3 to 2.9.0 (#224)

Bumps [SINTEF/ci-cd](https://github.com/sintef/ci-cd) from 2.8.3 to 2.9.0.
- [Release notes](https://github.com/sintef/ci-cd/releases)
- [Changelog](https://github.com/SINTEF/ci-cd/blob/main/CHANGELOG.md)
- [Commits](SINTEF/ci-cd@v2.8.3...v2.9.0)

---
updated-dependencies:
- dependency-name: SINTEF/ci-cd
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [Auto-generated] Check & update dependencies (`pyproject.toml`) (#225)

* Update dependencies in `pyproject.toml`

* Update pyproject.toml

---------

Co-authored-by: Casper Welzel Andersen <[email protected]>

* Update `pre-commit` hooks

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Casper Welzel Andersen <[email protected]>
Co-authored-by: Casper Welzel Andersen <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Feb 1, 2025
1 parent 9570d1a commit 6f7a686
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
release:
name: External
uses: SINTEF/ci-cd/.github/workflows/cd_release.yml@v2.8.3
uses: SINTEF/ci-cd/.github/workflows/cd_release.yml@v2.9.0
if: github.repository == 'SINTEF/entities-service' && startsWith(github.ref, 'refs/tags/v')
with:
# General
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_automerge_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
update-dependencies-branch:
name: External
uses: SINTEF/ci-cd/.github/workflows/ci_automerge_prs.yml@v2.8.3
uses: SINTEF/ci-cd/.github/workflows/ci_automerge_prs.yml@v2.9.0
if: github.repository_owner == 'SINTEF' && ( ( startsWith(github.event.pull_request.head.ref, 'dependabot/') && github.actor == 'dependabot[bot]' ) || ( github.event.pull_request.head.ref == 'ci/update-pyproject' && github.actor == 'TEAM4-0' ) || ( github.event.pull_request.head.ref == 'pre-commit-ci-update-config' && github.actor == 'pre-commit-ci[bot]' ) )
secrets:
PAT: ${{ secrets.TEAM40_PAT }}
2 changes: 1 addition & 1 deletion .github/workflows/ci_cd_updated_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
update-deps-branch-and-docs:
name: External
uses: SINTEF/ci-cd/.github/workflows/ci_cd_updated_default_branch.yml@v2.8.3
uses: SINTEF/ci-cd/.github/workflows/ci_cd_updated_default_branch.yml@v2.9.0
if: github.repository_owner == 'SINTEF'
with:
# General
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_check_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
check-dependencies:
name: External
uses: SINTEF/ci-cd/.github/workflows/ci_check_pyproject_dependencies.yml@v2.8.3
uses: SINTEF/ci-cd/.github/workflows/ci_check_pyproject_dependencies.yml@v2.9.0
if: github.repository_owner == 'SINTEF'
with:
git_username: "TEAM 4.0[bot]"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
basic-tests:
name: External
uses: SINTEF/ci-cd/.github/workflows/ci_tests.yml@v2.8.3
uses: SINTEF/ci-cd/.github/workflows/ci_tests.yml@v2.9.0
with:
# General setup
install_extras: "[dev]"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_update_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
create-collected-pr:
name: External
uses: SINTEF/ci-cd/.github/workflows/ci_update_dependencies.yml@v2.8.3
uses: SINTEF/ci-cd/.github/workflows/ci_update_dependencies.yml@v2.9.0
if: github.repository_owner == 'SINTEF'
with:
# General
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ repos:
# Black is a code style and formatter
# It works on files in-place
- repo: https://github.com/psf/black
rev: 24.10.0
rev: 25.1.0
hooks:
- id: black

# Ruff is a code style and formatter
# It works on files in-place
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.3
rev: v0.9.4
hooks:
- id: ruff
args:
Expand Down
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
2 changes: 1 addition & 1 deletion entities_service/service/routers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def list_entities(
"times - entities will be returned as an aggregated, flat list."
),
),
] = [] # noqa: B006
] = [], # noqa: B006
) -> list[dict[str, Any]]:
"""List all entities in the given namespace(s)."""
# Format namespaces
Expand Down
2 changes: 1 addition & 1 deletion entities_service/service/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ async def verify_user_access_token(token: str) -> tuple[bool, int | None, str |


async def verify_token(
credentials: Annotated[HTTPAuthorizationCredentials, Depends(SECURITY_SCHEME)]
credentials: Annotated[HTTPAuthorizationCredentials, Depends(SECURITY_SCHEME)],
) -> None:
"""Verify a client user."""
credentials_exception = HTTPException(
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ requires-python = "~=3.10"
dynamic = ["version", "description"]

dependencies = [
"fastapi ~=0.115.6",
"fastapi ~=0.115.7",
"httpx >=0.27.2,<1",
"pydantic-settings ~=2.7",
"pymongo ~=4.10",
Expand All @@ -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 All @@ -71,7 +71,7 @@ server = [
"gunicorn ~=23.0.0",
]
dev = [
"pre-commit ~=4.0",
"pre-commit ~=4.1",
"entities-service[cli,testing]",
]

Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ def get_backend_user() -> GetBackendUserFixture:
from entities_service.service.config import CONFIG

def _get_backend_user(
auth_role: Literal["read", "write"] | None = None
auth_role: Literal["read", "write"] | None = None,
) -> UserDict:
"""Return the backend user for the given authentication role."""
if auth_role is None:
Expand Down Expand Up @@ -763,7 +763,7 @@ def mock_auth_verification(
mock_openid_config_call(base_url=str(CONFIG.oauth2_provider_base_url).rstrip("/"))

def _mock_auth_verification(
auth_role: Literal["read", "write"] | None = None
auth_role: Literal["read", "write"] | None = None,
) -> None:
"""Mock authentication on the /_admin endpoints."""
if auth_role is None:
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

0 comments on commit 6f7a686

Please sign in to comment.