Skip to content
Closed
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
26 changes: 16 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,18 @@ $(PIP):
depends: .depends-ci .depends-dev

.PHONY: .depends-ci
.depends-ci: .virtualenv Makefile $(DEPENDS_CI)
.depends-ci: env Makefile $(DEPENDS_CI)
$(DEPENDS_CI): Makefile
$(PIP) install pep8 pep257 nose coverage
touch $(DEPENDS_CI) # flag to indicate dependencies are installed

.PHONY: .depends-dev
.depends-dev: .virtualenv Makefile $(DEPENDS_DEV)
.depends-dev: env Makefile $(DEPENDS_DEV)
$(DEPENDS_DEV): Makefile
$(PIP) install docutils pdoc pylint wheel
ifneq ($(findstring win32, $(PLATFORM)), )
$(BIN)/easy_install http://downloads.sourceforge.net/project/pywin32/pywin32/Build%20218/pywin32-218.win32-py3.3.exe
endif
$(PIP) install docutils pdoc pylint wheel pyinstaller
touch $(DEPENDS_DEV) # flag to indicate dependencies are installed

# Documentation ##############################################################
Expand Down Expand Up @@ -98,15 +101,15 @@ read: doc
# Static Analysis ############################################################

.PHONY: pep8
pep8: env .depends-ci
pep8: .depends-ci
$(PEP8) $(PACKAGE) --ignore=E501

.PHONY: pep257
pep257: env .depends-ci
pep257: .depends-ci
$(PEP257) $(PACKAGE) --ignore=E501,D102

.PHONY: pylint
pylint: env .depends-dev
pylint: .depends-dev
$(PYLINT) $(PACKAGE) --reports no \
--msg-template="{msg_id}:{line:3d},{column}:{msg}" \
--max-line-length=79 \
Expand All @@ -118,11 +121,11 @@ check: pep8 pep257 pylint
# Testing ####################################################################

.PHONY: test
test: env .depends-ci
test: .depends-ci
$(NOSE)

.PHONY: tests
tests: env .depends-ci
tests: .depends-ci
TEST_INTEGRATION=1 $(NOSE) --verbose --stop --cover-package=$(PACKAGE)

.PHONY: ci
Expand Down Expand Up @@ -172,16 +175,19 @@ clean-all: clean .clean-env
fi;

.PHONY: dist
dist: .git-no-changes env depends check test tests doc
dist: .git-no-changes depends check test tests doc
$(PYTHON) setup.py sdist
$(PYTHON) setup.py bdist_wheel
$(MAKE) read

.PHONY: upload
upload: .git-no-changes env depends doc
upload: .git-no-changes depends doc
$(PYTHON) setup.py register sdist upload
$(PYTHON) setup.py bdist_wheel upload

.PHONY: exe
exe: depends
$(BIN)/pyinstaller $(PACKAGE)/main.py

# System Installation ########################################################

Expand Down
12 changes: 12 additions & 0 deletions foobar/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env python

"""Sample entry point."""


def main():
"""Placeholder."""
print("Hello, world!")


if __name__ == '__main__': # pragma: no cover
main()
18 changes: 18 additions & 0 deletions foobar/test/test_main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env python

"""Tests for foobar.main."""

import unittest

from foobar import main


class Test(unittest.TestCase):

def test_main(self):
self.assertIs(None, main.main())


if __name__ == "__main__":
# import sys;sys.argv = ['', 'Test.testName']
unittest.main()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

packages=setuptools.find_packages(),

entry_points={'console_scripts': []},
entry_points={'console_scripts': ['foobar = foobar.main:main']},

long_description=(README + '\n' + CHANGES),
license='WTFPL',
Expand Down