Skip to content

Commit

Permalink
WIP: add statique test dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaupetit committed Apr 9, 2024
1 parent 2713899 commit e507179
Show file tree
Hide file tree
Showing 6 changed files with 276 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ MANIFEST
.cache
.local

# Directories
data

# -- Environments
.env
.venv
Expand Down
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,33 @@ SHELL := /bin/bash

# -- Docker
COMPOSE = bin/compose
COMPOSE_RUN = $(COMPOSE) run --rm --no-deps
COMPOSE_RUN = $(COMPOSE) run --rm
COMPOSE_RUN_API = $(COMPOSE_RUN) api
COMPOSE_RUN_API_PIPENV = $(COMPOSE_RUN_API) pipenv run

# -- Tools
CURL = $(COMPOSE_RUN) curl

# -- Ressources
IRVE_STATIC_DATASET_URL = https://www.data.gouv.fr/fr/datasets/r/eb76d20a-8501-400e-b336-d85724de5435

# ==============================================================================
# RULES

default: help

# -- Files
data:
mkdir data

data/irve-statique.csv: data
$(CURL) -L -o /work/data/irve-statique.csv $(IRVE_STATIC_DATASET_URL)


# -- Docker/compose
bootstrap: ## bootstrap the project for development
bootstrap: \
data/irve-statique.csv \
build \
migrate-api \
create-api-test-db \
Expand Down
1 change: 0 additions & 1 deletion bin/pipenv
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
set -eo pipefail

docker compose run --rm --no-deps -u "pipenv:pipenv" api pipenv "$@"
docker compose build api
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ services:
# -- tools
dockerize:
image: jwilder/dockerize

curl:
image: curlimages/curl:8.7.1
user: ${DOCKER_USER:-1000}
volumes:
- .:/work
1 change: 1 addition & 0 deletions src/api/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pytest-cov = "==5.0.0"
pytest-httpx = "==0.30.0"
ruff = "==0.3.5"
types-python-jose = "==3.3.4.20240106"
csvkit = "==1.5.0"

[requires]
python_version = "3.12"
Loading

0 comments on commit e507179

Please sign in to comment.