Skip to content

Commit

Permalink
Merge pull request #523 from benjaoming/makefile
Browse files Browse the repository at this point in the history
Makefile and py.test
  • Loading branch information
benjaoming committed Jan 19, 2016
2 parents 050e34e + 133409b commit 18d92f0
Show file tree
Hide file tree
Showing 19 changed files with 2,111 additions and 1,110 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pip-log.txt
# Unit test / coverage reports
.coverage
.tox
.cache

#Eclipse
.project
Expand Down
460 changes: 0 additions & 460 deletions CHANGELOG.md

This file was deleted.

1,999 changes: 1,999 additions & 0 deletions HISTORY.rst

Large diffs are not rendered by default.

71 changes: 71 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
.PHONY: help clean clean-pyc clean-build list test test-all coverage docs release sdist

help:
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "lint - check style with flake8"
@echo "test - run tests quickly with the default Python"
@echo "testall - run tests on every Python version with tox"
@echo "coverage - check code coverage quickly with the default Python"
@echo "docs - generate Sphinx HTML documentation, including API docs"
@echo "release - package and upload a release"
@echo "sdist - package"

clean: clean-build clean-pyc

clean-build:
rm -fr build/
rm -fr dist/
rm -fr *.egg-info

clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +

lint:
pep8 kalite_zim

test:
./runtests.py

test-all:
tox

coverage:
coverage run --source ka-lite-zim setup.py test
coverage report -m
coverage html
open htmlcov/index.html

docs:
rm -f docs/ka-lite-zim.rst
# rm -f docs/modules.rst
# sphinx-apidoc -o docs/ ka-lite-zim
$(MAKE) -C docs clean
$(MAKE) -C docs html
sphinx-build -b linkcheck ./docs _build/
sphinx-build -b html ./docs _build/

release: clean
python setup.py sdist upload
python setup.py bdist_wheel upload

assets:
lessc wiki/static/wiki/bootstrap/less/wiki/wiki-bootstrap.less wiki/static/wiki/bootstrap/css/wiki-bootstrap.css
lessc -x wiki/static/wiki/bootstrap/less/wiki/wiki-bootstrap.less wiki/static/wiki/bootstrap/css/wiki-bootstrap.min.css

sdist: clean assets
echo "Creating HISTORY.rst"
echo "Latest Changes" > HISTORY.rst
echo "==============" >> HISTORY.rst
echo "" >> HISTORY.rst
echo "This file is auto-generated upon every new release."
echo "" >> HISTORY.rst
echo "Compiled on: `date`::" >> HISTORY.rst
echo "" >> HISTORY.rst
git log --graph --pretty=format:'%h -%d %s (%cr) <%an>' --abbrev-commit | sed "s/^/ /" >> HISTORY.rst
echo "Compiling LESS files to CSS..."
./build-less.sh
python setup.py sdist
ls -l dist
57 changes: 0 additions & 57 deletions TODO.md

This file was deleted.

16 changes: 16 additions & 0 deletions TODO.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
TODO
====

Unfinished
----------

#. Docs
#. Example plugin
#. Embeddable article template tag

Ideas
-----

#. Statistics page/plugin for wiki owners
#. Table plugin: Quickly add a row of data to an existing table and sort data.
#. Make a comments plugin for commenting inline
5 changes: 0 additions & 5 deletions build-less.sh

This file was deleted.

38 changes: 0 additions & 38 deletions build-sdist.sh

This file was deleted.

93 changes: 0 additions & 93 deletions custom_user_auth_south_refactor.py

This file was deleted.

2 changes: 2 additions & 0 deletions docs/history.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. include:: ../HISTORY.rst

2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Contents:
release_notes
known_issues
faq
history
todo

.. include:: ../README.rst

Expand Down
2 changes: 2 additions & 0 deletions docs/todo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. include:: ../TODO.rst

Binary file removed model_chart_wiki.pdf
Binary file not shown.
5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
django_find_project = false
python_files=test_*.py
testpaths=wiki
norecursedirs=testproject .svn _build tmp* dist *.egg-info
12 changes: 11 additions & 1 deletion runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,14 @@
# Allow tests to be specified:
argv.extend(sys.argv[1:])

execute_from_command_line(argv)

## Run py.tests
# Compatibility testing patches on the py-moneyed
import pytest
failures = pytest.main()

if failures:
sys.exit(failures)



2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ commands =

deps =
coverage
pytest
pytest-django
Pillow==2.3.0
django-classy-tags==0.4
six==1.6.1
Expand Down
Empty file removed wiki/management/__init__.py
Empty file.
Empty file.

0 comments on commit 18d92f0

Please sign in to comment.