Skip to content

Commit

Permalink
HH-243525 Move to frogejo.pyn.ru from github.com
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyGladkov committed Dec 26, 2024
1 parent 604a414 commit 8573381
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
2 changes: 0 additions & 2 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: frontik
annotations:
github.com/project-slug: hhru/frontik
tags:
- backend
- python
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.building
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.4
FROM registry.pyn.ru/python3.11-bullseye-building:2023.08.01

RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan forgejo.pyn.ru >> ~/.ssh/known_hosts

COPY frontik-test README.md MANIFEST.in /home/building/
COPY poetry.lock pyproject.toml /home/building/
Expand Down
11 changes: 6 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
## Frontik

Frontik это питон вебсервер + фреймворк
Frontik это питон вебсервер + фреймворк

Ранее (версии 7.* и ниже) был оберткой над [tornado](https://www.tornadoweb.org/).
С версии 8.* идет работа над превращением фронтика в [asgi](https://asgi.readthedocs.io/) сервер.
Ранее (версии 7._ и ниже) был оберткой над [tornado](https://www.tornadoweb.org/).
С версии 8._ идет работа над превращением фронтика в [asgi](https://asgi.readthedocs.io/) сервер.
Конечные сервисы должны стремиться использовать asgi фреймворк (fastapi).
В 8.* все еще является вебсервером + фреймворком.
В 8.\* все еще является вебсервером + фреймворком.

#### Рекомендуемая структура проекта

```
project_name/
├── service_name/
Expand All @@ -21,7 +22,7 @@ project_name/
#### Установка

```shell
pip install 'frontik@git+ssh://git@github.com/hhru/frontik'
pip install 'frontik@git+ssh://git@forgejo.pyn.ru/hhru/frontik'
```

#### Запуск из кода
Expand Down
5 changes: 3 additions & 2 deletions docs/http_client.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
## HttpClient

В проекте используется https://github.com/hhru/balancing-http-client.
В проекте используется https://forgejo.pyn.ru/hhru/balancing-http-client.
Внутри это aiohttp с дополнительной логикой ретраев/балансировки.
Фронтик сам конструирует экземпляр клиента под каждый запрос.
Фронтик сам конструирует экземпляр клиента под каждый запрос.
В качестве апстримов передается обновляемый список, получаемый из консула

Пример использования

```python
from frontik.dependencies import http_client
from frontik.routing import router
Expand Down
4 changes: 2 additions & 2 deletions frontik/consul_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def http_connect(self, host, port, scheme, verify=True, cert=None, timeout=None)
)


# this implementation was copied from https://github.com/hhru/python-consul2/blob/master/consul/aio.py#L16
# this implementation was copied from https://forgejo.pyn.ru/hhru/python-consul2/blob/master/consul/aio.py#L16
# and then _client_event_callback was added
class _AsyncConsulHttpClient(base.HTTPClient):
"""Asyncio adapter for python consul using aiohttp library"""
Expand Down Expand Up @@ -160,7 +160,7 @@ async def close(self) -> None:
await self._session.close()


# this implementation was copied from https://github.com/hhru/python-consul2/blob/master/consul/std.py#L8
# this implementation was copied from https://forgejo.pyn.ru/hhru/python-consul2/blob/master/consul/std.py#L8
# and then _client_event_callback was added
class _SyncConsulHttpClient(base.HTTPClient):
def __init__(self, *args: Any, client_event_callback: ClientEventCallback, **kwargs: Any):
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ name = 'frontik'
version = '8.2.16'
description = 'Frontik is an asyncronous Tornado-based application server'
authors = ['platform <[email protected]>']
repository = 'https://github.com/hhru/frontik'
homepage = 'https://github.com/hhru/frontik'
repository = 'https://forgejo.pyn.ru/hhru/frontik'
homepage = 'https://forgejo.pyn.ru/hhru/frontik'
readme = 'README.md'

[tool.poetry.scripts]
Expand All @@ -22,8 +22,8 @@ lxml = '4.9.2'
pydantic = '^2.3.0'
tornado = '6.3.3'
orjson = '*'
http-client = {git = 'https://github.com/hhru/balancing-http-client.git', tag = '2.1.23'}
python-consul2-hh = {git = 'https://github.com/hhru/python-consul2', tag = 'v0.2.10'}
http-client = {git = 'git+ssh://[email protected]/hhru/balancing-http-client.git', tag = '2.1.23'}
python-consul2-hh = {git = 'git+ssh://[email protected]/hhru/python-consul2', tag = 'v0.2.10'}
opentelemetry-sdk = '1.25.0'
opentelemetry-api = '1.25.0'
opentelemetry-exporter-otlp-proto-grpc = '1.25.0'
Expand Down

0 comments on commit 8573381

Please sign in to comment.