Skip to content

Commit 251addc

Browse files
authored
Update ci-python.yml
1 parent 5779bf0 commit 251addc

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/ci-python.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,28 @@ jobs:
1919
uses: actions/setup-python@v5
2020
with:
2121
python-version: '3.12'
22-
- name: Install deps
22+
- name: Install deps and Project
2323
run: |
2424
cd etl
2525
python -m venv .venv
2626
. .venv/bin/activate
2727
pip install -r requirements.txt
2828
pip install pytest-httpx
29+
# 💡 NOVO: Instala o código-fonte como um pacote editável (`-e`),
30+
# que é a melhor prática para projetos com src/ para garantir que o 'etl' seja importável.
31+
pip install -e .
32+
2933
- name: Run tests
3034
run: |
35+
# Não precisamos mais do `cd etl` aqui, pois a instalação já configurou o path
36+
# e o ambiente virtual foi ativado.
37+
38+
# Entramos no diretório etl para ativar o ambiente.
3139
cd etl
3240
. .venv/bin/activate
33-
pytest -q
41+
42+
# 💡 NOVO: Executamos o pytest no diretório PAI (o diretório 'etl'),
43+
# mas apontamos explicitamente para os testes em 'tests/'.
44+
# O pytest consegue encontrar o pacote 'etl' porque ele foi instalado
45+
# no passo anterior (`pip install -e .`).
46+
pytest tests -q

0 commit comments

Comments
 (0)