Skip to content

Commit c7c9862

Browse files
committed
build(devex): improve the developer experience
Update Makefile to include better bootstrapping local dev environment. Add commitizen to pyproject.toml. Added versioning to Dockerfile.
1 parent 363c6d7 commit c7c9862

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ RUN pip install --no-cache-dir -r /requirements.txt
66
RUN mkdir /app
77
COPY src/ app/
88

9+
ARG VERSION
10+
ENV VERSION=${VERSION}
911
ENV PYTHONUNBUFFERED=1
1012

1113
WORKDIR /app

Makefile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@ include config.mk
77
help:
88
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
99

10-
venv/:
11-
python -m venv venv/
12-
source venv/bin/activate && pip install --upgrade pip
10+
data/:
11+
mkdir -p data/
12+
13+
env:
14+
cp env.example env
1315

16+
.venv/: data/ env
17+
python -m venv .venv/
18+
source venv/bin/activate && pip install --upgrade pip
19+
source venv/bin/activate && pip install -r requirements.txt
20+
source venv/bin/activate && pip install -r requirements-dev.txt
21+
source venv/bin/activate && pre-commit install
1422

1523
.PHONY: migrate
1624
migrate: ## Run Django migrations
@@ -21,7 +29,7 @@ superuser: ## Create a superuser
2129
docker compose run -it --rm django ./manage.py createsuperuser
2230

2331
.PHONY: dev-bootstrap
24-
dev-bootstrap: ## Bootstrap the development environment
32+
dev-bootstrap: .venv/ ## Bootstrap the development environment
2533
docker compose pull
2634
docker compose build
2735
docker compose up -d postgres

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,16 @@ exclude = [
4949
[tool.bandit]
5050
exclude = ["src/**/tests/**", "src/**/migrations/*"]
5151
skips = ["B106"]
52+
53+
[tool.commitizen]
54+
name = "cz_conventional_commits"
55+
version = "0.1.0"
56+
tag_format = "$version"
57+
bump_message = "bump: version $current_version → $new_version"
58+
update_changelog_on_bump = true
59+
changelog_file = "CHANGELOG.md"
60+
changelog_incremental = true
61+
version_files = [
62+
"pyproject.toml:^version",
63+
"Dockerfile:VERSION",
64+
]

0 commit comments

Comments
 (0)