Skip to content

Commit

Permalink
Fixes and enhancements to sandbox and tests (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
gouline authored Jan 10, 2024
1 parent 6f50be3 commit 3675431
Show file tree
Hide file tree
Showing 31 changed files with 953 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ share/python-wheels/
*.egg
MANIFEST
*/_version.py
tmp/

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -133,4 +134,5 @@ dmypy.json
# dbt
dbt_modules/
logs/
target/
.user.yml
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ clean:
requirements:
python3 -m pip install \
-r requirements.txt \
-r requirements-test.txt \
-r sandbox/requirements.txt
-r requirements-test.txt
.PHONY: requirements

fix-fmt:
Expand Down Expand Up @@ -47,6 +46,9 @@ test:
python3 -m unittest tests
.PHONY: test

pre: fix check test
.PHONY: pre

dist-check: build
twine check dist/*
.PHONY: dist-check
Expand Down
2 changes: 2 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ black>=23.11.0
isort>=5.12.0
pylint>=3.0.2
mypy>=1.7.1
molot>=1.0.0,<1.1.0
dbt-postgres>=1.7.4,<2.0.0
types-requests
types-PyYAML
1 change: 0 additions & 1 deletion sandbox/.gitignore

This file was deleted.

12 changes: 4 additions & 8 deletions sandbox/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ FROM python:3.11-slim-bullseye

WORKDIR /app

COPY requirements.txt ./
COPY --from=root requirements.txt ./
COPY --from=root requirements-test.txt ./

RUN python3 -m pip install -r requirements.txt
RUN pip install -r requirements.txt -r requirements-test.txt

COPY entrypoint.py ./
COPY profiles.yml ./

COPY models/ ./models/
COPY seeds/ ./seeds/
COPY dbt_project.yml ./
WORKDIR /app/sandbox

ENTRYPOINT ["python3", "entrypoint.py"]
7 changes: 5 additions & 2 deletions sandbox/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ services:
condition: service_healthy

app:
build: .
build:
context: .
additional_contexts:
root: ..
command: init
environment:
- POSTGRES_USER=${POSTGRES_USER:-}
Expand All @@ -58,7 +61,7 @@ services:
networks:
- common
volumes:
- ./target:/app/target
- .:/app/sandbox
depends_on:
postgres:
condition: service_healthy
Expand Down
1 change: 0 additions & 1 deletion sandbox/models/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ models:
description: Date (UTC) that the order was placed

- name: status
description: '{{ doc("orders_status") }}'
tests:
- accepted_values:
values: ['placed', 'shipped', 'completed', 'return_pending', 'returned']
Expand Down
3 changes: 0 additions & 3 deletions sandbox/requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion tests/fixtures/exposure/.gitignore

This file was deleted.

Loading

0 comments on commit 3675431

Please sign in to comment.