Commit Graph
100 Commits
Author SHA1 Message Date
Stephen Finucane 17596b5f3c docs: Remove unused imports
These were causing flake8 failures.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2019-02-25 11:03:59 +00:00
Stephen Finucane a35040c454 docs: Address further review comments
todo:
- Subclass SphinxDirective instead of Directive

recipe:
- Remove unnecessary '__init__' methods

Signed-off-by: Stephen Finucane <stephen@that.guru>
2019-02-18 13:46:30 +00:00
Stephen Finucane 5c061ff266 docs: Address review comments
helloworld:
- Return version metadata from extension
- Use 'reST' instead of 'rST'
- Don't use single backticks

todo:
- Return version metadata from extension
- Link to events section of API guide, rather than entire document
- Include name of phases in when describing build phases
- Use more method cross-references where possible
- Fix typo in usage example

recipe:
- Return version metadata from extension
- Rework code to simplify things
- Remove docstrings from 'generate' functions, which are simply
  duplicates of the original docstring
- Rename 'rcp' directive to 'recipe', the 'reref' role to 'ref', and a
  whole lot of variables to something more grokable
- Fix typos in both documentation and code

I've also fixed up the docstrings for some of the 'domain' functions to
make them render a little nicer (they took me a while to figure out).

Signed-off-by: Stephen Finucane <stephen@that.guru>
2019-02-14 10:31:45 +00:00
Stephen Finucane b1ebdcd3c6 doc: Add "recipe" tutorial
This is based on a post from opensource.com [1] and demonstrates how one
can use indexes for cross-referencing and domains to group these indexes
along with domains and roles. The source code was taken from [2] after
getting the license changed [3].

[1] https://opensource.com/article/18/11/building-custom-workflows-sphinx
[2] https://github.com/ofosos/sphinxrecipes
[3] https://github.com/ofosos/sphinxrecipes/issues/1

Signed-off-by: Stephen Finucane <stephen@that.guru>
2019-02-09 17:58:30 +00:00
Stephen Finucane 93081e2fce doc: Use 'literalinclude' directive for examples
This avoid duplication and could conceivably let us test this stuff in
code later on.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2019-02-09 17:58:30 +00:00
Stephen Finucane 513d99c316 docs: Rework "todo" tutorial
Adopt the same format as was recently added in the "hello world"
tutorial, making this more of a walkthrough as expected from tutorials.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2019-02-09 17:58:30 +00:00
Stephen Finucane 7bce985ac9 docs: Rework the "helloworld" tutorial
Nothing to drastic going on here, but this format works better for other
tutorials we're adding.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2019-02-09 17:58:30 +00:00
Stephen Finucane 3e2f680af3 Add bindep integration
The bindep (BINary DEPendency automation) tool is a tool for checking
the presence of binary packages needed to use an application / library.
Use it to specify the dependencies needed to successfully pass the LaTex
tests. Only Fedora targets are currently provided.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-12-17 14:46:34 +00:00
Stephen Finucane 5a9033e5aa Specifically request Python 3
If Sphinx is Python 3-only, Sphinx's tooling should be Python 3-only
too.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-12-17 09:46:18 +00:00
Stephen Finucane d345d0f8c1 py3: Remove (most) __future__ imports
There were two used:

- print_function
- absolute_import

Both of these are mandatory in Python 3.0 onwards [1] and can therefore
be removed...mostly. Unfortunately, mypy is still running in Python 2.7
mode, meaning we need the 'print_function' future wherever we're calling
'print' with the 'file' argument. There's also a single
'absolute_import' future that must be retained as its removal breaks a
test for as-yet unknown reasons.  TODOs are added to resolve both issues
in the future.

