* Closes#5076: [ext/napoleon] explicitly catch StopIteration
Per PEP 479, Python 3.7 no longer allows bubbling up StopIteration
outside of a generator. Instead, wrap attribute parsing in a try
block and provide a sane default in case it raises an exception
([]).
* Fix mypy and flake8 issues
There are situations where requested server replies with a different content (in my particular case HTTP 404) when there is no accept header, possibly because it evaluates the content negotiation to an API request instead of a browser request. This change adds a default Accept header, which equals to what my Firefox sets out of the box to its requests.
I stumbled upon this when checking a link to https://crates.io/crates/dredd-hooks. While
curl -i https://crates.io/crates/dredd-hooks
returns HTTP 404, following results in an expected HTTP 200 response with HTML body:
curl -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -i https://crates.io/crates/dredd-hooks
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>
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>
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>
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>
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>