Skip to content

Commit

Permalink
track requirements as files, esp. for readthedocs.org
Browse files Browse the repository at this point in the history
  • Loading branch information
jquast committed Oct 3, 2015
1 parent fcb34a2 commit b59b4ae
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 42 deletions.
5 changes: 5 additions & 0 deletions CONTRIBUTING.rst
Expand Up @@ -56,6 +56,11 @@ static analysis tools through the **sa** target, invoked using::

tox -esa

Similarly, positional arguments can be used, for example to verify URL
links::

tox -esa -- -blinkcheck

All standards enforced by the underlying tools are adhered to by the blessed
project, with the declarative exception of those found in `landscape.yml
<https://github.com/jquast/blessed/blob/master/.landscape.yml>`_, or inline
Expand Down
3 changes: 3 additions & 0 deletions requirements-analysis.txt
@@ -0,0 +1,3 @@
prospector[with_frosted,with_pyroma]
restructuredtext_lint
doc8
3 changes: 3 additions & 0 deletions requirements-docs.txt
@@ -0,0 +1,3 @@
sphinx
sphinx_rtd_theme
sphinx-paramlinks
4 changes: 4 additions & 0 deletions requirements-tests.txt
@@ -0,0 +1,4 @@
pytest-xdist
pytest-cov
pytest
mock
48 changes: 6 additions & 42 deletions tox.ini
Expand Up @@ -5,13 +5,8 @@ skip_missing_interpreters = true
[testenv]
whitelist_externals = /bin/mv
setenv = PYTHONIOENCODING=UTF8
# use for brief or thorough testing, respectively
passenv = TEST_QUICK TEST_FULL
deps = pytest-xdist
pytest-cov
pytest
mock

deps = --requirement requirements-tests.txt
commands = python {toxinidir}/bin/display-sighandlers.py
python {toxinidir}/bin/display-terminalinfo.py
{envbindir}/py.test \
Expand All @@ -23,21 +18,8 @@ commands = python {toxinidir}/bin/display-sighandlers.py
/bin/mv {toxinidir}/.coverage {toxinidir}/.coverage.{envname}

[testenv:sa]
# Instead of trusting whichever developer's environment python is used to
# invoke tox, explicitly define python2.7 because the 'doc8' tool does not
# appear to be python3-compatible: https://github.com/stackforge/doc8/commit/4d82c269ab46f0c5370c1f00be06e0c406164e85#commitcomment-10725927
basepython=python2.7
deps = prospector[with_frosted,with_pyroma]
restructuredtext_lint
doc8

# - ensure all python files compile !
# - prospector is configured using .prospector.yaml, and wraps several
# static analysis/linting and style-checker tools.
# - rst-lint ensures that README.rst will present correctly on pypi.
# - doc8 is like pep8 for rst documents. Namely, enforcing styling.
# ignore docs/further.rst:21: D000 Bullet list ends without a blank line;
# unexpected unindent. This is a tool error
basepython = python2.7
deps = --requirement requirements-analysis.txt
commands = python -m compileall -fq {toxinidir}/blessed
{envbindir}/prospector \
--die-on-tool-error \
Expand All @@ -46,32 +28,14 @@ commands = python -m compileall -fq {toxinidir}/blessed
{envbindir}/doc8 --ignore-path docs/_build --ignore D000 docs

[testenv:docs]
whitelist_externals=echo
basepython=python3.4
deps=sphinx
sphinx_rtd_theme
sphinx-paramlinks

# note: to verify URL links,
#
# $ tox -edocs -- -blinkcheck
#
whitelist_externals = echo
basepython = python3.4
deps = --requirement requirements-docs.txt
commands = {envbindir}/sphinx-build -v -W -b html \
-d {toxinidir}/docs/_build/doctrees \
{posargs} docs \
{toxinidir}/docs/_build/html
echo "open {toxinidir}/docs/_build/html/index.html for review"

[testenv:linkcheck]
deps=sphinx
sphinx_rtd_theme
sphinx-paramlinks

commands = {envbindir}/sphinx-build -v -W -b html \
-d {toxinidir}/docs/_build/doctrees \
docs \
{toxinidir}/docs/_build/html
echo "open {toxinidir}/docs/_build/html/index.html for review"

[pytest]
looponfailroots = blessed

0 comments on commit b59b4ae

Please sign in to comment.