[1] https://docs.python.org/3/library/__future__.html

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-12-17 09:46:15 +00:00
Stephen Finucane 1c07f0004f doc: Add "theming" to usage guide
This one is a little unusual. The current theming doc mixes user-focused
documentation with developer-focused documentation. This is confusing
and unnecessary. Resolve the issue by splitting the doc in two. The
user-focused docs are moved to the advanced section of the usage guide,
while the developer docs remain where they are, pending the addition of
a developer guide.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 15:23:33 +01:00
Stephen Finucane 356ebd5596 doc: Rework "theming" document
Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 13:33:36 +01:00
Stephen Finucane 71e8477597 doc: Add "websupport" to usage guide
Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 13:23:06 +01:00
Stephen Finucane e766336a2b doc: Rework "websupport" documents
Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 13:23:01 +01:00
Stephen Finucane 23afd29cbb doc: Add "setuptools" to usage guide
Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 13:22:38 +01:00
Stephen Finucane d380617c3b doc: Add "internationalization" to the usage guide
This is added to the new "advanced" subsection.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 13:20:46 +01:00
Stephen Finucane b7ff889050 doc: Rework "internationalization" document
Shuffle some things around, add some additional markup, and fix header
styles.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 12:42:27 +01:00
Stephen Finucane ac9f6a8b05 Fix two nits with the TextBuilder class
- 'logger' was unused and can be removed
- 'TextTranslator.sectionchars' was overridden in '__init__' and doesn't
  need to be defined

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 11:15:05 +01:00
Stephen Finucane 3eb26a3335 travis: Run flake8 against Python 3.6
As with tox and make before it, we run everything that we can against
Python 3 (Python 3.6 in this case).

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-06-21 15:11:42 +01:00
Stephen Finucane 2a4827af4f make: Default to Python 3
As with the tox change, it makes sense to test things against Python 3
by default now, seeing as that will be the only version supported in
Sphinx 2.0.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-06-21 15:11:35 +01:00
Stephen Finucane 93589a3572 tox: Run everything but unit tests under Python 3
The demise of Python 2.7 is not far off and we intend to drop support
for it in Sphinx 2.0. As a result, there probably isn't a better time
than now to start testing with Python 3 by default. There are a couple
of advantages to this:

- flake8 is stricter under Python 3 and we don't need to ignore files
  with Python 3 syntax
