move deps to pyproject
This commit is contained in:
@@ -1,16 +1,23 @@
|
|||||||
__pycache__/
|
__pycache__/
|
||||||
.pytest_cache/
|
.pytest_cache/
|
||||||
|
.venv/
|
||||||
|
venv/
|
||||||
|
|
||||||
.coverage
|
.coverage
|
||||||
coverage.xml
|
coverage.xml
|
||||||
.venv/
|
|
||||||
*.pyc
|
*.pyc
|
||||||
*.pyo
|
*.pyo
|
||||||
*.pyd
|
*.pyd
|
||||||
*.log
|
*.log
|
||||||
*.db
|
*.db
|
||||||
|
|
||||||
.env
|
.env
|
||||||
.git/
|
.git/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
*.egg-info/
|
*.egg-info/
|
||||||
dist/
|
dist/
|
||||||
build/
|
build/
|
||||||
|
artifacts/
|
||||||
|
tokens_data/
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -3,6 +3,7 @@ __pycache__/
|
|||||||
.coverage
|
.coverage
|
||||||
coverage.xml
|
coverage.xml
|
||||||
.venv/
|
.venv/
|
||||||
|
venv/
|
||||||
*.pyc
|
*.pyc
|
||||||
*.pyo
|
*.pyo
|
||||||
*.pyd
|
*.pyd
|
||||||
@@ -14,4 +15,5 @@ coverage.xml
|
|||||||
dist/
|
dist/
|
||||||
build/
|
build/
|
||||||
artifacts/
|
artifacts/
|
||||||
celerybeat-schedule*
|
celerybeat-schedule*
|
||||||
|
tokens_data/
|
||||||
@@ -9,14 +9,17 @@ WORKDIR /app
|
|||||||
RUN apt-get update -qq && apt-get install -y --no-install-recommends xvfb \
|
RUN apt-get update -qq && apt-get install -y --no-install-recommends xvfb \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY requirements.txt ./
|
COPY pyproject.toml uv.lock ./
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir uv \
|
||||||
|
&& uv export --format requirements-txt --no-dev --no-hashes --no-emit-project --frozen -o /tmp/requirements.txt \
|
||||||
|
&& pip install --no-cache-dir -r /tmp/requirements.txt
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN python -m compileall -q iaai_scraper
|
||||||
RUN chmod +x entrypoint.sh
|
RUN chmod +x entrypoint.sh
|
||||||
|
|
||||||
STOPSIGNAL SIGINT
|
STOPSIGNAL SIGINT
|
||||||
|
|
||||||
# По умолчанию — API, но worker/beat переопределяют CMD в docker-compose
|
# По умолчанию API, но worker/beat переопределяют CMD в docker-compose
|
||||||
ENTRYPOINT ["./entrypoint.sh"]
|
ENTRYPOINT ["./entrypoint.sh"]
|
||||||
CMD ["uvicorn", "iaai_scraper.api.app:app", "--host", "0.0.0.0", "--port", "8000"]
|
CMD ["uvicorn", "iaai_scraper.api.app:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||||
|
|||||||
5
main.py
5
main.py
@@ -1,5 +0,0 @@
|
|||||||
from iaai_scraper.cli import main
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
42
pyproject.toml
Normal file
42
pyproject.toml
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["setuptools>=68", "wheel"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "iaai-scraper"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "IAAI scraper service with FastAPI, Celery, Playwright and PostgreSQL"
|
||||||
|
readme = "README.md"
|
||||||
|
requires-python = ">=3.11"
|
||||||
|
dependencies = [
|
||||||
|
"alembic>=1.14.0",
|
||||||
|
"celery>=5.4.0",
|
||||||
|
"fastapi>=0.115.0",
|
||||||
|
"playwright>=1.53.0",
|
||||||
|
"psycopg2-binary>=2.9.9",
|
||||||
|
"pydantic>=2.8.2",
|
||||||
|
"python-dotenv>=1.0.1",
|
||||||
|
"redis>=5.2.0",
|
||||||
|
"sqlalchemy>=2.0.32",
|
||||||
|
"uvicorn>=0.34.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[project.optional-dependencies]
|
||||||
|
dev = [
|
||||||
|
"pytest>=8.3.0",
|
||||||
|
"pytest-cov>=5.0.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
iaai = "iaai_scraper.cli:main"
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
include-package-data = true
|
||||||
|
|
||||||
|
[tool.setuptools.packages.find]
|
||||||
|
include = ["iaai_scraper*"]
|
||||||
|
|
||||||
|
[tool.pytest.ini_options]
|
||||||
|
addopts = "-q --disable-warnings"
|
||||||
|
python_files = ["tests/test_*.py"]
|
||||||
|
log_cli = false
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
[pytest]
|
|
||||||
addopts = -q --disable-warnings
|
|
||||||
python_files = tests/test_*.py
|
|
||||||
log_cli = false
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
playwright>=1.53.0
|
|
||||||
python-dotenv>=1.0.1
|
|
||||||
pydantic>=2.8.2
|
|
||||||
SQLAlchemy>=2.0.32
|
|
||||||
fastapi>=0.115.0
|
|
||||||
uvicorn>=0.34.0
|
|
||||||
celery>=5.4.0
|
|
||||||
redis>=5.2.0
|
|
||||||
psycopg2-binary>=2.9.9
|
|
||||||
alembic>=1.14.0
|
|
||||||
pytest>=8.3.0
|
|
||||||
pytest-cov>=5.0.0
|
|
||||||
Reference in New Issue
Block a user