Skip to content

Commit

Permalink
HH-187397 switch to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
712u3 committed Aug 3, 2023
1 parent 48aad37 commit 463d8f2
Show file tree
Hide file tree
Showing 12 changed files with 1,603 additions and 85 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ jobs:
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab

- run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev
- name: Install python
uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0
uses: actions/setup-python@v4
id: pinstall
with:
python-version-file: '.python-version'
python-version-file: pyproject.toml
cache: pip
cache-dependency-path: |
**/requirements*.txt
poetry.lock
- name: Install poetry
run: |
python -m pip install poetry
- name: Install package
run: |
pip3 install --prefer-binary -r requirements.txt -r requirements_venv.txt .
poetry install
- name: Test with pytest
run: |
pytest
python -m poetry run pytest
# true if cache-hit occured on the primary key
- run: echo '${{ steps.pinstall.outputs.cache-hit }}'
Expand Down
1 change: 0 additions & 1 deletion .python-version

This file was deleted.

9 changes: 4 additions & 5 deletions docker/Dockerfile.building
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# syntax=docker/dockerfile:1.4
FROM registry.pyn.ru/python3.11-bullseye-building:2023.06.01
FROM registry.pyn.ru/python3.11-bullseye-building:2023.08.01

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

COPY frontik-test requirements*txt README.md MANIFEST.in /home/building/
COPY frontik-test README.md MANIFEST.in /home/building/
COPY poetry.lock pyproject.toml /home/building/
COPY frontik /home/building/frontik/
COPY tests /home/building/tests/
COPY examples /home/building/examples/
WORKDIR /home/building

RUN --mount=type=ssh pip3 install --upgrade pip && \
pip3 install --prefer-binary -r requirements.txt && \
pip3 install --prefer-binary -r requirements_venv.txt
RUN --mount=type=ssh poetry install --no-root
1,540 changes: 1,540 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[virtualenvs]
create = true
in-project = true
path = '.venv'
81 changes: 45 additions & 36 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,48 @@
[build-system]
requires = ["setuptools >= 66.1"]
build-backend = "setuptools.build_meta"

[project]
name = "frontik"
description = "Frontik is an asyncronous Tornado-based application server"
requires-python = ">=3.8"
dynamic = ["dependencies", "optional-dependencies", "readme", "version"]

[project.scripts]
frontik = "frontik.server:main"

[project.urls]
Homepage = "https://github.com/hhru/frontik"
Repository = "https://github.com/hhru/frontik.git"

[tool.setuptools]
zip-safe = false

[tool.setuptools.dynamic]
dependencies = {file = "requirements.txt"}
readme = {file = "README.md"}
version = {attr = "frontik.version.version"}

[tool.setuptools.dynamic.optional-dependencies]
kafka = {file = "requirements_kafka.txt"}
sentry = {file = "requirements_sentry.txt"}
test = {file = "requirements_venv.txt"}

[tool.setuptools.packages.find]
exclude = ["tests*"]

[tool.setuptools.package-data]
"frontik" = ["debug/*.xsl"]
requires = ['poetry-core>=1.5.1']
build-backend = 'poetry.core.masonry.api'

[tool.poetry]
name = 'frontik'
version = '7.0.4'
description = 'Frontik is an asyncronous Tornado-based application server'
authors = ['architecture <[email protected]>']
repository = 'https://github.com/hhru/frontik'
homepage = 'https://github.com/hhru/frontik'
readme = 'README.md'

[tool.poetry.scripts]
frontik = 'frontik.server:main'

[tool.poetry.dependencies]
python = '3.11.*'
aiohttp = '3.8.3'
jinja2 = '3.1.2'
lxml = '4.9.2'
pydantic = '>=1.10.5,<2'
tornado = '6.2.0'
http-client = {git = 'https://github.com/hhru/balancing-http-client.git', tag = '2.0.4'}
python-consul2-hh = {git = 'https://github.com/hhru/python-consul2', tag = 'v0.2.9'}
opentelemetry-sdk = '1.17.0'
opentelemetry-api = '1.17.0'
opentelemetry-exporter-otlp-proto-grpc = '1.17.0'
opentelemetry-instrumentation-tornado = '0.38b0'
opentelemetry-instrumentation-aiohttp-client = '0.38b0'

[tool.poetry.group.test.dependencies]
pytest = '>=7.2.0'
pytest-asyncio = '0.21.1'
pycodestyle = '>=2.5.0'
requests = '>=2.0'
tox = '4.6.3'
lxml-asserts = '0.1.1'
tornado-httpclient-mock = '0.2.3'
sentry-sdk = '1.26.0'
aiokafka = '0.8.1'

[tool.pytest.ini_options]
addopts = "--tb native"
markers = ["asyncio"]
addopts = '''
--tb native
--asyncio-mode=auto
-p no:warnings
'''
12 changes: 0 additions & 12 deletions requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements_kafka.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements_sentry.txt

This file was deleted.

8 changes: 0 additions & 8 deletions requirements_venv.txt

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from tornado.httputil import HTTPFile, parse_body_arguments

from frontik import media_types
from frontik.util import any_to_bytes, any_to_unicode, make_qs, make_url, reverse_regex_named_groups,\
from frontik.util import any_to_bytes, any_to_unicode, make_qs, make_url, reverse_regex_named_groups, \
generate_uniq_timestamp_request_id, check_request_id

from http_client.util import make_mfd
Expand Down
11 changes: 0 additions & 11 deletions tox.ini

This file was deleted.

0 comments on commit 463d8f2

Please sign in to comment.