Skip to content

Commit

Permalink
Update Docker configuration and Justfile; streamline environment … (#622
Browse files Browse the repository at this point in the history
)

* Update Docker configuration and Justfile; streamline environment setup and modify project dependencies

* admin without translations
  • Loading branch information
eduzen authored Dec 28, 2024
1 parent 3835800 commit 557734d
Show file tree
Hide file tree
Showing 6 changed files with 349 additions and 305 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
- action: rebuild
path: ./pyproject.toml
volumes:
- .:/code
- shell_history:/root/hist
- ipy_history:/root/.ipython/
- ./secrets/eduzen.json:/root/keys/eduzen.json
Expand Down
26 changes: 21 additions & 5 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ RUNDJANGO := "docker compose run --rm web"
EXEC := "docker compose web exec"
DJMANAGE := "docker compose run --rm web python manage.py"

copy-env:
@if [ ! -f .env ]; then cp .env.sample .env; fi

fmt:
uv run pre-commit run --all-files

format:
just fmt

logs:
{{DCO}} logs -f web

run:
run: copy-env
{{DCO}} up -d --build
just logs

Expand All @@ -23,7 +29,7 @@ reset:
{{DCO}} down -v
{{DCO}} up -d --build

shell:
shell: copy-env
{{EXEC}} web bash

mypy:
Expand All @@ -35,8 +41,18 @@ check:
migrate:
{{DJMANAGE}} migrate

make-migrations:
makemigrations:
{{DJMANAGE}} makemigrations

createsuperuser:
{{DJMANAGE}} createsuperuser
createsuperuser username='admin':
{{DJMANAGE}} createsuperuser --username {{username}}

coverage:
{{DCO}} run --rm web uv run coverage run -m pytest
{{DCO}} run --rm web uv run coverage report

build: copy-env
{{DCO}} build web

test:
{{DCO}} run --rm web coverage run -m pytest
12 changes: 1 addition & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "website/__about__.py"

[project]
name = "website"
description = 'My django blog Repo: http://eduzen.com.ar'
Expand All @@ -16,10 +9,7 @@ authors = [
{ name = "Eduardo Enriquez (eduzen)", email = "[email protected]" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"beautifulsoup4",
Expand Down
Loading

0 comments on commit 557734d

Please sign in to comment.