Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Jan 28, 2025
2 parents 5121d24 + 56e3d03 commit 8253941
Show file tree
Hide file tree
Showing 209 changed files with 1,432 additions and 1,269 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- master

env:
DEFAULT_PYTHON: '3.12'
DEFAULT_PYTHON: '3.13'

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ concurrency:
cancel-in-progress: true

env:
# flake8-commas is failing on Python 3.12
DEFAULT_PYTHON: '3.11'
DEFAULT_PYTHON: '3.13'

jobs:
linters:
Expand Down Expand Up @@ -55,6 +54,7 @@ jobs:
- name: Install dependencies
run: |
poetry install --no-root --all-extras --with dev --without docs,test
pip install -U flake8-commas
- name: Run flake8
run: poetry run flake8 horizon/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
workflow_dispatch:

env:
DEFAULT_PYTHON: '3.12'
DEFAULT_PYTHON: '3.13'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- '[0-9]+.[0-9]+.[0-9]+'

env:
DEFAULT_PYTHON: '3.12'
DEFAULT_PYTHON: '3.13'

jobs:
release:
Expand Down Expand Up @@ -122,5 +122,6 @@ jobs:
name: ${{ steps.release-name.outputs.name }}
body_path: changelog.md
files: |
dist/*
dist/*.tar.gz
dist/*.whl
openapi.json
15 changes: 10 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: true

env:
DEFAULT_PYTHON: '3.12'
DEFAULT_PYTHON: '3.13'

jobs:
tests:
Expand All @@ -22,11 +22,16 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.12']
pydantic-version: [1, 2]
os: [ubuntu-latest]
include:
- python-version: '3.7'
pydantic-version: '1'
os: ubuntu-22.04

- python-version: '3.13'
pydantic-version: '2'
os: ubuntu-latest
env:
POETRY_VERSION: ${{ matrix.python-version == '3.7' && '1.5.1' || '1.8.2' }}
POETRY_VERSION: ${{ matrix.python-version == '3.7' && '1.5.1' || '2.0.1' }}

steps:
- name: Checkout code
Expand Down
15 changes: 6 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
default_language_version:
python: python3.12

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
Expand Down Expand Up @@ -54,11 +51,11 @@ repos:
args:
- --license-filepath
- .spdx-license-header.txt
- --use-current-year
- --allow-past-years
- --no-extra-eol

- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py37-plus, --keep-runtime-typing]
Expand Down Expand Up @@ -87,7 +84,7 @@ repos:
- black==24.4.2

- repo: https://github.com/pycqa/bandit
rev: 1.7.10
rev: 1.8.2
hooks:
- id: bandit
args:
Expand All @@ -97,7 +94,7 @@ repos:
require_serial: true

- repo: https://github.com/pycqa/isort
rev: 5.13.2
rev: 6.0.0
hooks:
- id: isort
name: isort
Expand All @@ -114,15 +111,15 @@ repos:
args: [--autofix, --indent, '2', --offset, '2']

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.0
hooks:
- id: codespell
args: [-w]
additional_dependencies:
- tomli

- repo: https://github.com/sbrunner/hooks
rev: 1.1.2
rev: 1.2.1
hooks:
- id: poetry-check
additional_dependencies:
Expand Down
11 changes: 6 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
version: 2

sphinx:
configuration: docs/conf.py

build:
os: ubuntu-22.04
tools:
python: '3.12'
python: '3.13'

apt_packages:
- libldap2-dev
- libsasl2-dev

jobs:
post_checkout:
- git fetch --unshallow || true
post_create_environment:
- python -m pip install poetry
- python -m pip install --no-deps sphinx-plantuml # remove after https://github.com/zqmillet/sphinx-plantuml/pull/4
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH python -m poetry config virtualenvs.create false
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH python -m poetry config virtualenvs.prefer-active-python true
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH python -m poetry debug info
post_install:
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH python -m poetry install --no-root --all-extras --with docs --without dev,test
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH python -m poetry show -v
- python -m pip list -v
- HORIZON__DATABASE__URL=postgresql+asyncpg://fake:[email protected]:5432/fake HORIZON__AUTH__ACCESS_TOKEN__SECRET_KEY=fake python -m horizon.backend.export_openapi_schema docs/_static/openapi.json

sphinx:
configuration: docs/conf.py
2 changes: 1 addition & 1 deletion .spdx-license-header.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SPDX-FileCopyrightText: 2023-2024 MTS PJSC
SPDX-FileCopyrightText: 2023-2025 MTS PJSC
SPDX-License-Identifier: Apache-2.0
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2023-2024 MTS PJSC. All rights reserved.
Copyright 2023-2025 MTS PJSC. All rights reserved.

Apache License
Version 2.0, January 2004
Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile.backend
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12-slim AS prod
FROM python:3.13-slim AS prod
LABEL maintainer="DataOps.ETL"

RUN apt-get update && apt-get install -y \
Expand All @@ -18,7 +18,6 @@ RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*


WORKDIR /app
ENV PYTHONPATH=/app

Expand All @@ -27,7 +26,8 @@ RUN pip install poetry \

COPY ./pyproject.toml ./poetry.lock* ./

RUN poetry install \
RUN --mount=type=cache,target=/root/.cache/pypoetry \
poetry install \
--no-root \
--all-extras \
--without dev,test,docs
Expand Down
8 changes: 8 additions & 0 deletions docs/changelog/1.0.3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
1.0.3 (2025-01-28)
==================

Improvements
------------

- Add compatibility with ``Python 3.13`` (:issue:`94`)
- Replace outdated ``python-jose`` dependency with ``authlib.jose``, to fix security issues. (:issue:`97`)
1 change: 1 addition & 0 deletions docs/changelog/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
:caption: Changelog

DRAFT
1.0.3
1.0.2
1.0.1
1.0.0
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# -- Project information -----------------------------------------------------

project = "horizon"
copyright = "2023-2024 MTS PJSC"
copyright = "2023-2025 MTS PJSC"
author = "DataOps.ETL"

# The version info for the project you're documenting, acts as replacement for
Expand All @@ -34,7 +34,7 @@
# The short X.Y version.

# this value is updated automatically by `poetry version ...` and poetry-bumpversion plugin
ver = Version.parse("1.0.2")
ver = Version.parse("1.0.3")
version = ver.base_version
# The full version, including alpha/beta/rc tags.
release = ver.public
Expand Down
4 changes: 2 additions & 2 deletions horizon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0

# _raw_version could contain pre-release version, like 0.0.1dev123
# value is updated automatically by `poetry version ...` and poetry-bumpversion plugin
_raw_version = "1.0.2"
_raw_version = "1.0.3"

# version always contain only release number like 0.0.1
__version__ = ".".join(_raw_version.split(".")[:3])
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0

from typing import Type
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/env python3
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0

import os
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0
5 changes: 3 additions & 2 deletions horizon/backend/api/handlers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations

import http
import logging
from typing import Mapping

from asgi_correlation_id import correlation_id
from fastapi import HTTPException, Request, Response
Expand Down Expand Up @@ -115,7 +116,7 @@ def application_exception_handler(request: Request, exc: ApplicationError) -> Re
def exception_json_response(
status: int,
content: BaseErrorSchema,
headers: dict[str, str] | None = None,
headers: Mapping[str, str] | None = None,
) -> Response:
# Using Response + `model.json()` because JSONResponse + `model.dict()` does not convert Unset() to JSON value "<unset>"
content_type = type(content)
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/api/monitoring.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0

from fastapi import APIRouter
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/api/router.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0

from fastapi import APIRouter
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/api/v1/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0
2 changes: 1 addition & 1 deletion horizon/backend/api/v1/router/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0
from fastapi import APIRouter

Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/api/v1/router/auth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0

from fastapi import APIRouter, Depends
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/api/v1/router/hwm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0

# mypy: disable-error-code="pydantic-orm"
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/api/v1/router/hwm_history.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0

from fastapi import APIRouter, Depends
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/api/v1/router/namespace_history.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0

from fastapi import APIRouter, Depends
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/api/v1/router/namespaces.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0

# mypy: disable-error-code="pydantic-orm"
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/api/v1/router/users.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0

# mypy: disable-error-code="pydantic-orm"
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/db/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0
2 changes: 1 addition & 1 deletion horizon/backend/db/factory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0

from typing import AsyncGenerator
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/db/migrations/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/env python3

# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/db/migrations/env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0
import asyncio
from logging.config import fileConfig
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0

"""Add user table
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0
"""Add namespace table
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0
"""Add hwm table
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC
# SPDX-FileCopyrightText: 2023-2025 MTS PJSC
# SPDX-License-Identifier: Apache-2.0
"""Add hwm_history table
Expand Down
Loading

0 comments on commit 8253941

Please sign in to comment.