Merge lp:~cjwatson/lazr.authentication/tox into lp:lazr.authentication
- tox
- Merge into trunk
Proposed by
Colin Watson
Status: | Merged |
---|---|
Merged at revision: | 54 |
Proposed branch: | lp:~cjwatson/lazr.authentication/tox |
Merge into: | lp:lazr.authentication |
Diff against target: |
669 lines (+275/-227) 15 files modified
.bzrignore (+8/-8) HACKING.rst (+1/-6) MANIFEST.in (+5/-4) _bootstrap/COPYRIGHT.txt (+0/-9) _bootstrap/LICENSE.txt (+0/-54) _bootstrap/bootstrap.py (+0/-77) buildout.cfg (+0/-47) pylint.rc (+1/-1) setup.py (+11/-7) src/lazr/authentication/docs/Makefile (+20/-0) src/lazr/authentication/docs/NEWS.rst (+5/-0) src/lazr/authentication/docs/conf.py (+170/-0) src/lazr/authentication/docs/index.rst (+5/-0) src/lazr/authentication/tests/test_docs.py (+14/-14) tox.ini (+35/-0) |
To merge this branch: | bzr merge lp:~cjwatson/lazr.authentication/tox |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matias Bordese (community) | Approve | ||
LAZR Developers | Pending | ||
Review via email: mp+344801@code.launchpad.net |
Commit message
Add tox testing support and drop buildout.
Description of the change
I was very fed up of having to deal with buildout and remember the various arcane invocations required to actually run the doctests properly.
To post a comment you must log in.
- 55. By Colin Watson
-
Fix documentation version handling.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2009-03-17 14:52:16 +0000 |
3 | +++ .bzrignore 2018-05-08 08:04:58 +0000 |
4 | @@ -1,11 +1,11 @@ |
5 | +*.egg-info |
6 | +*.pyc |
7 | +__pycache__ |
8 | +.tox |
9 | bin |
10 | -develop-eggs |
11 | -.installed.cfg |
12 | -develop-eggs |
13 | -parts |
14 | -*.egg-info |
15 | +build |
16 | +dist |
17 | +MANIFEST |
18 | tags |
19 | TAGS |
20 | -build |
21 | -*.egg |
22 | -dist |
23 | +src/lazr/authentication/docs/_build |
24 | |
25 | === renamed file 'HACKING.txt' => 'HACKING.rst' |
26 | --- HACKING.txt 2009-10-06 18:04:43 +0000 |
27 | +++ HACKING.rst 2018-05-08 08:04:58 +0000 |
28 | @@ -13,16 +13,11 @@ |
29 | You should have received a copy of the GNU Lesser General Public License |
30 | along with lazr.authentication. If not, see <http://www.gnu.org/licenses/>. |
31 | |
32 | -This project uses zc.buildout for development. |
33 | - |
34 | ============ |
35 | Introduction |
36 | ============ |
37 | |
38 | -These are guidelines for hacking on the lazr.authentication project. But first, |
39 | -please see the common hacking guidelines at: |
40 | - |
41 | - http://dev.launchpad.net/Hacking |
42 | +To run this project's tests, use `tox <https://tox.readthedocs.io/en/latest/>`. |
43 | |
44 | |
45 | Getting help |
46 | |
47 | === modified file 'MANIFEST.in' |
48 | --- MANIFEST.in 2009-06-26 18:09:58 +0000 |
49 | +++ MANIFEST.in 2018-05-08 08:04:58 +0000 |
50 | @@ -1,4 +1,5 @@ |
51 | -include *.py *.rc |
52 | -global-include *.txt *.zcml |
53 | -exclude MANIFEST.in buildout.cfg bootstrap.py .bzrignore |
54 | -prune _bootstrap |
55 | +include COPYING.txt HACKING.rst *.rc |
56 | +recursive-include src *.txt *.rst |
57 | +include src/lazr/authentication/docs/Makefile |
58 | +prune src/lazr/authentication/docs/_build |
59 | +exclude MANIFEST.in .bzrignore |
60 | |
61 | === renamed file 'README.txt' => 'README.rst' |
62 | === removed directory '_bootstrap' |
63 | === removed file '_bootstrap/COPYRIGHT.txt' |
64 | --- _bootstrap/COPYRIGHT.txt 2009-03-23 19:12:50 +0000 |
65 | +++ _bootstrap/COPYRIGHT.txt 1970-01-01 00:00:00 +0000 |
66 | @@ -1,9 +0,0 @@ |
67 | -Copyright (c) 2004-2009 Zope Corporation and Contributors. |
68 | -All Rights Reserved. |
69 | - |
70 | -This software is subject to the provisions of the Zope Public License, |
71 | -Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. |
72 | -THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
73 | -WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
74 | -WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
75 | -FOR A PARTICULAR PURPOSE. |
76 | |
77 | === removed file '_bootstrap/LICENSE.txt' |
78 | --- _bootstrap/LICENSE.txt 2009-03-23 19:12:50 +0000 |
79 | +++ _bootstrap/LICENSE.txt 1970-01-01 00:00:00 +0000 |
80 | @@ -1,54 +0,0 @@ |
81 | -Zope Public License (ZPL) Version 2.1 |
82 | -------------------------------------- |
83 | - |
84 | -A copyright notice accompanies this license document that |
85 | -identifies the copyright holders. |
86 | - |
87 | -This license has been certified as open source. It has also |
88 | -been designated as GPL compatible by the Free Software |
89 | -Foundation (FSF). |
90 | - |
91 | -Redistribution and use in source and binary forms, with or |
92 | -without modification, are permitted provided that the |
93 | -following conditions are met: |
94 | - |
95 | -1. Redistributions in source code must retain the |
96 | - accompanying copyright notice, this list of conditions, |
97 | - and the following disclaimer. |
98 | - |
99 | -2. Redistributions in binary form must reproduce the accompanying |
100 | - copyright notice, this list of conditions, and the |
101 | - following disclaimer in the documentation and/or other |
102 | - materials provided with the distribution. |
103 | - |
104 | -3. Names of the copyright holders must not be used to |
105 | - endorse or promote products derived from this software |
106 | - without prior written permission from the copyright |
107 | - holders. |
108 | - |
109 | -4. The right to distribute this software or to use it for |
110 | - any purpose does not give you the right to use |
111 | - Servicemarks (sm) or Trademarks (tm) of the copyright |
112 | - holders. Use of them is covered by separate agreement |
113 | - with the copyright holders. |
114 | - |
115 | -5. If any files are modified, you must cause the modified |
116 | - files to carry prominent notices stating that you changed |
117 | - the files and the date of any change. |
118 | - |
119 | -Disclaimer |
120 | - |
121 | - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' |
122 | - AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT |
123 | - NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
124 | - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN |
125 | - NO EVENT SHALL THE COPYRIGHT HOLDERS BE |
126 | - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
127 | - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
128 | - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
129 | - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
130 | - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
131 | - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
132 | - OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
133 | - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
134 | - DAMAGE. |
135 | \ No newline at end of file |
136 | |
137 | === removed file '_bootstrap/bootstrap.py' |
138 | --- _bootstrap/bootstrap.py 2009-03-23 19:12:50 +0000 |
139 | +++ _bootstrap/bootstrap.py 1970-01-01 00:00:00 +0000 |
140 | @@ -1,77 +0,0 @@ |
141 | -############################################################################## |
142 | -# |
143 | -# Copyright (c) 2006 Zope Corporation and Contributors. |
144 | -# All Rights Reserved. |
145 | -# |
146 | -# This software is subject to the provisions of the Zope Public License, |
147 | -# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. |
148 | -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
149 | -# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
150 | -# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
151 | -# FOR A PARTICULAR PURPOSE. |
152 | -# |
153 | -############################################################################## |
154 | -"""Bootstrap a buildout-based project |
155 | - |
156 | -Simply run this script in a directory containing a buildout.cfg. |
157 | -The script accepts buildout command-line options, so you can |
158 | -use the -c option to specify an alternate configuration file. |
159 | - |
160 | -$Id$ |
161 | -""" |
162 | - |
163 | -import os, shutil, sys, tempfile, urllib2 |
164 | - |
165 | -tmpeggs = tempfile.mkdtemp() |
166 | - |
167 | -is_jython = sys.platform.startswith('java') |
168 | - |
169 | -try: |
170 | - import pkg_resources |
171 | -except ImportError: |
172 | - ez = {} |
173 | - exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' |
174 | - ).read() in ez |
175 | - ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) |
176 | - |
177 | - import pkg_resources |
178 | - |
179 | -if sys.platform == 'win32': |
180 | - def quote(c): |
181 | - if ' ' in c: |
182 | - return '"%s"' % c # work around spawn lamosity on windows |
183 | - else: |
184 | - return c |
185 | -else: |
186 | - def quote (c): |
187 | - return c |
188 | - |
189 | -cmd = 'from setuptools.command.easy_install import main; main()' |
190 | -ws = pkg_resources.working_set |
191 | - |
192 | -if is_jython: |
193 | - import subprocess |
194 | - |
195 | - assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd', |
196 | - quote(tmpeggs), 'zc.buildout'], |
197 | - env=dict(os.environ, |
198 | - PYTHONPATH= |
199 | - ws.find(pkg_resources.Requirement.parse('setuptools')).location |
200 | - ), |
201 | - ).wait() == 0 |
202 | - |
203 | -else: |
204 | - assert os.spawnle( |
205 | - os.P_WAIT, sys.executable, quote (sys.executable), |
206 | - '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout', |
207 | - dict(os.environ, |
208 | - PYTHONPATH= |
209 | - ws.find(pkg_resources.Requirement.parse('setuptools')).location |
210 | - ), |
211 | - ) == 0 |
212 | - |
213 | -ws.add_entry(tmpeggs) |
214 | -ws.require('zc.buildout') |
215 | -import zc.buildout.buildout |
216 | -zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap']) |
217 | -shutil.rmtree(tmpeggs) |
218 | |
219 | === removed symlink 'bootstrap.py' |
220 | === target was u'_bootstrap/bootstrap.py' |
221 | === removed file 'buildout.cfg' |
222 | --- buildout.cfg 2009-10-06 18:04:43 +0000 |
223 | +++ buildout.cfg 1970-01-01 00:00:00 +0000 |
224 | @@ -1,47 +0,0 @@ |
225 | -[buildout] |
226 | -parts = |
227 | - interpreter |
228 | - test |
229 | - docs |
230 | - tags |
231 | - filetemplates |
232 | - pylint |
233 | -unzip = true |
234 | - |
235 | -develop = . |
236 | - |
237 | -[test] |
238 | -recipe = zc.recipe.testrunner |
239 | -eggs = lazr.authentication |
240 | -defaults = '--tests-pattern ^tests --exit-with-status --suite-name additional_tests'.split() |
241 | - |
242 | -[docs] |
243 | -recipe = z3c.recipe.sphinxdoc |
244 | -eggs = lazr.authentication [docs] |
245 | -index-doc = README |
246 | -default.css = |
247 | -layout.html = |
248 | - |
249 | -[interpreter] |
250 | -recipe = zc.recipe.egg |
251 | -interpreter = py |
252 | -eggs = lazr.authentication |
253 | - docutils |
254 | - |
255 | -[tags] |
256 | -recipe = z3c.recipe.tag:tags |
257 | -eggs = lazr.authentication |
258 | - |
259 | -[filetemplates] |
260 | -recipe = z3c.recipe.filetemplate |
261 | -source-directory = buildout-templates |
262 | -package = lazr.authentication |
263 | -eggs = lazr.authentication |
264 | - |
265 | -[pylint] |
266 | -recipe = zc.recipe.egg |
267 | -eggs = |
268 | - logilab.pylintinstaller |
269 | - pylint==0.15.2 |
270 | -entry-points = pylint=pylint.lint:Run |
271 | -arguments = sys.argv[1:] |
272 | |
273 | === modified file 'pylint.rc' |
274 | --- pylint.rc 2009-06-17 02:54:25 +0000 |
275 | +++ pylint.rc 2018-05-08 08:04:58 +0000 |
276 | @@ -20,7 +20,7 @@ |
277 | |
278 | # Add <file or directory> to the black list. It should be a base name, not a |
279 | # path. You may set this option multiple times. |
280 | -ignore=CVS |
281 | +ignore=CVS,conf.py |
282 | |
283 | # Pickle collected data for later comparisons. |
284 | persistent=no |
285 | |
286 | === modified file 'setup.py' |
287 | --- setup.py 2014-08-01 11:38:52 +0000 |
288 | +++ setup.py 2018-05-08 08:04:58 +0000 |
289 | @@ -16,14 +16,13 @@ |
290 | # You should have received a copy of the GNU Lesser General Public License |
291 | # along with lazr.authentication. If not, see <http://www.gnu.org/licenses/>. |
292 | |
293 | -import sys |
294 | from setuptools import setup, find_packages |
295 | |
296 | # generic helpers primarily for the long_description |
297 | def generate(*docname_or_string): |
298 | res = [] |
299 | for value in docname_or_string: |
300 | - if value.endswith('.txt'): |
301 | + if value.endswith('.rst'): |
302 | f = open(value) |
303 | value = f.read() |
304 | f.close() |
305 | @@ -36,6 +35,10 @@ |
306 | |
307 | __version__ = open("src/lazr/authentication/version.txt").read().strip() |
308 | |
309 | +tests_require = [ |
310 | + 'zope.testrunner', |
311 | + ] |
312 | + |
313 | setup( |
314 | name='lazr.authentication', |
315 | version=__version__, |
316 | @@ -46,10 +49,10 @@ |
317 | zip_safe=False, |
318 | maintainer='LAZR Developers', |
319 | maintainer_email='lazr-developers@lists.launchpad.net', |
320 | - description=open('README.txt').readline().strip(), |
321 | + description=open('README.rst').readline().strip(), |
322 | long_description=generate( |
323 | - 'src/lazr/authentication/README.txt', |
324 | - 'src/lazr/authentication/NEWS.txt'), |
325 | + 'src/lazr/authentication/docs/index.rst', |
326 | + 'src/lazr/authentication/docs/NEWS.rst'), |
327 | license='LGPL v3', |
328 | install_requires=[ |
329 | 'httplib2', |
330 | @@ -66,9 +69,10 @@ |
331 | "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", |
332 | "Operating System :: OS Independent", |
333 | "Programming Language :: Python"], |
334 | + tests_require=tests_require, |
335 | extras_require=dict( |
336 | - docs=['Sphinx', |
337 | - 'z3c.recipe.sphinxdoc'] |
338 | + docs=['Sphinx'], |
339 | + test=tests_require, |
340 | ), |
341 | # This does not play nicely with buildout because it downloads but does |
342 | # not cache the package. |
343 | |
344 | === added file 'src/lazr/authentication/docs/Makefile' |
345 | --- src/lazr/authentication/docs/Makefile 1970-01-01 00:00:00 +0000 |
346 | +++ src/lazr/authentication/docs/Makefile 2018-05-08 08:04:58 +0000 |
347 | @@ -0,0 +1,20 @@ |
348 | +# Minimal makefile for Sphinx documentation |
349 | +# |
350 | + |
351 | +# You can set these variables from the command line. |
352 | +SPHINXOPTS = |
353 | +SPHINXBUILD = sphinx-build |
354 | +SPHINXPROJ = lazrauthentication |
355 | +SOURCEDIR = . |
356 | +BUILDDIR = _build |
357 | + |
358 | +# Put it first so that "make" without argument is like "make help". |
359 | +help: |
360 | + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
361 | + |
362 | +.PHONY: help Makefile |
363 | + |
364 | +# Catch-all target: route all unknown targets to Sphinx using the new |
365 | +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). |
366 | +%: Makefile |
367 | + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
368 | \ No newline at end of file |
369 | |
370 | === renamed file 'src/lazr/authentication/NEWS.txt' => 'src/lazr/authentication/docs/NEWS.rst' |
371 | --- src/lazr/authentication/NEWS.txt 2014-11-08 12:52:40 +0000 |
372 | +++ src/lazr/authentication/docs/NEWS.rst 2018-05-08 08:04:58 +0000 |
373 | @@ -2,6 +2,11 @@ |
374 | NEWS for lazr.authentication |
375 | ============================ |
376 | |
377 | +0.1.4 |
378 | +===== |
379 | + |
380 | +- Switch from buildout to tox. |
381 | + |
382 | 0.1.3 (2014-11-08) |
383 | ================== |
384 | |
385 | |
386 | === added file 'src/lazr/authentication/docs/conf.py' |
387 | --- src/lazr/authentication/docs/conf.py 1970-01-01 00:00:00 +0000 |
388 | +++ src/lazr/authentication/docs/conf.py 2018-05-08 08:04:58 +0000 |
389 | @@ -0,0 +1,170 @@ |
390 | +# -*- coding: utf-8 -*- |
391 | +# |
392 | +# lazr.authentication documentation build configuration file, created by |
393 | +# sphinx-quickstart on Sat Apr 28 19:41:59 2018. |
394 | +# |
395 | +# This file is execfile()d with the current directory set to its |
396 | +# containing dir. |
397 | +# |
398 | +# Note that not all possible configuration values are present in this |
399 | +# autogenerated file. |
400 | +# |
401 | +# All configuration values have a default; values that are commented out |
402 | +# serve to show the default. |
403 | + |
404 | +with open('../version.txt') as version_file: |
405 | + _version = version_file.read().strip() |
406 | + |
407 | +# If extensions (or modules to document with autodoc) are in another directory, |
408 | +# add these directories to sys.path here. If the directory is relative to the |
409 | +# documentation root, use os.path.abspath to make it absolute, like shown here. |
410 | +# import os |
411 | +# import sys |
412 | +# sys.path.insert(0, os.path.abspath('.')) |
413 | + |
414 | + |
415 | +# -- General configuration ------------------------------------------------ |
416 | + |
417 | +# If your documentation needs a minimal Sphinx version, state it here. |
418 | +# |
419 | +# needs_sphinx = '1.0' |
420 | + |
421 | +# Add any Sphinx extension module names here, as strings. They can be |
422 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
423 | +# ones. |
424 | +extensions = [] |
425 | + |
426 | +# Add any paths that contain templates here, relative to this directory. |
427 | +templates_path = ['_templates'] |
428 | + |
429 | +# The suffix(es) of source filenames. |
430 | +# You can specify multiple suffix as a list of string: |
431 | +# |
432 | +# source_suffix = ['.rst', '.md'] |
433 | +source_suffix = '.rst' |
434 | + |
435 | +# The master toctree document. |
436 | +master_doc = 'index' |
437 | + |
438 | +# General information about the project. |
439 | +project = u'lazr.authentication' |
440 | +copyright = u'2009-2018, Canonical Ltd.' |
441 | +author = u'LAZR Developers <lazr-developers@lists.launchpad.net>' |
442 | + |
443 | +# The version info for the project you're documenting, acts as replacement for |
444 | +# |version| and |release|, also used in various other places throughout the |
445 | +# built documents. |
446 | +# |
447 | +# The short X.Y version. |
448 | +version = _version |
449 | +# The full version, including alpha/beta/rc tags. |
450 | +release = _version |
451 | + |
452 | +# The language for content autogenerated by Sphinx. Refer to documentation |
453 | +# for a list of supported languages. |
454 | +# |
455 | +# This is also used if you do content translation via gettext catalogs. |
456 | +# Usually you set "language" from the command line for these cases. |
457 | +language = None |
458 | + |
459 | +# List of patterns, relative to source directory, that match files and |
460 | +# directories to ignore when looking for source files. |
461 | +# This patterns also effect to html_static_path and html_extra_path |
462 | +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] |
463 | + |
464 | +# The name of the Pygments (syntax highlighting) style to use. |
465 | +pygments_style = 'sphinx' |
466 | + |
467 | +# If true, `todo` and `todoList` produce output, else they produce nothing. |
468 | +todo_include_todos = False |
469 | + |
470 | + |
471 | +# -- Options for HTML output ---------------------------------------------- |
472 | + |
473 | +# The theme to use for HTML and HTML Help pages. See the documentation for |
474 | +# a list of builtin themes. |
475 | +# |
476 | +html_theme = 'alabaster' |
477 | + |
478 | +# Theme options are theme-specific and customize the look and feel of a theme |
479 | +# further. For a list of options available for each theme, see the |
480 | +# documentation. |
481 | +# |
482 | +# html_theme_options = {} |
483 | + |
484 | +# Add any paths that contain custom static files (such as style sheets) here, |
485 | +# relative to this directory. They are copied after the builtin static files, |
486 | +# so a file named "default.css" will overwrite the builtin "default.css". |
487 | +#html_static_path = ['_static'] |
488 | + |
489 | +# Custom sidebar templates, must be a dictionary that maps document names |
490 | +# to template names. |
491 | +# |
492 | +# This is required for the alabaster theme |
493 | +# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars |
494 | +html_sidebars = { |
495 | + '**': [ |
496 | + 'relations.html', # needs 'show_related': True theme option to display |
497 | + 'searchbox.html', |
498 | + ] |
499 | +} |
500 | + |
501 | + |
502 | +# -- Options for HTMLHelp output ------------------------------------------ |
503 | + |
504 | +# Output file base name for HTML help builder. |
505 | +htmlhelp_basename = 'lazrauthenticationdoc' |
506 | + |
507 | + |
508 | +# -- Options for LaTeX output --------------------------------------------- |
509 | + |
510 | +latex_elements = { |
511 | + # The paper size ('letterpaper' or 'a4paper'). |
512 | + # |
513 | + # 'papersize': 'letterpaper', |
514 | + |
515 | + # The font size ('10pt', '11pt' or '12pt'). |
516 | + # |
517 | + # 'pointsize': '10pt', |
518 | + |
519 | + # Additional stuff for the LaTeX preamble. |
520 | + # |
521 | + # 'preamble': '', |
522 | + |
523 | + # Latex figure (float) alignment |
524 | + # |
525 | + # 'figure_align': 'htbp', |
526 | +} |
527 | + |
528 | +# Grouping the document tree into LaTeX files. List of tuples |
529 | +# (source start file, target name, title, |
530 | +# author, documentclass [howto, manual, or own class]). |
531 | +latex_documents = [ |
532 | + (master_doc, 'lazrauthentication.tex', u'lazr.authentication Documentation', |
533 | + u'LAZR Developers \\textless{}lazr-developers@lists.launchpad.net\\textgreater{}', 'manual'), |
534 | +] |
535 | + |
536 | + |
537 | +# -- Options for manual page output --------------------------------------- |
538 | + |
539 | +# One entry per manual page. List of tuples |
540 | +# (source start file, name, description, authors, manual section). |
541 | +man_pages = [ |
542 | + (master_doc, 'lazrauthentication', u'lazr.authentication Documentation', |
543 | + [author], 1) |
544 | +] |
545 | + |
546 | + |
547 | +# -- Options for Texinfo output ------------------------------------------- |
548 | + |
549 | +# Grouping the document tree into Texinfo files. List of tuples |
550 | +# (source start file, target name, title, author, |
551 | +# dir menu entry, description, category) |
552 | +texinfo_documents = [ |
553 | + (master_doc, 'lazrauthentication', u'lazr.authentication Documentation', |
554 | + author, 'lazrauthentication', 'One line description of project.', |
555 | + 'Miscellaneous'), |
556 | +] |
557 | + |
558 | + |
559 | + |
560 | |
561 | === renamed file 'src/lazr/authentication/README.txt' => 'src/lazr/authentication/docs/index.rst' |
562 | --- src/lazr/authentication/README.txt 2018-04-28 19:08:51 +0000 |
563 | +++ src/lazr/authentication/docs/index.rst 2018-05-08 08:04:58 +0000 |
564 | @@ -303,3 +303,8 @@ |
565 | Teardown. |
566 | |
567 | >>> _ = wsgi_intercept.remove_wsgi_intercept('oauthtest', 80) |
568 | + |
569 | +.. toctree:: |
570 | + :glob: |
571 | + |
572 | + NEWS |
573 | |
574 | === modified file 'src/lazr/authentication/tests/test_docs.py' |
575 | --- src/lazr/authentication/tests/test_docs.py 2018-04-28 19:10:38 +0000 |
576 | +++ src/lazr/authentication/tests/test_docs.py 2018-05-08 08:04:58 +0000 |
577 | @@ -15,20 +15,20 @@ |
578 | # along with lazr.authentication. If not, see <http://www.gnu.org/licenses/>. |
579 | "Test harness for doctests." |
580 | |
581 | -# pylint: disable-msg=E0611,W0142 |
582 | +# pylint: disable=E0611 |
583 | |
584 | __metaclass__ = type |
585 | __all__ = [ |
586 | - 'additional_tests', |
587 | + 'load_tests', |
588 | ] |
589 | |
590 | import atexit |
591 | import doctest |
592 | import os |
593 | -# pylint: disable-msg=F0401 |
594 | + |
595 | +# pylint: disable=F0401 |
596 | from pkg_resources import ( |
597 | resource_filename, resource_exists, resource_listdir, cleanup_resources) |
598 | -import unittest |
599 | |
600 | DOCTEST_FLAGS = ( |
601 | doctest.ELLIPSIS | |
602 | @@ -36,17 +36,17 @@ |
603 | doctest.REPORT_NDIFF) |
604 | |
605 | |
606 | -def additional_tests(): |
607 | - "Run the doc tests (README.txt and docs/*, if any exist)" |
608 | - doctest_files = [ |
609 | - os.path.abspath(resource_filename('lazr.authentication', 'README.txt'))] |
610 | +# pylint: disable=W0613 |
611 | +def load_tests(loader, tests, pattern): |
612 | + """Load all the doctests.""" |
613 | + doctest_files = [] |
614 | if resource_exists('lazr.authentication', 'docs'): |
615 | for name in resource_listdir('lazr.authentication', 'docs'): |
616 | - if name.endswith('.txt'): |
617 | + if name.endswith('.rst'): |
618 | doctest_files.append( |
619 | - os.path.abspath( |
620 | - resource_filename('lazr.authentication', 'docs/%s' % name))) |
621 | - kwargs = dict(module_relative=False, optionflags=DOCTEST_FLAGS) |
622 | + os.path.abspath(resource_filename( |
623 | + 'lazr.authentication', 'docs/%s' % name))) |
624 | atexit.register(cleanup_resources) |
625 | - return unittest.TestSuite(( |
626 | - doctest.DocFileSuite(*doctest_files, **kwargs))) |
627 | + tests.addTest(doctest.DocFileSuite( |
628 | + *doctest_files, module_relative=False, optionflags=DOCTEST_FLAGS)) |
629 | + return tests |
630 | |
631 | === added file 'tox.ini' |
632 | --- tox.ini 1970-01-01 00:00:00 +0000 |
633 | +++ tox.ini 2018-05-08 08:04:58 +0000 |
634 | @@ -0,0 +1,35 @@ |
635 | +[tox] |
636 | +envlist = |
637 | + py27,docs |
638 | + |
639 | +[testenv] |
640 | +deps = |
641 | + .[test] |
642 | +commands = |
643 | + zope-testrunner --test-path src --tests-pattern ^tests {posargs} |
644 | + |
645 | +# This is needed until we port to oauthlib. It means that this environment |
646 | +# will only work on Debian or derivatives with python3-oauth (which has had |
647 | +# 2to3 run over it) installed, so it isn't yet in envlist. |
648 | +[testenv:py36] |
649 | +sitepackages = True |
650 | + |
651 | +[lint] |
652 | +deps = |
653 | + pylint |
654 | +commands = |
655 | + pylint --rcfile=pylint.rc src/lazr/authentication/ |
656 | + |
657 | +# This has too many failures to be enabled by default as yet. |
658 | +[testenv:lint-py27] |
659 | +basepython = python2.7 |
660 | +skip_install = true |
661 | +deps = {[lint]deps} |
662 | +commands = {[lint]commands} |
663 | + |
664 | +[testenv:docs] |
665 | +basepython = python2.7 |
666 | +deps = |
667 | + .[docs] |
668 | +commands = |
669 | + sphinx-build -b html -d src/lazr/authentication/docs/_build/doctrees src/lazr/authentication/docs src/lazr/authentication/docs/_build/html |
LGTM