There were issues with dependencies and tox environments under Python 3
so refactored the tox configuration to be more consistent and clearer.
- Moved travis to default to Python 3 for linting and tests.
- Fixed missing mock for cairo in sphinx config.
- Collated the base deps sections to improve readability.
- Added PYTEST_ADDOPTS env to override pytest verbosity in just tox
tests as this was a common option being used.
- Renamed env 'testcoverage' to the more concise 'coverage' and moved
html creation under single env as handy to have this output as well
as report.
- Cleaned up the isort config for gtk3.
- Added `bad-continuation` to pylint config as conflcts with black
formatting.
- Fix isort issue with bbfreeze script. This will likely be removed
in future so just skip sorting it.
With move to GTK3 needed to update the mocking of external modules.
There is a new autodoc option `autodoc_mock_imports` so use this instead
of the custom mock class.
There are some build warnings output using autodoc mock:
TypeError: unsupported operand type(s) for |: '_MockObject' and '_MockObject'
Will resolve these later as the build passes.
The apidoc modules were not being generated on ReadTheDocs because
there is no way to run sphinx-apidoc manually.
Moved the running of sphinx-apidoc into conf.py.
Added zope.interface minimum version to fix Readthedocs warning.
The use of pkg_resource.require caused an unwanted requirements lookup
that errored out the sphinx build when no dependencies are installed.
This is fixed by switching to pkg_resources.get_distribution.
Also changed the tox docs env to not install Deluge as the setup.py
now contains install_requires which is unwanted.
- Change the layout and contents of docs to be better organised and
follow ideas from: https://www.divio.com/blog/documentation/
- Use markdown for non-technical documents to speed up writing.
- Added new sections and imported documents from Trac wiki.
Build fixes:
- Added a patch to fix recommonmark 0.4 and doc referencing:
https://github.com/rtfd/recommonmark/issues/93
- Set docs build in tox to Py2.7 since there are problems with autodoc
mocking multiple inheritance on Python 3 resulting in metaclass errors.
- Supressed warning about `modules.rst` not in the toctree by creating
a static `modules.rst` with `:orphan:` file directive and add to git.
Also skip creating this toc file with sphinx-apidoc in setup and tox.
- Simplified finding exported RPC and JSON API methods by adding an
autodoc custom class directive. Removed unneeded __rpcapi.py.
- Use recommonmark to enable use of markdown files in docs.
- Fix theme not specified
- Remove unused spelling module.
- Cleanup mocking modules in conf so building docs requires only Sphinx.
- Simplify tox section, including use of requirements-docs file. Added
slimit dependency for sdist-ing deluge package.
The move to using auto-formatter makes it easier to read, submit and
speeds up development time. https://github.com/ambv/black/
Although I would prefer 79 chars, the default line length of 88 chars
used by black suffices. The flake8 line length remains at 120 chars
since black does not touch comments or docstrings and this will require
another round of fixes.
The only black setting that is not standard is the use of double-quotes
for strings so disabled any formatting of these. Note however that
flake8 will still flag usage of double-quotes. I may change my mind on
double vs single quotes but for now leave them.
A new pyproject.toml file has been created for black configuration.
Likely that the deprecation warning from cryptography is causing the
setup.py sphinx build command to return an error so the tox/travis job
is marked as failing. Changing to calling the sphinx-build command
directly solves this.
Also updated the sphinx config for built-in napoleon and faster builds
using jobs option.
Some new flake8 checkers were added so fix these new warnings and
any issues uncovered.
Use add-trailing-comma to fix missing trailing commas. It does not
format it as well as I would like however it was fast to change and
helps with git changes in future.
Removed pylint from tox due to large number of warnings.
* A rather disruptive change but for a few reasons such as easier to read,
easier type, keep consistent and javascript code uses single quotes.
* There are a few exceptions for the automated process:
* Any double quotes in comments
* Triple double quotes for docstrings
* Strings containing single quotes are left e.g. "they're"
* To deal with merge conflicts from feature branches it is best to follow
these steps for each commit:
* Create a patch: `git format-patch -1 <sha1>`
* Edit the patch and replace double quotes with single except those in
comments or strings containing an unescaped apostrophe.
* Check the patch `git apply --check <patchfile>` and fix any remaining
issues if it outputs an error.
* Apply the patch `git am < <patchfile>`
* version.py script requires git tags but detached HEAD in travis clone
requires manually creating the RELEASE-VERSION.
* Also fix relative path issue building docs.
Targets:
* Runs the unit-tests for python 2.7
* Tests unit-test coverage
* Try to build docs
* Code style checks:
* flake8
* isort
Codes changes:
* Fixed tests for httpdownloader (using tmp dir)
* Implemented a couple of tests for Stats plugin but they fail to run on travis
Issues:
* Can't get py26 to work because of installing libtorrent through apt and
the option system_site_packages fails for 2.6.
Updated Sphinx conf and tested with Sphinx 1.2.1
Moved webui gen_gettext script
Fixed docstring warning in code
Renamed console update-tracker to update_tracker