Commit Graph

49 Commits

Author SHA1 Message Date
Calum Lind 97e7d95dd3 Cleanup tox configuration
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.
2018-11-02 08:47:57 +00:00
Calum Lind dc6e93541b [Docs] Fix mocking external modules
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.
2018-11-02 08:45:39 +00:00
Calum Lind 01fafd4fe0 [GTK3] Change module structure from ui/gtkui to ui/gtk3
This moves the directory structure so that there is no conflict with the
old gtk2 UI. Also changes the conf and state files being loaded.
2018-11-02 08:45:39 +00:00
Calum Lind 98051bdea2 [Docs] Move apidoc command to Sphinx config
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.
2018-11-02 00:21:50 +00:00
Calum Lind 20431cc771 [Docs] Fix build errors getting Deluge version
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.
2018-11-01 23:18:05 +00:00
Calum Lind 82ecf8a416 [Docs] Reorganise and add sections from wiki
- 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.
2018-11-01 17:38:10 +00:00
Calum Lind 20fa106b8b Update pre-commit config
The prettier hook was missing a trailing slash so omitting css files.

Add a trailing space fix hook and fix issues.
2018-10-08 14:49:36 +01:00
Calum Lind 5743382c65 Remove Pipfile and pipenv
For now using requirements files and tox to setup a dev env so to
prevent confusion or stagnation of Pipfile remove it and pipenv
documentation.
2018-10-08 12:21:00 +01:00
Calum Lind a8a4fb69c0 [Lint] Exclude js and css from EOF fixer
- When running pre-commit on all files it is picking up minified js and
  css files. Since prettier will format correctly the source files ignore
  them in end-of-file fixer.
- The template files in web docs can be ignored too.
- Removed the unneeded `pre-commit-hooks` dependency as pre-commit
  resolves that itself.
- Include files fixed by pre-commit.
2018-10-05 18:45:37 +01:00
Calum Lind 36606fc448 [Docs] Add markdown support
- 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.
2018-10-04 15:53:42 +01:00
Calum Lind 358ff74d0e [Lint] Format files with Prettier
Use Prettier to auto-format javascript, CSS and YAML files so that less
manual work is involved and style is consistent across project.
2018-10-03 18:16:09 +01:00
Calum Lind b1cdc32f73 [Lint] Use Black to auto-format code
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.
2018-10-03 15:21:53 +01:00
Calum Lind 3fc97672de Fix the docs run failing on Travis
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.
2018-07-28 10:26:02 +01:00
Unknown 4fd51a4ef9 Skip Failing Tests On Windows 2018-06-02 22:09:50 +01:00
Calum Lind d642fa3989 Fix files to pass new Flake8 checkers
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.
2018-06-01 23:41:17 +01:00
Calum Lind bae1647e99 Add Pipenv Pipfile for development
Switching to Pipenv will speed up developement. See the docs for
details on using Pipenv.

 - Added more flake8 checks.
 - Added `detox` for running tests in parallel locally.
2018-06-01 23:41:17 +01:00
Calum Lind 66718f6d8e [Docs] Remove chardet mock to fix requests version check
* chardet is an easily installed pure python module so doesn't need mocking.
2017-06-05 08:10:13 +01:00
Calum Lind b69ba02652 [Core] Refactor default add torrent flags into a constant 2016-11-30 23:21:45 +00:00
Calum Lind 36cbfa8c61 [Lint] Fix files to pass Flake8 v3.2.0 2016-11-17 12:19:41 +00:00
Calum Lind 3a2ff0c188 [Lint] Convert all python double quotes to single quotes
* 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>`
2016-11-03 21:45:45 +00:00
bendikro 1e183a3258 [UI] Add gettext.ngettext to __builtin__.__dict__
Handle plurality with getttext using ngettext. Added to
__builtin__.__dict__ as _n
2016-10-30 12:45:02 +00:00
bendikro 5713ff09f4 [Docs] Autogenerate module docs with apidoc
* Add sphinx-apidoc to setup.py build_docs
2016-05-22 12:11:41 +01:00
Calum Lind df3a3c77eb Fix travis build version issue
* 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.
2015-08-26 00:27:32 +01:00
bendikro bb9702910b Update docs tests 2014-09-25 22:12:00 +01:00
Calum Lind b66f313c2d minor code cleanup 2014-09-25 15:56:05 +01:00
Calum Lind fedca3167d [Docs] More fixes for testing with tox 2014-09-25 15:20:15 +01:00
Calum Lind 6a5982f3ce Small fixes for Travis and isort 2014-09-25 14:25:03 +01:00
bendikro 66f2739be7 Added .travis.yml (for travis-ci) and tox.ini files
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.
2014-09-25 14:11:51 +01:00
Calum Lind 8dc9a0773c Fixes for building docs 2014-09-25 13:43:43 +01:00
Calum Lind 83262afda1 Flake8 codebase
Fixes error E265 and E714 that have been added to newest version of pep8
2014-09-22 12:46:18 +01:00
Calum Lind 6b7df9ca08 Add version fallback for sphinx build with readthedocs 2014-09-20 20:44:55 +01:00
Calum Lind a4edb0080b Fix for building sphinx docs 2014-09-20 18:43:09 +01:00
Calum Lind 30a0f3c9ed Flake8 pass of entire codebase
* Use the inline '# NOQA' to supress N802 lower-case warnings
2014-09-19 19:10:14 +01:00
Calum Lind 9290cc1f7a Fix building the code documentation with sphinx
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
2014-02-20 17:38:51 +00:00
Andrew Resch 66bd2e3030 Add sessionproxy.rst 2010-03-28 12:45:51 -07:00
Andrew Resch c8f2173a04 Use a hack to get the version instead of relying on pkg_resources. This allows the docs to be built without having to install deluge. 2010-03-24 15:36:28 -07:00
Andrew Resch 256ae0745c Update year 2010-03-24 14:29:17 -07:00
Andrew Resch 567a42b0ec Fix some docstrings 2009-08-13 05:02:39 +00:00
Andrew Resch bd5998ec05 Remove gtkui.rst for the time being 2009-08-12 07:17:21 +00:00
Andrew Resch 5376ae307a Add maketorrent.rst 2009-08-12 00:11:08 +00:00
Andrew Resch c0d0498f36 Add rst files for all the modules 2009-08-11 23:05:13 +00:00
Damien Churchill 0fa403929a update the docs for the ui common module 2009-07-23 00:42:38 +00:00
Damien Churchill 5f89f5239e add autodoc for ui.common
fix some docstrings in the json_api module
2009-07-23 00:24:07 +00:00
Damien Churchill 5ca119827b update documentation about the webui 2009-07-22 23:53:30 +00:00
Damien Churchill e5021cdbc8 remove the docs/build folder
revert the removal of the __rpcapi file for auto-generating the rpc api docs
2009-07-22 20:50:06 +00:00
Damien Churchill f1c192b996 just autodoc the Core and Daemon classes rather than use the RpcApi class 2009-07-22 20:23:16 +00:00
Damien Churchill 698d37f535 setup automatically generating the core's rpc api 2009-07-20 10:51:33 +00:00
Damien Churchill 3c74a8e4bf update the docs, creating a simple structure for user orientated documentation 2009-07-20 09:36:16 +00:00
Damien Churchill c62258fa48 move docs out of the deluge package 2009-07-20 09:02:09 +00:00