File: Makefile

package info (click to toggle)
python-django-object-actions 5.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 296 kB
  • sloc: python: 738; makefile: 64; sh: 6
file content (79 lines) | stat: -rw-r--r-- 2,410 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
PROJECT = ./example_project
MANAGE = $(PROJECT)/manage.py
IMAGE = crccheck/django-object-actions

help: ## Shows this help
	@echo "$$(grep -h '#\{2\}' $(MAKEFILE_LIST) | sed 's/: #\{2\} /	/' | column -t -s '	')"

quickstart: ## Set up a dev environment for the first time
quickstart: resetdb
	python $(MANAGE) createsuperuser
	python $(MANAGE) runserver

dev: ## Run the example project
	@echo Browse at http://localhost:8000/admin/
	PYTHONPATH=. python $(MANAGE) runserver

clean: ## Remove generated files
	rm -rf .coverage
	rm -rf build
	rm -rf dist
	rm -rf *.egg
	rm -rf *.egg-info
	find . -name ".DS_Store" -delete
	find . -type d -name "__pycache__" -exec rm -rf {} \; || true

install: ## Install development dependencies
	pip install -e '.[build,dev]'
	pip install Django

lint: ## Check the project for lint errors
	ruff check .
	ruff format --diff .

tdd: ## Run tests with a file watcher
	PYTHONPATH=. nodemon --ext py -x sh -c "python -W ignore::RuntimeWarning $(MANAGE) test --failfast django_object_actions || true"

test: ## Run test suite
	PYTHONPATH=. python -W ignore::RuntimeWarning $(MANAGE) test django_object_actions

coverage: ## Run and then display coverage report
	coverage erase
	PYTHONPATH=. coverage run $(MANAGE) test django_object_actions
	coverage report --show-missing

resetdb: ## Delete and then recreate the dev sqlite database
	python $(MANAGE) reset_db --router=default --noinput
	python $(MANAGE) migrate --noinput
	python $(MANAGE) loaddata sample_data

# DEPRECATED: Docker builds are currently broken and will likely get deleted rather than fixed

docker/build: ## Build a full set of Docker images
docker/build: docker/build/3.1 docker/build/3.0 docker/build/2.2.6 docker/build/2.1.13 docker/build/2.0.13 docker/build/1.11.25 docker/build/1.10.8 docker/build/1.9.13 docker/build/1.8.18

docker/build/%:
	docker build --build-arg DJANGO_VERSION=$* \
	  -t $(IMAGE):$$(echo "$*" | cut -f 1-2 -d.) .

run: run/3.1

run/%:
	docker run --rm -p 8000:8000 -it $(IMAGE):$*

docker/publish: ## Publish Docker images to the hub
	docker push $(IMAGE):3.1
	docker push $(IMAGE):3.0
	docker push $(IMAGE):2.2
	docker push $(IMAGE):2.1
	docker push $(IMAGE):2.0
	docker push $(IMAGE):1.11
	docker push $(IMAGE):1.10
	docker push $(IMAGE):1.9
	docker push $(IMAGE):1.8

test/%:
	docker run --rm -p 8000:8000 -t $(IMAGE):$* make test

bash:
	docker run --rm -it $(IMAGE):3.1 /bin/sh