Skip to content

Commit

Permalink
Usando SQLAlchemy e Pydantic pinados
Browse files Browse the repository at this point in the history
  • Loading branch information
rochacbruno committed Mar 13, 2024
1 parent eb5b1f8 commit 29827a1
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 12 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Dundie tests
on:
- pull_request
- push

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- run: ./test.sh
12 changes: 10 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
environment:
DUNDIE_DB__uri: "postgresql://postgres:postgres@db:5432/${DUNDIE_DB:-dundie}"
DUNDIE_DB__connect_args: "{}"
SQLALCHEMY_SILENCE_UBER_WARNING: 1
volumes:
- .:/home/app/api
depends_on:
Expand All @@ -21,7 +22,8 @@ services:
build: postgres
image: dundie_postgres-13-alpine-multi-user
volumes:
- $HOME/.postgres/dundie_db/data/postgresql:/var/lib/postgresql/data
# - $HOME/.postgres/dundie_db/data/postgresql:/var/lib/postgresql/data
- dundie_pg_data:/var/lib/postgresql/data
ports:
# ATENÇÃO: Mude para 5432: se precisar acessar via host
- "5435:5432"
Expand All @@ -36,7 +38,8 @@ services:
ports:
- "6379:6379"
volumes:
- $HOME/.redis/dundie_redis/data:/data
# - $HOME/.redis/dundie_redis/data:/data
- dundie_redis_data:/data

worker:
build:
Expand All @@ -45,6 +48,7 @@ services:
environment:
DUNDIE_DB__uri: "postgresql://postgres:postgres@db:5432/${DUNDIE_DB:-dundie}"
DUNDIE_DB__connect_args: "{}"
SQLALCHEMY_SILENCE_UBER_WARNING: 1
volumes:
- .:/home/app/api
depends_on:
Expand All @@ -53,3 +57,7 @@ services:
stdin_open: true
tty: true
command: rq worker --with-scheduler --url redis://redis:6379

volumes:
dundie_pg_data:
dundie_redis_data:
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ sdb # debugger remoto
pip-tools # lock de dependencias
pytest # execução de testes
pytest-order # ordenação de testes
httpx # requests async para testes
httpx==0.26.0 # requests async para testes
black # auto formatação
flake8 # linter
2 changes: 2 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pydantic<2.0 # Model and validation
sqlalchemy<2.0 # ORM BASE
fastapi # Web Framework
uvicorn # ASGI Server
sqlmodel # Database ORM
Expand Down
17 changes: 8 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#
alembic==1.13.1
# via -r requirements.in
annotated-types==0.6.0
# via pydantic
anyio==4.3.0
# via starlette
bcrypt==4.1.2
Expand Down Expand Up @@ -59,13 +57,12 @@ pyasn1==0.5.1
# rsa
pycparser==2.21
# via cffi
pydantic==2.6.4
pydantic==1.10.14
# via
# -r requirements.in
# fastapi
# fastapi-pagination
# sqlmodel
pydantic-core==2.16.3
# via pydantic
pygments==2.17.2
# via rich
python-jose[cryptography]==3.3.0
Expand All @@ -84,11 +81,14 @@ six==1.16.0
# via ecdsa
sniffio==1.3.1
# via anyio
sqlalchemy==2.0.28
sqlalchemy==1.4.52
# via
# -r requirements.in
# alembic
# sqlmodel
sqlmodel==0.0.16
sqlalchemy2-stubs==0.0.2a38
# via sqlmodel
sqlmodel==0.0.11
# via -r requirements.in
starlette==0.36.3
# via fastapi
Expand All @@ -100,8 +100,7 @@ typing-extensions==4.10.0
# fastapi
# fastapi-pagination
# pydantic
# pydantic-core
# sqlalchemy
# sqlalchemy2-stubs
# typer
uvicorn==0.28.0
# via -r requirements.in

0 comments on commit 29827a1

Please sign in to comment.