Commit Graph

238 Commits

Author SHA1 Message Date
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 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 c3a2c67b98 [Py3] A large set of fixes for tests to pass under Python 3
The usual minor fixes for unicode/bytes for library calls.

The minimum Twisted version is now 16 for Python 3 support so remove old
code and start replacing deprecated methods.

Raised the minimum TLS version to 1.2 for the web server.
2018-06-27 16:41:21 +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 12f7345d0c Use a constant for versions 2017-12-17 11:47:08 +00:00
Calum Lind 6837d83f5b Fix setup.py requiring gen_web_gettext 2017-06-27 15:11:19 +01:00
Calum Lind 0424543e36 Update author details 2017-06-25 19:22:13 +01:00
Calum Lind d0cb45808c Exclude test and plugin files from build dir 2017-06-25 19:22:13 +01:00
Calum Lind fd5833c1d8 Fix build failing on removed icon 2017-06-05 06:37:18 +01:00
Calum Lind 579f56b0bf [Lint] Fix triple-quoted to use double-quotes not single
* according to pep8 triple-quotes should use double-quote.
2017-06-05 00:01:07 +01:00
Calum Lind 8a0b7d970a [#2837] [WebUI] Create gettext.js when building 2017-03-22 12:55:17 +00:00
Calum Lind 4df88c0df3 [UI] Refactor appdata.xml code and markup translatable text 2017-02-23 19:02:32 +00:00
Matthias Mailänder 3529036f55 [UI] Add an appdata.xml file
For Linux software gallery integration.
2017-02-23 19:01:44 +00:00
Calum Lind 0160bb1c91 [Lint] Fix pylint warnings in setup.py 2017-01-26 12:48:52 +00:00
Calum Lind 283ad6137d Fix isfile() typo in setup.py 2017-01-09 18:02:28 +00:00
Calum Lind 9cefbc6e5d [Setup] Refactor BuildWebUI class 2016-11-28 18:59:25 +00:00
Calum Lind 14a5156e15 [Setup] Move package variables to top of file
- Refactor _data_files list so icons paths are auto-generated.
2016-11-28 18:58:45 +00:00
Calum Lind 259c9f11e6 [Setup] Rearrange order of some classes 2016-11-28 17:44:22 +00:00
Calum Lind fd1261ab65 [Setup] Create a CleanTranslations class 2016-11-28 17:44:20 +00:00
Calum Lind a924cb73b0 [Setup] Fix wording and syntax in descriptions 2016-11-28 13:00:24 +00:00
Calum Lind 3cbafec68d [Setup] Move deluge egg-info clean to Clean 2016-11-28 13:00:09 +00:00
Calum Lind 7468078b71 [Setup] Add a CleanDocs class 2016-11-28 12:58:34 +00:00
Calum Lind 5e1603317a Revert "Rename version.py to calc_version.py to fix buildd error"
This reverts commit 943a9ded00.
2016-11-26 19:35:53 +00:00
Calum Lind 943a9ded00 Rename version.py to calc_version.py to fix buildd error
- There is a version.py included with buildd that is conflicting
   with the deluge one. Rather than messing with sys.path it is
   simplest to rename version.py to calc_version.py
2016-11-26 17:51:07 +00:00
Calum Lind 04370b38ec Revert "[Setup] Fix buildd error with version.py import"
This reverts commit 3aff57600f.
2016-11-26 17:10:13 +00:00
Calum Lind 3aff57600f [Setup] Fix buildd error with version.py import
- The deb buildd command also has a version.py so need to use relative import
   to specify that we really mean deluge supplied version.py.
2016-11-26 16:36:31 +00:00
Calum Lind 36cbfa8c61 [Lint] Fix files to pass Flake8 v3.2.0 2016-11-17 12:19:41 +00:00
Calum Lind 2657cc3921 [Lint] Quote cleanup 2016-11-17 10:19:59 +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
Andrew Resch d579efa041 [Lint] Fix various pylint warnings and fixup code
* Use print function
 * Fix except as statements
 * Remove old twisted 8 code
 * Remove empty docstring
 * Refactor try statement to only contain the relevant import and
   disable pylint import msgs.
 * Use flake8 noqa and pylint comment and drop pyflakes workarounds.
2016-10-26 09:58:43 +01:00
Calum Lind 3a8ed2e9cb [Core] Change deprecated lt.version to lt.__version__ 2016-10-17 12:40:28 +01: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 0f43b564c9 [WebUI] Add WebUI build class to setup.py for minifing javascript 2016-05-19 15:22:45 +01:00
bendikro c3247396f7 [Stats] Fix to tests and deleted .test.py 2016-04-19 19:00:07 +02:00
bendikro 5edb923904 [Base] Split main.py into ui/ui_entry.py and core/daemon_entry.py 2016-04-18 09:36:20 +02:00
Jamie Lennox aa82efd4f1 [#1974] [UI] Decouple UI selection from core.
Add entry points into setup for each of the UIs and then use this
information to determine which client UI to run.

This ensures that custom UIs may be written and run without
the need to modifify deluge source code.
2016-04-17 13:51:40 +02:00
Calum Lind d280fa9fbd [Lint] Cleanup helper scripts to pass PyLint 2015-10-30 18:39:52 +00:00
Calum Lind 774157f9b6 Fix scalable icon path 2015-09-20 21:36:46 +01:00
Calum Lind 2c5025644c Fix data_files in setup.py 2015-09-20 18:39:20 +01:00
Calum Lind f834ff6ec5 [Packaging] Updates to osx scripts
* bundle_contents now appends 'Contents' without adding it twice.
 * Remove reference to non-existent gdk-pixbuf.loaders
 * Separate libtorrent in new module.
 * Update lib versions for bundle file.
2015-09-18 22:59:52 +01:00
Calum Lind 7532d4d333 Fix icon paths in setup 2015-09-13 22:50:53 +01:00
Calum Lind caf35bcdf4 [Packaging] Include WebUI debug files for dev versions
* Webui will try to use debug files if deluge version contains 'dev'.
 * Include webui debug files in sdist.
 * Use exclude_package_data to remove debug files in release versions.
2015-09-04 19:43:32 +01:00
Calum Lind 8345237dcc [Packaging] bbfreeze updates
* No need for data_files to be installed on windows
2015-08-27 11:27:49 +01:00
Calum Lind 7d679eb480 Updates to helper scripts
* Python 3 compatible
 * Consistent quote symbol
2015-08-25 15:43:55 +01:00
Calum Lind 0466c7144c [#1389] Fix data_files installed in wrong location 2015-08-24 23:46:12 +01:00
Calum Lind 1c3e14919f [Win32] Refactor bbreeze script
* In setup.py put web and deluged back into console_script as the gtkui hack in
bbfreeze is a windows only issue for popup cmd windows showing.
 * Altered the bbreeze script to find any deluge scripts in pythonpath.
 * Use setIcon now in bbfreeze and use icon from package.
 * Use version stamp from pywin32.
2015-08-24 15:35:25 +01:00
Calum Lind 7cc14baae3 Remove glade from package_data entry 2015-08-22 12:21:58 +01:00
bendikro 9d662bf059 [Tests] Fix code for isort 4.0.0 2015-08-14 16:45:23 +01:00