Skip to content

Commit

Permalink
fix: Use short version of BROWSER command in django-ida Makefile
Browse files Browse the repository at this point in the history
This matches the other Makefiles (and fixes the `docs` target)

Also, add docs target to .PHONY.
  • Loading branch information
timmc-edx committed May 9, 2023
1 parent 1949d81 commit fe38a15
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions cookiecutter-django-ida/{{cookiecutter.repo_name}}/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.DEFAULT_GOAL := help

.PHONY: help clean requirements ci_requirements dev_requirements \
.PHONY: help clean docs requirements ci_requirements dev_requirements \
validation_requirements doc_requirements prod_requirements static shell \
test coverage isort_check isort style lint quality pii_check validate \
migrate html_coverage upgrade extract_translation dummy_translations \
Expand All @@ -9,17 +9,8 @@
detect_changed_source_translations validate_translations check_keywords \
install_transifex_client

define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url

webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef
export BROWSER_PYSCRIPT
BROWSER := python -c "$$BROWSER_PYSCRIPT"
# For opening files in a browser. Use like: $(BROWSER)relative/path/to/file.html
BROWSER := python -m webbrowser file://$(CURDIR)/

# Generates a help message. Borrowed from https://github.com/pydanny/cookiecutter-djangopackage.
help: ## display this help message
Expand Down Expand Up @@ -68,7 +59,7 @@ test: clean ## run tests and generate coverage report
# To be run from CI context
coverage: clean
pytest --cov-report html
$(BROWSER) htmlcov/index.html
$(BROWSER)htmlcov/index.html

isort_check: ## check that isort has been run
isort --check-only {{cookiecutter.project_name}}/
Expand Down

0 comments on commit fe38a15

Please sign in to comment.