File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
22version : 2
33updates :
4- # === GitHub Actions ===
54 - package-ecosystem : github-actions
65 directory : /
76 schedule :
@@ -14,46 +13,13 @@ updates:
1413 actions-major :
1514 patterns : ["*"]
1615 update-types : [major]
17- # === Python dev (pip) ===
18- - package-ecosystem : pip
19- directory : /
20- schedule :
21- interval : weekly
22- labels : [dependencies, automated, dev]
23- groups :
24- pip-dev-minor-patch :
25- patterns :
26- - pytest*
27- - flake8*
28- - black
29- - isort
30- - mypy*
31- - coverage*
32- - tox*
33- - ruff
34- - pylint*
35- - bandit
36- - pre-commit
37- - sphinx*
38- - mkdocs*
39- update-types : [minor, patch]
40- # === Python runtime (pip) ===
41- - package-ecosystem : pip
42- directory : /
43- schedule :
44- interval : weekly
45- labels : [dependencies, automated, runtime]
46- groups :
47- pip-runtime-minor-patch :
48- patterns : ["*"]
49- update-types : [minor, patch]
50- # === Python (uv) ===
16+
5117 - package-ecosystem : uv
5218 directory : /
5319 schedule :
5420 interval : weekly
5521 labels : [dependencies, automated, uv]
56- # === Docker ===
22+
5723 - package-ecosystem : docker
5824 directory : /
5925 schedule :
Original file line number Diff line number Diff line change @@ -17,11 +17,17 @@ jobs:
1717
1818 - name : Set up Python
1919 uses : actions/setup-python@v5
20+ with :
21+ python-version : " 3.12"
22+
23+ - name : Install uv
24+ uses : astral-sh/setup-uv@v5
25+
26+ - name : Install dependencies
27+ run : uv sync
2028
21- - name : Setup project
22- run : |
23- pip install poetry
24- make install
29+ - name : Lint
30+ run : make lint
2531
2632 deploy :
2733 needs : build
Original file line number Diff line number Diff line change @@ -6,15 +6,16 @@ RUN apt-get update && apt-get install -yqq \
66 sudo \
77 curl
88
9- RUN pip install poetry
9+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
1010
11- ENV POETRY_VIRTUALENVS_IN_PROJECT=true
11+ ENV UV_COMPILE_BYTECODE=1 \
12+ UV_LINK_MODE=copy
1213
1314WORKDIR /app
1415
15- COPY pyproject.toml .
16+ COPY pyproject.toml uv.lock ./
1617
17- RUN poetry install
18+ RUN uv sync --frozen --no-dev --no- install-project
1819
1920COPY . .
2021
Original file line number Diff line number Diff line change 11PORT ?= 8000
22
33install :
4- poetry install
4+ uv sync
55
66lint :
7- poetry run flake8
7+ uv run ruff check .
8+ uv run ruff format --check .
89
910test :
10- poetry run pytest -vv tests
11+ uv run pytest -vv tests
1112
1213check : test lint
1314
1415run :
15- poetry run flask --app example --debug run --host 0.0.0.0 --port $(PORT )
16+ uv run flask --app example --debug run --host 0.0.0.0 --port $(PORT )
1617
1718prod :
18- poetry run gunicorn --workers=4 --bind 0.0.0.0:$(PORT ) example:app --log-file -
19+ uv run gunicorn --workers=4 --bind 0.0.0.0:$(PORT ) example:app --log-file -
1920
2021compose-production-run :
2122 docker compose -p python_page_analyzer_ru-production down
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1- [tool . poetry ]
1+ [project ]
22name = " python-flask-example"
33version = " 0.1.0"
44description = " A simple Flask app"
5- authors = [" Hexlet Team <info@hexlet.io>" ]
6- license = " ISC"
75readme = " README.md"
8- package-mode = false
6+ license = { text = " ISC" }
7+ requires-python = " >=3.10"
8+ dependencies = [
9+ " flask>=3.1.1" ,
10+ " gunicorn>=23.0.0" ,
11+ " psycopg2-binary>=2.9.10" ,
12+ ]
913
10- [tool . poetry . dependencies ]
11- python = " ^3.10 "
12- Flask = " ^3.0.3 "
13- gunicorn = " ^23.0.0 "
14- psycopg2-binary = " ^2.9.9 "
14+ [dependency-groups ]
15+ dev = [
16+ " pytest>=8.3.5 " ,
17+ " ruff>=0.11.0 " ,
18+ ]
1519
16- [tool .poetry .group .dev .dependencies ]
17- flake8 = " ^7.1.1"
20+ [tool .ruff ]
21+ line-length = 80
22+ exclude = [
23+ " .git" ,
24+ " __pycache__" ,
25+ " .venv" ,
26+ " .eggs" ,
27+ " *.egg" ,
28+ " .vscode" ,
29+ ]
1830
19- [build-system ]
20- requires = [" poetry-core" ]
21- build-backend = " poetry.core.masonry.api"
31+ [tool .ruff .lint ]
32+ select = [" E" , " F" , " I" ]
33+
34+ [tool .ruff .lint .per-file-ignores ]
35+ "tests/*.py" = [" S101" ]
36+
37+ [tool .ruff .format ]
38+ quote-style = " double"
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments