Update to run tasks with invoke.

This commit is contained in:
Dorian 2017-04-19 08:41:32 -04:00
parent b23d4a9460
commit c58c8b45fe
8 changed files with 19 additions and 50 deletions

View File

@ -2,6 +2,9 @@
url = "https://pypi.python.org/simple" url = "https://pypi.python.org/simple"
verify_ssl = true verify_ssl = true
[dev-packages]
invoke = "*"
[packages] [packages]
Cython = "==0.23" Cython = "==0.23"
PyInstaller = "*" PyInstaller = "*"

6
Pipfile.lock generated
View File

@ -1,7 +1,7 @@
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "80fe88d513994f118cb0d20194b63b5091ffa729c90b8819863023b2af6def02" "sha256": "40e008e812036981170caeb7b5fe7df74140cee7b9afbf3c98d8d8569fa2260d"
}, },
"requires": {}, "requires": {},
"sources": [ "sources": [
@ -47,6 +47,10 @@
"develop": { "develop": {
"buildozer": { "buildozer": {
"git": "https://github.com/kivy/buildozer" "git": "https://github.com/kivy/buildozer"
},
"invoke": {
"hash": "sha256:a1c825fcc213b6b1ee35a9483556bd8ade0ff549ac96132f58d679087cbfc57b",
"version": "==0.16.3"
} }
} }
} }

View File

@ -1,10 +0,0 @@
# Requirements for basic operation of the game.
# User interface
kivy
Markdown==2.4.1
# Core logic
enum34==0.9.19
docutils

View File

@ -1,15 +0,0 @@
# Requirements for developing the justCheckers app
# Task management
invoke>=0.7.0
# Sphinx and Pygments
Sphinx>=1.2.2
# TODO Remove after the next release of releases.
-e git+https://github.com/bitprophet/releases@master#egg=releases
# Testing
mock>=1.0.1
nose>=1.3.0
coverage>=3.6,<3.7
flake8>=2.1.0

View File

@ -1,2 +0,0 @@
# Requirements for the web front for justCheckers
Flask>=0.10

View File

@ -6,13 +6,18 @@ from invoke import task, run
@task @task
def clean(): def run_game(ctx):
run('python main.py')
@task
def clean(ctx):
"""Clean generated files.""" """Clean generated files."""
run('rm *.pyc') run('rm *.pyc')
@task @task
def docs(): def docs(ctx):
"""Creates the HTML documentation through Sphinx.""" """Creates the HTML documentation through Sphinx."""
build_dirs = ['docs/_api', 'docs/_build'] build_dirs = ['docs/_api', 'docs/_build']
for build_dir in build_dirs: for build_dir in build_dirs:
@ -23,7 +28,7 @@ def docs():
@task @task
def clean_docs(): def clean_docs(ctx):
"""Clean up the generated Sphinx documentation.""" """Clean up the generated Sphinx documentation."""
sphinx_api_docs_dir = os.path.join(os.curdir, 'docs', '_api') sphinx_api_docs_dir = os.path.join(os.curdir, 'docs', '_api')
if os.path.exists(sphinx_api_docs_dir): if os.path.exists(sphinx_api_docs_dir):
@ -35,33 +40,19 @@ def clean_docs():
@task @task
def test_style(): def test_style(ctx):
"""Test the coding style using Flake8.""" """Test the coding style using Flake8."""
run('flake8') run('flake8')
@task @task
def test(): def build_package(ctx):
"""Test the webapp using both unit and integration nose tests."""
run('nosetests --with-coverage --cover-html --cover-package=justcheckers --cover-inclusive --cover-branches')
@task
def clean_tests():
"""Cleans test reports and artifacts."""
coverage_report_dir = os.path.join(os.curdir, 'cover')
if os.path.exists(coverage_report_dir):
shutil.rmtree(coverage_report_dir)
@task
def build_package():
"""Prepares the project for packaging.""" """Prepares the project for packaging."""
run('python setup.py sdist') run('python setup.py sdist')
@task @task
def clean_package(): def clean_package(ctx):
"""Cleans up generated files after packaging the project.""" """Cleans up generated files after packaging the project."""
packaging_dirs = [os.path.join(os.curdir, packaging) for packaging in ['justcheckers.egg-info', 'dist']] packaging_dirs = [os.path.join(os.curdir, packaging) for packaging in ['justcheckers.egg-info', 'dist']]
for packaging in packaging_dirs: for packaging in packaging_dirs:

View File

View File

@ -1,2 +0,0 @@
# TODO: Write full integration tests that mimic a full game of checkers of each variant.
# e.g. American, International, Polish...