Commit Graph

107 Commits

Author SHA1 Message Date
DjLegolas ec0bcc11f5
Upgrade codebase with pyupgrade (>=py3.6)
Added pyupgrade utility with manual stage to pre-commit and run on all
files.

Ref: https://github.com/asottile/pyupgrade
Closes: deluge-torrent/deluge#326
2021-12-29 21:51:07 +00:00
Calum Lind 16895b4a49
[Docs] Fix spinx-contrib-spelling build error
CI docs build was failing with the following error when using latest
sphinx-contrib-spelling 7.3.1

    error: option -j not recognized

Fixed by pinning to previous version.

GitHub-ref: https://github.com/sphinx-contrib/spelling/issues/142
2021-12-29 21:43:03 +00:00
DjLegolas 897955f0a1
Remove all Python 2 support
* Removed all __future__ imports from code
* Removed all six dependencies
* Removed all future_builtins imports
* Removed all Python 2 related code

Closes: deluge-torrent/deluge#325
2021-12-28 19:26:38 +00:00
Calum Lind cb588d0205
[Docs] Update release checklist page 2021-12-12 21:43:54 +00:00
Calum Lind c33c9082d9 [Docs] Add Flatpak install links 2021-12-12 18:39:41 +00:00
Calum Lind 62ae0f5ef6 [Docs] Update install guide
Rewrite install instructions to include more details on Deluge 2.0
install.

* Added other Linux distros
* Added stable PPA details
* Added link to forum for Windows and macOS community packages

Co-authored-by: Sergio M <sergio@example.com>
Co-authored-by: Ofry Linkovsky <15746116+OfryL@users.noreply.github.com>
Closes: deluge-torrent/deluge#296
Closes: deluge-torrent/deluge#310
2021-12-12 18:27:05 +00:00
Calum Lind 24aa48187e [Docs] Replace recommonmark with MyST parser
We used recommonmark so that we can use markdown in sphinx but it is
buggy and now so switch to better supported MyST-parser.

* Fixed incorrect heading warnings in markdown.
* Added sphinx toctree to markdown using directive as required by MyST.
* Upgraded Sphinx to 4.3

Ref: https://myst-parser.readthedocs.io
2021-12-12 18:16:21 +00:00
Calum Lind 1e6cc03946 [Lint] Fix spelling mistakes
A quick fix of some of the mistakes caught by codespell.
Updated readme with new IRC server

Useful to add it as part of linting checks.
2021-09-21 21:43:53 +01:00
Calum Lind 8fb25f71f3 [Install] Update and fix python optional requirements
* Added required dependency setuptools to install_requires
* Remove optional dependency ipaddress from install_requires
* Created extras_require in setup.py. The optional dependencies should
not be included in install_requires so that users can either install
forked dependencies or remove problematic ones. Updated documentation to
detail how to install these optional dependencies.
* Fixed README badge

Refs:
 * https://dev.deluge-torrent.org/ticket/3470
 * https://dev.deluge-torrent.org/ticket/3282
 * https://dev.deluge-torrent.org/ticket/3353
2021-07-31 22:08:23 +01:00
Calum Lind eb57412601 [Tests] Fix tox, pytest and travis issues
* Error occurring with Pytest 5.4 so pin to below that version.
 * Fix minor issues with Travis config.
 * Use full command-switches for pytest in tox config.
 * Remove pin for pip as issue with pip-wheel-metadata was fixed in 19.3
 * Remove tox-venv as causing issues of incompatible packages installed.
   The latest versions of the virtualenv package should handle these
   duties.
2020-04-12 17:37:42 +01:00
Calum Lind 20afc31f3c [Docs] Fix changlog symlink and markdown issue 2019-11-12 15:37:12 +00:00
t0obz 9232a52fd6 [Docs] Update dev environment instructions
I'm going through these instructions on a clean Ubuntu 19.04 VM