- We get to dogfood Sphinx against its own documentation using Python 3
- pylint gains support for Python 3 syntax

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-06-20 09:53:29 +01:00
Stephen Finucane c0f42b6519 Escape raw strings
These were resulting in the below warning messages when running flake8
under Python 3.6.

    :48: DeprecationWarning: invalid escape sequence \[
    :143: DeprecationWarning: invalid escape sequence \-
    :250: DeprecationWarning: invalid escape sequence \s

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-06-20 09:51:55 +01:00
Stephen Finucane d9ccc95717 doc: Add "extensions" to usage guide
Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-06-20 09:30:47 +01:00
Stephen Finucane 0b81af6a2e doc: Rework "extensions" documents
This is mostly spacing and other "niceness" fixes.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-06-20 09:26:59 +01:00
Stephen Finucane b595c4a45b doc: Add "builders" to usage guide
This is placed in a directory as this document will eventually be split
up. However, this is not the day to do this.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-06-20 09:26:59 +01:00
Stephen Finucane 7e27e09493 doc: Rework "builders" document
There are a number of cleanup items.

- Some paragraphs are reworded or clarified
- Semantic markup is added where possible
- Everything is wrapped to ~80 characters

A number of TODOs are inserted. These will be resolved separately.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-06-20 09:26:59 +01:00
Stephen Finucane 0bf8886fc4 doc: Address review comments
These came up in the review for pull request #4799.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-04-30 21:41:12 +01:00
Stephen Finucane 16e76faba3 doc: Add "config" to usage guide
Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-04-30 21:36:45 +01:00
Stephen Finucane ac19be3585 doc: Rework "config" document
Wrap some lines and format some definition lists as such.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-04-30 21:36:44 +01:00
Stephen Finucane d1972ac5b5 doc: Add "markdown" section to usage guide
Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-04-30 21:36:44 +01:00
Stephen Finucane dcf07f8005 doc: Rework "markdown" document
There are a number of cleanup items.

- Some paragraphs are reworded or clarified
- Semantic markup is added where possible
- Everything is wrapped to ~80 characters

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-04-30 21:36:44 +01:00
Stephen Finucane 7a8d1dc08c doc: Fix line length
Keep things in the fixed docs under 80 characters.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-04-30 21:36:44 +01:00
Stephen Finucane 651d41e1c7 Mark raw string as such
Resolves the following warning when building docs:

  sphinx/ext/autosummary/__init__.py:94: DeprecationWarning: invalid
  escape sequence \.
    periods_re = re.compile('\.(?:\s+)')

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-04-08 23:35:01 +09:00
Stephen Finucane 2565195a44 doc: Add "domains" doc to usage guide
Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-03-27 15:37:28 +01:00
Stephen Finucane 893a7ac1f2 doc: Rework "showing code" section
This makes the section more consistent with the rest of the document.
This adds a new section to the basics guide for doctest blocks, which
are a docutils thing. It also update the default highlight language,
which is now 'default'.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-03-27 15:37:28 +01:00
Stephen Finucane ecd193cde8 doc: Extend "directives" doc, part 3
Finish building up this combined doc by adding the contents of the
former 'misc' document. There are no changes to the content.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-03-27 15:37:28 +01:00
Stephen Finucane e01e9e34bb doc: Extend "directives" doc, part 2
Continue building up this combined doc by adding the contents of the
former 'code' document. There are no changes to the content.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-03-27 15:37:28 +01:00
Stephen Finucane 0641209da9 doc: Extend "directives" doc, part 1
Continue building up this combined doc by adding the contents of the
former 'para' document. There are no changes to the content.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-03-27 15:37:28 +01:00
Stephen Finucane fdf91e502c doc: Add "directives" doc to restructuredtext section
There's simply no need to artificially divide up the documentation on
directives into multiple, hard-to-navigate documents. Gather all
documentation for directives into one easy-to-reference guide, starting
with the former 'toctree' document. There are no changes to the content.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-03-27 15:37:28 +01:00
Stephen Finucane 0167c009c2 doc: Rework "markup" documents
These are going to form the basis of a future 'directive' document, so
we do some cleanup before this happens. There are a number of cleanup
items.

- Some paragraphs are reworded or clarified
- Semantic markup is added where possible
- Everything is wrapped to ~80 characters

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-03-27 15:37:28 +01:00
Stephen Finucane 08ff8160b8 doc: Add "field-lists" doc to restructuredtext section
These are very poorly documented at present, especially given their
power and use in basically all non-Napoleon based Python documentation.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-03-27 15:37:25 +01:00
Stephen Finucane 3fcb1bd2dd doc: Add "roles" doc to restructuredtext section
This is essentially the 'markup/inline' with a few small fixes. There
are also some modifications to the basic rST guide to highlight what a
role is; we were doing this for directives but not roles.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-03-27 15:34:36 +01:00
Stephen Finucane 9c2ab8c3bb doc: Add "restructuredtext" section to usage guide
This is taken from the existing 'rest' documents. Little to no
modifications are necessary, thankfully.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-03-27 15:34:26 +01:00
Stephen Finucane cef28eedfe codecov: Disable status checks
We don't currently care if a commit changes our coverage metrics, so we
can disable the status checks that would enforce that.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: #4738
2018-03-20 15:33:35 +00:00
Stephen Finucane ff579b3c66 doc: Add "quickstart" doc to usage guide
This is simply the former 'tutorial' document renamed. A number of
references need to be updated, so this is done.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-02-26 11:36:46 +00:00
Stephen Finucane 4bc03706e8 doc: Rework "tutorial" document
We're going to use this document as the basis for a future usage
document, so we start by cleaning things up beforehand. A couple of
changes are necessary:

- The installation guide is referenced, rather than duplicating the
  steps

In addition, there is a number of cleanup items.

- Some paragraphs are reworded or clarified
- Semantic markup is added where possible
- Everything is wrapped to ~80 characters

A number of TODOs are inserted. These will be resolved separately.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-02-26 11:36:36 +00:00
Stephen Finucane c8d1db72a8 make: Group test commands together
We may want to eventually deprecate these in favour of 'tox', but this
cleans things up a little until then.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-02-12 11:52:53 +00:00
Stephen Finucane 690714f4c4 make: Remove deprecated targets
These have been deprecated for a while and can now be removed.

Some indentation is also fixed, while we're at it.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-02-12 11:52:53 +00:00
Stephen Finucane cb4b7177d8 doc: Create usage guide section
Start structuring our docs a little better starting with a usage guide.
There are a number of changes happening here. We're going to start with
the installation guide, which is simply moved to the appropriate
subdirectory.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-02-10 16:22:44 +00:00
Stephen Finucane 4fa7d6037c doc: Rework "install" document
This is a large rework of the installation guide. There are a couple of
changes necessary:

- 'Mac OSX' is replaced by 'macOS'
- PyPI installation steps are moved to their own section
- Instructions are no longer provided for installing Python on Windows:
instead, we refer to the other, better-maintained guides.

In addition, there are a number of cleanup items.

- Some paragraphs are reworded or clarified
- Semantic markup is added where possible
- Everything is wrapped to ~80 characters

A number of TODOs are inserted. These will be resolved separately.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-02-10 16:22:40 +00:00
Stephen Finucane d35cda9943 util: Mark deprecated functions with warning
This ensures the functions can actually be removed as expected.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-02-07 11:26:59 +00:00
Stephen Finucane 05f851fa19 trivial: Remove 'tests/etree13'
This vendored code had no callers in modern Sphinx and has not been
needed since Python 2.5, which included the ElementTree API [1], was
released. It can be removed in its entirety.

[1] https://docs.python.org/2/library/xml.etree.elementtree.html

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-02-06 20:15:25 +00:00
Stephen Finucane f3074d1747 setup: Configure flake8 extension as a local plugin
We don't want to install this as a system plugin. Now that flake8 3.5.0
is in the wild, we can use this.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: #4492
2018-01-26 09:41:50 +00:00
Stephen Finucane 1ec03ec1b0 doc: Add 'deprecated' directive to docstrings
This helps emphasize the deprecated nature of these directives.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-21 11:38:03 +00:00
Stephen Finucane 487480ca01 doc: Add 'is_parallel_allowed'
This is an important function and should be documented.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-21 11:37:59 +00:00
Stephen Finucane 6c23dac5a6 doc: Reorder 'sphinx.application' docs to match code
Use the same ordering to minimize cognitive load.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-21 11:19:52 +00:00
Stephen Finucane b7ff955472 doc: Move 'sphinx.application' API docs to code
This allows us to do something like 'help(sphinx.application)' in code.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-21 11:19:46 +00:00
Stephen Finucane eaaab75ec2 doc: Rework 'sphinx.application' API documentation
Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-21 10:49:38 +00:00
Stephen Finucane ecbe08d467 sphinx: Call 'sphinx.cmd.build.main' function
This was missed in commit '89f9c7cab'.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: #4470
2018-01-20 23:19:38 +00:00
Stephen Finucane 78a44b5825 doc: Resolve inconsistent 'sphinx-apidoc' docs
The signature for the 'sphinx-apidoc' call differs between the man page
and the output of 'sphinx-apidoc --help'. Resolve this by considering
the 'sphinx-apidoc --help' output the canonical reference.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: #4451
2018-01-20 23:02:18 +00:00
Stephen Finucane 30b7f3f4d6 setuptools: Don't create directories
Don't create the build or doctree directories. These are already handled
by 'sphinx.application.Application' and 'sphinx.builder.Builder',
respectively.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-20 13:05:06 +00:00
Stephen Finucane 3a85b3502f app: Centralize directory validation
This allows us to avoid duplication of code and ensure validation
happens regardless of who's initializing the class. We introduce a new
exception - ApplicationError - to indicate these kinds of issues. This
subclasses SphinxError, meaning we don't need to modify our exception
handling code.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-20 13:04:29 +00:00
Stephen Finucane b215f523f7 doc: Move sphinx.logging API docs to code
Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-20 13:00:43 +00:00
Stephen Finucane b7749c6ca3 doc: Move sphinx.config API docs to code
Once again, we make things a little smarter by using Python domain
roles.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-20 12:53:45 +00:00
Stephen Finucane 391cd8195b doc: Move sphinx.errors API docs to code
This allows us to do something like 'help(sphinx.errors)' in code. We
reword the exception descriptions per Python stdlib conventions.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-20 12:47:49 +00:00
Stephen Finucane 4420b43e5a tox: Ignore distutils deprecation warning
distutils/__init__.py:4: DeprecationWarning: the imp module is
    deprecated in favour of importlib; see the module's documentation
    for alternative uses
      import imp

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-15 09:09:53 +00:00
Stephen Finucane b16fd2ce01 make.bat: Make SOURCEDIR configurable
It's unlikely that anyone will need to do this but at least give them
the opportunity.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-11 20:57:03 +00:00
Stephen Finucane f6a045d171 Makefile: Make SOURCEDIR configurable
It's unlikely that anyone will need to do this but at least give them
the opportunity.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-11 20:57:03 +00:00
Stephen Finucane 6f9a262f45 make.bat: Remove unnecessary targets
As with the Makefile previously, these are not necessary now that we're
not printing anything different for various builders.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-11 20:57:03 +00:00
Stephen Finucane aa2c5c9065 Makefile: Remove unnecessary targets
Most of these are not necessary now that we're not printing different
messages for various builders.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-11 20:57:03 +00:00
Stephen Finucane 221dffda3c make_mode: Remove unnecessary 'make_*' functions
These are handled by the default case.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-11 20:57:03 +00:00
Stephen Finucane a83e8bab7d builders: Add 'Builder.epilog' option
This allows builders to emit a final epilog message containing
information such as where resulting files can be found. This is only
emitted if the build was successful.

This allows us to remove this content from the 'make_mode' tool and
the legacy 'Makefile' and 'make.bat' templates. There's room for more
dramatic simplification of the former, but this will come later.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-11 20:57:03 +00:00
Stephen Finucane 69f39e44d9 tox: Enable 'skipsdist'
Given that we install Sphinx as part of the dependencies, there's no
reason to do it twice. Skip that step.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-01 18:47:12 +09:00
Stephen Finucane 60e25090a3 tox: Enable 'skipsdist'
Given that we install Sphinx as part of the dependencies, there's no
reason to do it twice. Skip that step.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-29 13:02:33 +00:00
Stephen Finucane 9a3ebaaff5 Resolve warning filter issues
There's an issue with 'pkgutils' and namespace packages. This has been
reported against setuptools [1], but until this is resolved, we simply
need to live with it. Ensure said warnings are filtered from tox too and
remove some unnecessary ones.

[1] https://github.com/pypa/setuptools/issues/1111

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-29 13:02:32 +00:00
Stephen Finucane 7c0723fd46 tests: Remove 'tests/run.py'
This is no longer necessary. One test needs to be modified to deal with
how 'python -m pytest' modifies the PATH.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-29 13:02:31 +00:00
Stephen Finucane 529c96a3c9 tests: Use 'pytest_sessionstart'
This is the recommended way to do pre-session configuration in pytest if
not using session fixtures [1].

With this, we're able to remove the custom 'test/run.py' script in its
entirety and run 'pytest' like everyone else does. We'll do this
separately to keep things simple.

[1] https://stackoverflow.com/a/12600154/613428

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-29 13:02:26 +00:00
Stephen Finucane c33ecd1f8f tests: Use 'pytest_report_header'
This is the recommended way to print extra headers [1].

[1] https://docs.pytest.org/en/latest/example/simple.html#adding-info-to-test-report-header

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-29 13:02:07 +00:00
Stephen Finucane 9348c4bea1 tests: Stop explicitly checking for modules
This will have already been handled by setuptools. If the user isn't
using this then they've dug their own grave.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-29 13:02:04 +00:00
Stephen Finucane 4fd217ce88 circleci: Install packages ourselves
Start installing Python dependencies and Sphinx itself as part of the
CircleCI job rather than expecting it to be done in the Docker
container. This ensures we will use the version of the packages for a
given commit.

This is the other half of sphinx-doc/docker-ci#1.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-29 13:01:59 +00:00
Stephen Finucane 9f7f5f2a44 doc: Add missing sphinx-apidocs opt, envvar
Add docs for '--module-first' option and 'SPHINX_APIDOC_OPTIONS'
environment variable. Per the closest thing we have to official man page
guidelines [1]:

  ENVIRONMENT

  lists all environment variables that affect the program or function
  and how they affect it.

[1] https://linux.die.net/man/7/man-pages

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes #2250
2017-12-28 23:00:53 +00:00
Stephen Finucane 35ad6910a9 epub: Remove dead templates
These are no longer used since 'f2c93b31'.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-28 21:37:37 +00:00
Stephen Finucane f048d668e5 doc: Remove invalid note for epub3 builder
This doesn't appear to be true any more, based on the code.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-28 21:28:55 +00:00
Stephen Finucane f4f677c8f7 templates: Remove 'epub3' targets
This appears to have been missed in commit 69d1dfaa. One could add an
alias for this to restore behavior, but no one has reported the issue
since Sphinx meaning this seems unnecessary.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-28 21:18:23 +00:00
Stephen Finucane f068627176 gitignore: Ignore 'htmlcov' directory
This is generated if you run 'coverage html'. Hide it from Git.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-24 21:24:41 +00:00
Stephen Finucane 77ca894723 tox: Report coverage to user
Run 'coverage report' after a successful coverage run. There's enough
coverage-related stuff here at this point to warrant its own section.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-24 21:24:41 +00:00
Stephen Finucane a3f9935d95 travis: Enable codecov coverage
This necessitates adding some basic coverage-py configuration [1] and
making sure the pytest-cov plugin uses said configuration [2]. Badges
are included.

Note that we do not run the 'coverage' tox target, which is reserved for
users.

[1] https://github.com/codecov/example-python
[2] https://bitbucket.org/ned/coveragepy/issues/512/

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-24 21:24:41 +00:00
Stephen Finucane 411055905c tox: Add 'PERL5LIB' to 'passenv' list
This is required by 'makeinfo'.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes #4339
2017-12-24 14:47:31 +00:00
Stephen Finucane ac9ae4d54b README: Fix typo
Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: 393f59d ("Improve README")
2017-12-19 16:02:05 +00:00
Stephen Finucane a2a873d58a tox: Add documentation for all targets
This should make 'tox -av' more helpful.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-19 15:55:10 +00:00
Stephen Finucane 638e646766 doc: Rework CONTRIBUTING to encourage use of tox
Embrace the tox-ified future. This explicitly asks users to use a
virtualenv to stop them shooting themselves in the foot.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-19 15:22:14 +00:00
Stephen Finucane 76bd631872 travis: Start using tox for testing
This allows us to validate and reuse the testing tools we use locally
for "gate" tests and moves us closer to the eventual goal of deprecating
the Makefile targets. This involves adding two new targets to the list
of default targets run by tox - docs and mypy.

Note that we don't use tox-travis because, wonderful though it may be,
configuring it to exclude as many of the tests as we want to exclude is
a little convoluted (we have a big test matrix).

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-19 15:21:42 +00:00
Stephen Finucane a6f0ba0fc9 README: Cleanup badges
Add AppVeyor badge and include 'alt' attributes for the others.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-19 15:05:44 +00:00
Stephen Finucane 393f59da00 Improve README
We're going to be adding additional badges to this but, before we do
that, we should improve the README and remove a lot of the duplication
that has built up here.

The 'long_description' from 'setup.py' is moved into the README as there
is serious value in displaying this on GitHub, as much as there is value
in including the badges and other content from README.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-19 15:00:06 +00:00
Stephen Finucane f74b6756ac setup.cfg: Restructure file
Place configuration of the package itself first in the file, followed by
configuration of other tools.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-19 12:06:16 +00:00
Stephen Finucane fd1df0815b tox: Make further use of factor-conditional deps
This is how we reduce boilerplate [1]. Succinctness FTW.

[1] https://tox.readthedocs.io/en/latest/config.html#factors-and-factor-conditional-settings

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-18 20:10:18 +00:00
Stephen Finucane 5d812ccefc tox: Add 'coverage' target
Enabling coverage results in an increase in runtime, and while this may
be an acceptable compromise for some developers, it's not necessarily
something we need to run all the time. Move it to a separate target so
it can be run only by those who wish to use it.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-18 20:10:18 +00:00
Stephen Finucane c8d56236c9 tests: Ignore roots using 'collect_ignore'
This is slightly cleaner than how we're doing this at the moment.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-18 20:10:18 +00:00
Stephen Finucane e243e82723 tests: Ignore tests using 'collect_ignore'
Per the pytest docs [1], this is the preferred way to ignore tests. This
necessitates removing the 'test-async' target as it no longer makes any
sense.

[1] https://docs.pytest.org/en/latest/example/pythoncollection.html

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-18 20:10:18 +00:00
Stephen Finucane 41c19ddf91 tests: Skip tests with missing binaries
While there are already some skips included here, they clearly aren't
doing their job and the test fail locally. Resolve this.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-18 20:10:18 +00:00