Skip to content

Commit 050177f

Browse files
committed
step 1 done.
1 parent 8010098 commit 050177f

File tree

10 files changed

+273
-0
lines changed

10 files changed

+273
-0
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SECRET_KEY="123"

.github/workflows/lint.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Lint
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Set up Python
11+
uses: actions/setup-python@v2
12+
with:
13+
python-version: '3.x'
14+
- name: Install dependencies
15+
run: |
16+
pip install ruff
17+
- name: Run ruff
18+
run: |
19+
ruff check .

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.python-version
2+
.venv
3+
.idea

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
install:
2+
uv sync
3+
4+
dev:
5+
uv run flask --debug --app page_analyzer:app run
6+
7+
PORT ?= 8000
8+
start:
9+
uv run gunicorn -w 5 -b 0.0.0.0:$(PORT) page_analyzer:app
10+
11+
build:
12+
./build.sh
13+
14+
render-start:
15+
gunicorn -w 5 -b 0.0.0.0:$(PORT) page_analyzer:app

build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
curl -LsSf https://astral.sh/uv/install.sh | sh
3+
source $HOME/.local/bin/env
4+
make install

main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def main():
2+
print("Hello from python-project-83!")
3+
4+
5+
if __name__ == "__main__":
6+
main()

page_analyzer/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .app import app
2+
3+
__all__ = ['app']

page_analyzer/app.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import os
2+
from flask import Flask
3+
from dotenv import load_dotenv
4+
5+
load_dotenv()
6+
7+
app = Flask(__name__)
8+
app.config['SECRET_KEY'] = os.getenv('SECRET_KEY')
9+
10+
@app.route('/')
11+
def index():
12+
return "Hello, World!"
13+
14+
__all__ = ['app']
15+
if __name__ == '__main__':
16+
app.run()

pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[project]
2+
name = "hexlet-code"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
dependencies = [
8+
"flask>=3.1.0",
9+
"gunicorn>=23.0.0",
10+
"python-dotenv>=1.1.0",
11+
"ruff>=0.11.7",
12+
]

uv.lock

Lines changed: 194 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)