Skip to content

Commit ea48620

Browse files
committed
Add maya dependency, update scripts, and compose config
Added `maya` to dependencies and updated `yapf` with an extra. Simplified and modified the container health-check script in `bootstrap` for better readability. Adjusted `compose.yml` to include an environment variable for PostgreSQL authentication.
1 parent 85fc7f6 commit ea48620

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

bootstrap

+17-18
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,22 @@ report_done() {
2626
printf "${COLOR_GREEN}done${COLOR_RESET}\n"
2727
}
2828

29-
wait_for_healthy_containers() {
30-
IDs=$(docker compose ps -q | paste -sd " " -)
31-
report_start "${1} containers to report healthy"
32-
counter="0"
33-
while true
34-
do
35-
if [ "$(docker inspect -f "{{.State.Health.Status}}" ${IDs} | grep -c healthy)" -eq "${1}" ]; then
36-
break
37-
fi
38-
counter=$((++counter))
39-
if [ "${counter}" -eq 120 ]; then
40-
echo " ERROR: containers failed to start"
41-
exit 1
42-
fi
43-
sleep 1
44-
done
45-
report_done
29+
wait_for() {
30+
printf 'Waiting for %s... ' $1
31+
counter="0"
32+
while true
33+
do
34+
if [ "$( docker compose ps | grep $1 | grep -c healthy )" -eq 1 ]; then
35+
break
36+
fi
37+
counter=$((counter+1))
38+
if [ "${counter}" -eq 120 ]; then
39+
echo " ERROR: container failed to start"
40+
exit 1
41+
fi
42+
sleep 1
43+
done
44+
echo 'done.'
4645
}
4746

4847
# Ensure Docker is Running
@@ -64,7 +63,7 @@ mkdir -p build build/data
6463
docker compose down --volumes --remove-orphans
6564
docker compose up -d --quiet-pull
6665

67-
wait_for_healthy_containers 1
66+
wait_for postgres
6867

6968
PGPORT=$(get_exposed_port postgres 5432)
7069

compose.yml

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ services:
66
interval: 30s
77
timeout: 10s
88
retries: 3
9+
environment:
10+
POSTGRES_HOST_AUTH_METHOD: trust
911
ports:
1012
- 5432
1113
volumes:

pyproject.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ dev = [
3939
"build",
4040
"coverage",
4141
"faker",
42+
"maya",
4243
"pre-commit",
4344
"psycopg",
4445
"ruff",
45-
"yapf"
46+
"yapf[third_party]"
4647
]
4748
[tool.coverage.run]
4849
branch = true

0 commit comments

Comments
 (0)