These are the changes I needed to make to get Deluge to build/run
2019-11-12 15:36:52 +00:00
Christopher Beard 00176ee2cd [Docs] Typo corrections in testing.md 2019-10-31 10:04:30 +00:00
DjLegolas 24b094a04a [WebUI] Handle torrent add failures
Closes #2253.
2019-06-21 09:09:12 +03:00
Calum Lind 3365201011 [Docs] Fixes for spelling
Running on Ubuntu Xenial results in spelling warnings so update wordlist.
2019-06-18 09:07:48 +01:00
Calum Lind c1ba403d4e [Docs] Add service how-tos 2019-06-18 09:07:48 +01:00
Calum Lind 8b62e50eb8 [Docs] Add spellchecking with pyenchant
- Use sphinxcontrib.spelling with custom wordlist.
- Skip the checking of the modules documents as they raise
false-positives.
- Add a setup.py spellcheck_docs command.
- Fix spelling and other issues.
- Add a doc favicon.
2019-06-15 21:06:27 +01:00
Calum Lind 5b315e90c5 [Docs] Cleanup updating plugin page 2019-06-15 21:01:04 +01:00
Calum Lind 7a54db3179 [Docs] Fix typo and url for Windows install 2019-06-12 14:56:21 +01:00
Calum Lind fc134cdffb [Docs] Add more info to release notes 2019-06-11 20:14:11 +01:00
Calum Lind 36cb4c5a4f [Docs] Updates to release checklist 2019-06-11 20:14:11 +01:00
Calum Lind 676bdb26e0 [Docs] Remove incomplete Windows install instructions
The instructions are in-progress and missing steps so instead point to
the issue ticket for now.
2019-06-11 12:35:04 +01:00
Trav Easton bdadd2b515 Fix typo in install instructions for macOS 2019-06-11 12:35:04 +01:00
Calum Lind 879a397215 [Packaging] Add updated launchd scripts
Copy from Trac UserGuide and updated with proper naming and deluge-web
version.

The bin location is default for brew with pip install.

Closes: #3073
2019-06-08 21:31:49 +01:00
Calum Lind 957cd5dd9c [Core] Fix SimpleNamespace on Python2 2019-06-08 21:31:49 +01:00
Calum Lind 25087d3f2d [Docs] Add release notes and update pages 2019-06-08 16:42:25 +01:00
Calum Lind 647baebcf0 [Docs] Update release checklist 2019-06-07 14:47:49 +01:00
Calum Lind d4185505d1 [Docs] Cleanup changelog and docs 2019-06-06 17:12:58 +01:00
Calum Lind 5e738cf73a Simplify the get_version method
Use post segment instead of dev for non-dev tags.
Default to 'deluge-' and '.dev0' to simplify getting version.
Refactor to use subprocess.check_output
Use deluge.common.get_version as fallback in docs conf.
2019-06-06 11:30:45 +01:00
Calum Lind bd4a3cba38 [Docs] Update install details and add more pages 2019-05-23 15:41:58 +01:00
Calum Lind 65f6ede8b2 [Docs] Updates and fixes to build on Python 3
- Updates to the sphinx conf
  - Applied Mock fixes to build on Python 3.
  - Group patches at bottom of conf file.
  - Use just a major.minor for version.
  - Specify Sphinx 2.0 version requirement.
- Move requirements.txt to docs dir.
- Add readthedocs config
- Fix docstring code block rst formatting issue.
2019-05-21 15:23:45 +01:00
Calum Lind 02e07dda2a [Docs] Fix recommonmark monkey patch and pin version
The refactored patch did not work so revert it.

A new release of recommonmark breaks the docs build so pin it to working version.
2019-03-29 14:27:18 +00:00
Calum Lind 27b4e2d891 [Docs] Fix formatting of exported docstrings 2018-11-16 15:06:30 +00:00
Calum Lind e7127637cf [Dependency] Remove bundled rencode 2018-11-02 08:47:57 +00:00
Calum Lind a01481b26f [Plugins] Update create script and add GTK3 how-to doc
- Updated create_plugin script to create a GTK3 plugin.
- Added a document for updating a 1.3 plugin to be compatible with
  2.0.
2018-11-02 08:47:57 +00:00
Calum Lind 3d24998577 [Docs] Fix duplicate description warnings 2018-11-02 08:47:57 +00:00
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
sam-xif 18541bce86 Fixed a minor grammatical error in the deluge console command documentation 2018-06-18 20:04:22 +01:00