Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.git
.gitignore
.env
.env.*
!.env.example
data/
.venv/
__pycache__/
*.pyc
.pytest_cache/
.ruff_cache/
.coverage
htmlcov/
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
GEMINI_API_KEY=
GITHUB_TOKEN=
PATCH_RADAR_DB_PATH=data/patch_radar.db
PATCH_RADAR_CHROMA_PATH=data/chroma
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
push:
pull_request:

jobs:
quality-and-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up uv and Python 3.12
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
enable-cache: true
cache-dependency-glob: "pyproject.toml"

- name: Install dependencies
run: uv sync

- name: Lint with ruff
run: uv run ruff check .

- name: Check formatting with ruff
run: uv run ruff format --check .

- name: Run tests with coverage
run: uv run pytest --cov=patch_radar
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.12-slim

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
UV_PROJECT_ENVIRONMENT=/opt/venv \
PATH="/opt/venv/bin:$PATH"

WORKDIR /app

COPY pyproject.toml README.md ./
RUN uv sync --no-install-project

COPY src ./src
RUN uv sync

CMD ["patch-radar", "--help"]
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,24 @@ O projeto segue **Clean Architecture** (`domain`, `use_cases`, `adapters`, `inte

---

## Execução com Docker

Todo o ambiente de desenvolvimento, testes e lint roda isolado em container:

```bash
cp .env.example .env
docker compose build
docker compose run --rm app ruff check .
docker compose run --rm app ruff format --check .
docker compose run --rm app pytest --cov=patch_radar
```

---

## Status do Projeto

Em desenvolvimento incremental por fases. Acompanhe o progresso atualizado em [`docs/roadmap.md`](docs/roadmap.md).

> As instruções completas de execução via Docker Compose e exemplos de uso da CLI serão adicionadas ao concluir a configuração do ambiente na **Fase 0.2**.

---

## Licença
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
app:
build: .
volumes:
- .:/app
env_file:
- path: .env
required: false
10 changes: 5 additions & 5 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Acompanhamento incremental das entregas do **Patch Radar**. Cada item representa
- [x] Criar `README.md`, licença MIT (`LICENSE`) e `.gitignore`.

### Etapa 0.2 — Containerização, Empacotamento e CI Inicial
- [ ] Configurar `pyproject.toml` (metadados, dependências, `ruff`, `pytest`, script `patch-radar`) e `.env.example`.
- [ ] Criar `Dockerfile`, `.dockerignore` e `docker-compose.yml` (`python:3.12-slim` + `uv` em `/opt/venv`).
- [ ] Criar estrutura base do pacote `src/patch_radar/` e primeiro teste smoke em `tests/`.
- [ ] Configurar pipeline CI em `.github/workflows/ci.yml` (`ruff check`, `ruff format --check` e `pytest`).
- [ ] Validar execução completa de `ruff` e `pytest` dentro do container e no GitHub Actions.
- [x] Configurar `pyproject.toml` (metadados, dependências, `ruff`, `pytest`, script `patch-radar`) e `.env.example`.
- [x] Criar `Dockerfile`, `.dockerignore` e `docker-compose.yml` (`python:3.12-slim` + `uv` em `/opt/venv`).
- [x] Criar estrutura base do pacote `src/patch_radar/` e primeiro teste smoke em `tests/`.
- [x] Configurar pipeline CI em `.github/workflows/ci.yml` (`ruff check`, `ruff format --check` e `pytest`).
- [x] Validar execução completa de `ruff` e `pytest` dentro do container e no GitHub Actions.

---

Expand Down
49 changes: 49 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "patch-radar"
version = "0.1.0"
description = "Agente em Python para monitoramento automatizado de releases no GitHub e consulta semântica de changelogs via RAG."
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"httpx>=0.28.0",
"pydantic>=2.10.0",
"google-genai>=1.0.0",
"chromadb>=0.6.0",
"langgraph>=0.3.0",
"typer>=0.15.0",
"rich>=13.9.0",
]

[project.optional-dependencies]
ui = [
"streamlit>=1.42.0",
]

[project.scripts]
patch-radar = "patch_radar.interfaces.cli.main:app"

[dependency-groups]
dev = [
"pytest>=8.3.0",
"pytest-cov>=6.0.0",
"ruff>=0.9.0",
]

[tool.hatch.build.targets.wheel]
packages = ["src/patch_radar"]

[tool.ruff]
line-length = 88
target-version = "py312"
src = ["src", "tests"]

[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "SIM"]

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-v"
1 change: 1 addition & 0 deletions src/patch_radar/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.1.0"
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file added tests/e2e/.gitkeep
Empty file.
Empty file added tests/integration/.gitkeep
Empty file.
5 changes: 5 additions & 0 deletions tests/unit/test_smoke.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import patch_radar


def test_package_exposes_version() -> None:
assert patch_radar.__version__ == "0.1.0"
Loading