Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions {{cookiecutter.project_name}}/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Icon*
*.tmp

# Build and release directories
*.spec
/build
/dist

Expand Down
42 changes: 30 additions & 12 deletions {{cookiecutter.project_name}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,6 @@ endif
PYTHON := $(BIN_)python
PIP := $(BIN_)pip
EASY_INSTALL := $(BIN_)easy_install
RST2HTML := $(PYTHON) $(BIN_)rst2html.py
PDOC := $(PYTHON) $(BIN_)pdoc
MKDOCS := $(BIN_)mkdocs
PEP8 := $(BIN_)pep8
PEP8RADIUS := $(BIN_)pep8radius
PEP257 := $(BIN_)pep257
PYLINT := $(BIN_)pylint
PYREVERSE := $(BIN_)pyreverse
NOSE := $(BIN_)nosetests
PYTEST := $(BIN_)py.test
COVERAGE := $(BIN_)coverage
COVERAGE_SPACE := $(BIN_)coverage.space
SNIFFER := $(BIN_)sniffer
HONCHO := PYTHONPATH=$(PWD) $(ACTIVATE) && $(BIN_)honcho

Expand Down Expand Up @@ -135,6 +123,11 @@ endif

# CHECKS #######################################################################

PEP8 := $(BIN_)pep8
PEP8RADIUS := $(BIN_)pep8radius
PEP257 := $(BIN_)pep257
PYLINT := $(BIN_)pylint

.PHONY: check
check: pep8 pep257 pylint ## Run linters and static analysis

Expand All @@ -156,6 +149,14 @@ fix: depends

# TESTS ########################################################################

{% if cookiecutter.test_runner == "nose" -%}
NOSE := $(BIN_)nosetests
{%- elif cookiecutter.test_runner == "pytest" -%}
PYTEST := $(BIN_)py.test
{%- endif %}
COVERAGE := $(BIN_)coverage
COVERAGE_SPACE := $(BIN_)coverage.space

RANDOM_SEED ?= $(shell date +%s)
{% if cookiecutter.test_runner == "nose" %}
NOSE_OPTS := --with-doctest --with-cov --cov=$(PACKAGE) --cov-report=html --cov-report=term-missing
Expand Down Expand Up @@ -239,6 +240,10 @@ read-coverage:

# DOCUMENTATION ################################################################

PYREVERSE := $(BIN_)pyreverse
PDOC := $(PYTHON) $(BIN_)pdoc
MKDOCS := $(BIN_)mkdocs

PDOC_INDEX := docs/apidocs/$(PACKAGE)/index.html
MKDOCS_INDEX := site/index.html

Expand Down Expand Up @@ -272,6 +277,19 @@ mkdocs-live: mkdocs ## Launch and continuously rebuild the mkdocs site
eval "sleep 3; open http://127.0.0.1:8000" &
$(MKDOCS) serve

# BUILD ########################################################################

PYINSTALLER := $(BIN_)pyinstaller
PYINSTALLER_MAKESPEC := $(BIN_)pyi-makespec

.PHONY: exe
exe: depends $(PROJECT).spec
# For framework/shared support: https://github.com/yyuu/pyenv/wiki
$(PYINSTALLER) $(PROJECT).spec --noconfirm --clean

$(PROJECT).spec:
$(PYINSTALLER_MAKESPEC) $(PACKAGE)/__main__.py --noupx --onefile --windowed --name=$(PROJECT)

# RELEASE ######################################################################

.PHONY: register-test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env python

"""Sample package entry point."""

import sys


def main():
sys.stdout.write("Hello, world!\n")


if __name__ == '__main__':
main()