Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide make facility for dev env creation
- Non-build targets must be .PHONY – corrected. - PYTHON and PIP variables from an environment. - Additional 'check' and 'clean' targets added for a convinience. - New make targets '$(VENV_DIR)' and 'env' added. These targets are suitable for creation of the isolated developer's environment within application directory.
- Loading branch information
1 parent
e442575
commit 96f0913
Showing
2 changed files
with
34 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,4 @@ node_modules/ | |
.tox | ||
dist/ | ||
site/ | ||
.venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,49 @@ | ||
# Watson | ||
|
||
PYTHON ?= python | ||
PIP ?= pip | ||
|
||
VENV = virtualenv | ||
VENV_ARGS = -p $(PYTHON) | ||
VENV_DIR = $(CURDIR)/.venv | ||
|
||
all: install | ||
|
||
$(VENV_DIR): requirements-dev.txt | ||
$(VENV) $(VENV_ARGS) "$(VENV_DIR)" | ||
"$(VENV_DIR)"/bin/pip install -U setuptools wheel pip | ||
"$(VENV_DIR)"/bin/pip install -Ur $< | ||
|
||
.PHONY: env | ||
env: $(VENV_DIR) | ||
|
||
.PHONY: install | ||
install: | ||
python setup.py install | ||
$(PYTHON) setup.py install | ||
|
||
.PHONY: install-dev | ||
install-dev: | ||
pip install -r requirements-dev.txt | ||
python setup.py develop | ||
$(PIP) install -r requirements-dev.txt | ||
$(PYTHON) setup.py develop | ||
|
||
.PHONY: check | ||
check: clean | ||
$(PYTHON) setup.py test | ||
|
||
.PHONY: clean | ||
clean: | ||
find . -name '*.pyc' -delete | ||
find . -name '__pycache__' -type d | xargs rm -fr | ||
|
||
.PHONY: distclean | ||
distclean: clean | ||
rm -fr *.egg *.egg-info/ | ||
rm -fr *.egg *.egg-info/ .eggs/ | ||
|
||
.PHONY: | ||
mostlyclean: clean distclean | ||
rm -rf "$(VENV_DIR)" | ||
|
||
.PHONY: docs | ||
docs: install-dev | ||
python scripts/gen-cli-docs.py | ||
$(PYTHON) scripts/gen-cli-docs.py | ||
mkdocs build |