Use tox for running tests and building docs

* Set up tox for testing supported Django/Python combinations
* Also include tox env for checking and building docs
* Use tox-travis for Travis CI integration
* Add tests against Django master
* Document building docs and running tests with tox
This commit is contained in:
medmunds
2018-03-12 11:56:08 -07:00
committed by Mike Edmunds
parent b32c3ccb38
commit b06d684dd5
8 changed files with 489 additions and 61 deletions

31
docs/_readme/docutils.cfg Normal file
View File

@@ -0,0 +1,31 @@
# docutils (rst2html) config for generating static HTML that approximates
# PyPI package description rendering (as of 3/2018).
#
# Usage (in package root dir):
# python setup.py --long-description | rst2html.py --config=docs/_readme/docutils.cfg > ${OUTDIR}/readme.html
#
# Requires docutils and pygments (both are installed with Sphinx)
[general]
# Duplicate docutils config used by PyPA readme_renderer.
# https://github.com/pypa/readme_renderer/blob/master/readme_renderer/rst.py
# (This isn't exactly what's used on legacy PyPI, but it's close enough.)
cloak_email_addresses = True
doctitle_xform = True
sectsubtitle_xform = True
initial_header_level = 2
file_insertion_enabled = False
math_output = MathJax
raw_enabled = False
smart_quotes = True
strip_comments = True
syntax_highlight = short
# Halt rendering and throw an exception if there was any errors or warnings from docutils.
halt_level = 2
# DON'T Disable all system messages from being reported.
# (We're not running inside readme_renderer, so *do* want to see warnings and errors.)
# report_level = 5
# Approximate PyPI's styles:
stylesheet = docs/_readme/readme.css

74
docs/_readme/readme.css Normal file
View File

@@ -0,0 +1,74 @@
/*
readme.css
Approximates PyPI package description rendering as of 3/2018,
using docutils rst2html output.
*/
/* Borrow base docutils and pygments styles directly from PyPI: */
@import url("https://pypi.python.org/static/css/docutils.css");
@import url("https://pypi.python.org/static/css/pygments.css"); /* requires rst2html 'short' classnames */
/* Subset of PyPI site styles applicable to package description: */
HTML, BODY {
font-family: Arial, Verdana, Geneva, "Bitstream Vera Sans", Helvetica, sans-serif;
font-size: 103%;
color: #000;
background-color: #FFF;
}
H1, H2, H3, H4, H5 {
font-family: Georgia, "Bitstream Vera Serif", "New York", Palatino, serif;
font-weight: normal;
line-height: 1em;
}
H1 {
font-size: 160%;
color: #234764;
margin: 0.7em 0;
text-decoration: none;
}
H2 {
font-size: 140%;
color: #366D9C;
margin: 0.7em 0 0.7em 0;
}
IMG {
border: 0;
}
A:link {
color: #00A;
}
A:visited {
color: #551A8B;
}
P A:link, P A:visited,
UL A:link, UL A:visited,
OL A:link, OL A:visited {
text-decoration: none;
border-bottom: 1px dashed #ccc;
}
/* Additional styles, to account for not having all of PyPI's wrapper and navigation divs: */
body {
line-height: 1.5;
font-size: 14.6px; /* ~computed font-size in PyPI's div#content */
}
h1.title {
text-align: left;
}
ul, li {
margin-left: 1em;
padding-left: 0;
}
pre {
padding: 10px;
font-size: 11.9px; /* ~computed font-size in PyPI's div#content pre */
}
/* Give the page a little breathing room: */
.document {
max-width: 960px;
margin: 0 auto;
}
body {
padding: 1em;
}