Skip to content

Commit

Permalink
Merge pull request #12 from Bernardo-MG/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Bernardo-MG committed Oct 12, 2016
2 parents e1c7f58 + 303daa8 commit f6e0db0
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 41 deletions.
3 changes: 1 addition & 2 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"project_name": "Python Library",
"package_name": "python-library",
"project_short_description": "A library for Python",
"release_date": "2016-xx-xx",
"year": "2016",
"version": "0.1.0"
"version": "0.1.2"
}
21 changes: 1 addition & 20 deletions docs/source/tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,25 +82,6 @@ By default Travis won't run this environment, as it is too prone to failures.
It will check the readme, the manifest and all the code, making sure they
conform style standards.

---------------------------------------------
Adding tests for other Python implementations
---------------------------------------------

The tests are meant to be run with the help of Travis. But this service does not
offer all the existing Python implementations.

If for some reason one of these needs to be added Pyenv can be used, and an
example using Jython is included.

~~~~~~~~~~~~
Jython tests
~~~~~~~~~~~~

To run tests with the Jython implementation use the '.scripts/test_jython.sh' script.

Jython is installed using Pyenv and the tests will be run with the help of
pytests instead of tox.

.. _Coveralls: https://coveralls.io
.. _tox: https://testrun.org/tox/latest/
.. _tox: https://tox.readthedocs.io/en/latest/
.. _Travis CI: travis-ci.org
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def run_tests(self):
include_package_data=True,
package_data={
},
version='0.1.1',
version='0.1.2',
description='Cookiecutter template for Python libraries.',
author='Bernardo Martínez Garrido',
author_email='programming@wandrell.com',
Expand All @@ -73,7 +73,7 @@ def run_tests(self):
install_requires=[
'cookiecutter',
'setuptools',
'sphinx_bootstrap_theme',
'sphinx_docs_theme',
],
tests_require=_tests_require,
extras_require={'test': _tests_require},
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
{docs}
docs
skip_missing_interpreters =
true

Expand All @@ -12,4 +12,4 @@ deps =
sphinx
commands =
sphinx-build -b linkcheck ./ {envtmpdir}/html
sphinx-build -W -b html -d {envtmpdir}/doctrees ./ {envtmpdir}/html
sphinx-build -nW -b html -d {envtmpdir}/doctrees ./ {envtmpdir}/html
4 changes: 3 additions & 1 deletion {{cookiecutter.package_name}}/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ install:
# tox is required for the tests
- pip install tox
script:
# Code is checked
- ~/.scripts/python/run_tests.sh true check
# Tests are run
- ~/.scripts/python/run_tests.sh true $PYTHON_VERSION_TEST
# Documentation tests are run
- ~/.scripts/python/run_tests.sh $DO_TEST_DOCS docs
# Documentation tests are run
# Tests coverage is run
- ~/.scripts/python/run_tests.sh $DO_COVERAGE coverage
after_success:
# Documentation deployment
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.package_name}}/docs/source/reports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Code Quality
============ ===
Report Description
============ ===
`Landscape`_ Coverage report
`Landscape`_ Code quality report
============ ===

.. _Coveralls: https://coveralls.io/github/{{ cookiecutter.github_username }}/{{ cookiecutter.package_name }}
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.package_name}}/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def run_tests(self):
long_description=read('README.rst'),
install_requires=[
'setuptools',
'sphinx_bootstrap_theme',
'sphinx_docs_theme',
'twine',
],
tests_require=_tests_require,
Expand Down
4 changes: 0 additions & 4 deletions {{cookiecutter.package_name}}/tests/test_placeholder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

"""
Placeholder tests.
The following cases are tested:
- A placeholder test that is always true passes
"""

__author__ = '{{ cookiecutter.developer_name }}'
Expand Down
18 changes: 10 additions & 8 deletions {{cookiecutter.package_name}}/tox.ini
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
[tox]
envlist =
{py26,py27,pypy},
{py32,py33,py34,pypy3},
{docs},
{coverage}
py{27,33,34,35},
pypy{,3},
check,
docs,
coverage
skip_missing_interpreters =
true

[testenv]
# Default environment
deps =
-r{toxinidir}/requirements.txt
nose
commands =
nosetests

[testenv:coverage]
# Generates coverage report
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
deps =
-r{toxinidir}/requirements.txt
Expand All @@ -23,29 +26,28 @@ deps =
coveralls
commands =
nosetests --with-coverage --cover-package={{ cookiecutter.package_name }}
coverage combine
coverage report --omit=*test*
coveralls

[testenv:check]
# Checks code rules
deps =
-r{toxinidir}/requirements.txt
docutils
check-manifest
flake8
readme
pygments
commands =
python setup.py check --strict --metadata --restructuredtext
check-manifest {toxinidir}
flake8 {{ cookiecutter.package_name }}

[testenv:docs]
# Validates the project docs
changedir =
docs/source
deps =
-r{toxinidir}/requirements.txt
sphinx
commands =
sphinx-build -b linkcheck ./ {envtmpdir}/html
sphinx-build -W -b html -d {envtmpdir}/doctrees ./ {envtmpdir}/html
sphinx-build -nW -b html -d {envtmpdir}/doctrees ./ {envtmpdir}/html

0 comments on commit f6e0db0

Please sign in to comment.