From 92bd2e74804bdddb6600940886782e7e7c6b4ead Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sun, 26 Nov 2017 17:44:37 +0100 Subject: [PATCH] Add doc tests and spelling tests Signed-off-by: Christian Heimes --- .travis.yml | 36 ++++++--- Doc/conf.py | 7 ++ Doc/spelling_wordlist.txt | 151 ++++++++++++++++++++++++++++++++++++++ tox.ini | 17 ++++- 4 files changed, 200 insertions(+), 11 deletions(-) create mode 100644 Doc/spelling_wordlist.txt diff --git a/.travis.yml b/.travis.yml index 14c0965..581013c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,5 @@ language: python -python: -- '2.7' -- '3.3' -- '3.4' -- '3.5' -- '3.6' -# Note: when updating Python versions, also change setup.py and tox.ini - sudo: false cache: pip @@ -17,9 +9,33 @@ addons: packages: - ldap-utils - slapd + - enchant -env: - - WITH_GCOV=1 +# Note: when updating Python versions, also change setup.py and tox.ini +matrix: + include: + - python: 2.7 + env: + - TOXENV=py27 + - WITH_GCOV=1 + - python: 3.3 + env: + - TOXENV=py33 + - WITH_GCOV=1 + - python: 3.4 + env: + - TOXENV=py34 + - WITH_GCOV=1 + - python: 3.5 + env: + - TOXENV=py35 + - WITH_GCOV=1 + - python: 3.6 + env: + - TOXENV=py36 + - WITH_GCOV=1 + - python: 3.6 + env: TOXENV=doc install: - pip install "pip>=7.1.0" diff --git a/Doc/conf.py b/Doc/conf.py index 9314231..eb9f5a0 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -33,6 +33,13 @@ # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc'] +try: + import sphinxcontrib.spelling +except ImportError: + pass +else: + extensions.append('sphinxcontrib.spelling') + # Add any paths that contain templates here, relative to this directory. templates_path = ['.templates'] diff --git a/Doc/spelling_wordlist.txt b/Doc/spelling_wordlist.txt new file mode 100644 index 0000000..fcc227f --- /dev/null +++ b/Doc/spelling_wordlist.txt @@ -0,0 +1,151 @@ +args +async +attr +attrlist +attrList +attrs +attrsonly +attrsOnly +attrtype +authzId +automagically +backend +behaviour +BER +bindname +boolean +booleanValue +Bytestrings +cancelled +canonicalization +cb +cfg +changeNumber +changesOnly +changeType +changeTypes +cidict +clientctrls +conf +Continously +controlType +controlValue +criticality +cryptographic +cyrus +defresult +dereferenced +dereferencing +desc +directoryOperation +distinguished +distributedOperation +dit +dn +DN +dSAOperation +encodedControlValue +encodedResponseValue +extype +exvalue +favour +filterstr +filterStr +formatOID +func +heimdal +hostport +hrefTarget +hrefText +ignoreResultsNumber +integerValue +Interoperability +isn +Keepalive +Kerberos +keyerror +knownLDAPControls +kwarg +ldap +ldapadd +ldapControls +ldapControlTuples +ldapdelete +ldapi +LDAPObject +ldaps +ldapurl +ldapwhoami +ldif +LDIFWriter +libldap +libs +Libs +modlist +modrdn +msgid +multi +nameoroid +nots +Novell +objectClass +oc +oid +oids +openldap +postalAddress +pre +previousDN +processResultsCount +Proxied +py +rdn +reentrant +refmodule +refreshAndPersist +refreshDeletes +refreshOnly +requestName +requestValue +resiter +respvalue +ResultProcessor +returnECs +ruleid +rundir +sasl +searchRoot +searchScope +sed +serverctrls +sessionSourceIp +sessionSourceName +sessionTrackingIdentifier +sizelimit +slapd +stderr +stdout +str +Subclasses +subentry +subschema +substr +subtree +syncrepl +syntaxes +timelimit +tracebacks +tuple +tuples +UDP +Umich +unparsing +unsigend +uri +urlPrefix +urlscheme +userApplications +userPassword +usr +uuids +whitespace diff --git a/tox.ini b/tox.ini index 22ca4a8..51f8981 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,7 @@ [tox] # Note: when updating Python versions, also change setup.py and .travis.yml -envlist = py27,py33,py34,py35,py36,coverage-report +envlist = py27,py33,py34,py35,py36,doc,coverage-report [testenv] deps = coverage @@ -31,3 +31,18 @@ commands = {envpython} -m coverage combine {envpython} -m coverage report --show-missing {envpython} -m coverage html + +[testenv:doc] +basepython = python3 +deps = + docutils + markdown + sphinx + sphinxcontrib-spelling +commands = + {envpython} setup.py check --restructuredtext --metadata --strict + {envpython} -m markdown README -f {envtmpdir}/README.html + {envpython} -m sphinx -v -W -b html -d {envtmpdir}/doctrees \ + {toxinidir}/Doc {envtmpdir}/html + {envpython} -m sphinx -v -W -b spelling -d {envtmpdir}/doctrees \ + {toxinidir}/Doc {envtmpdir}/spelling