[Packaging] Cleanup dependencies

- Tweaked the layout a bit with optional part of dependency description.
- Updated descriptions to help understand dependency usage.
- Made intltool and chardet packages optional. This will help with
  installation where these might be missing and are not crucial.
- Remove gettext from dependency as is part of Python.
This commit is contained in:
Calum Lind 2018-10-17 12:56:36 +01:00
parent 9f9827ca58
commit 85bbdfe143
3 changed files with 25 additions and 29 deletions

View File

@ -12,7 +12,7 @@ All modules will require the [common](#common) section dependencies.
## Build ## Build
- [setuptools] - [setuptools]
- [intltool] - Translation file tool - [intltool] - Optional: Desktop file translation for \*nix.
- [closure-compiler] - Minify javascript (alternative is [slimit]) - [closure-compiler] - Minify javascript (alternative is [slimit])
## Common ## Common
@ -20,37 +20,33 @@ All modules will require the [common](#common) section dependencies.
- [Twisted] _>= 16.6_ - Use `TLS` extras for `service_identity` and `idna`. - [Twisted] _>= 16.6_ - Use `TLS` extras for `service_identity` and `idna`.
- [OpenSSL] _>= 1.0.1_ - [OpenSSL] _>= 1.0.1_
- [pyOpenSSL] - [pyOpenSSL]
- [Chardet] - [PyXDG] - Access freedesktop.org standards for \*nix.
- [gettext] - [xdg-utils] - Provides xdg-open for \*nix.
- [PyXDG]
- [six] - [six]
- [zope.interface] - [zope.interface]
- [xdg-utils] - [chardet] - Optional: Encoding detection.
- [setproctitle] - Optional: Renaming processes.
#### Optional - [Pillow] - Optional: Enable `.ico` support.
- [rencode] _>= 1.0.2_ - Optional: Encoding library (Python port is bundled).
- [setproctitle] - Support correctly naming Deluge processes. - [dbus-python] - Optional: Show item location in filemanager.
- [Pillow] - Image library for `.ico` support.
- [rencode] _>= 1.0.2_ - Encoding library with Python port bundled.
- [dbus-python]
#### Windows OS #### Windows OS
- [pywin32] - [pywin32]
- [certifi] - [certifi]
- [py2-ipaddress] - Optional for Python 2 IPv6 lookup - [py2-ipaddress] - Optional: Add IPv6 lookup for Python 2.
## Core (deluged daemon) ## Core (deluged daemon)
- [libtorrent] _>= 1.1.1_ - [libtorrent] _>= 1.1.1_
- [GeoIP] - Optional (_Debian: `python-geoip`_) - [GeoIP] - Optional: IP address location lookup. (_Debian: `python-geoip`_)
## GTK UI ## GTK UI
- PyGTK - PyGTK
- [pycairo] - [pycairo]
- [librsvg] _>= 2_ - [librsvg] _>= 2_
- [python-appindicator] - Optional - [python-appindicator] - Optional: Ubuntu system tray icon.
#### MacOS #### MacOS
@ -64,10 +60,8 @@ All modules will require the [common](#common) section dependencies.
### Notifications ### Notifications
Optional dependencies for this plugin. - [pygame] - Optional: Play sounds
- [python-notify] - Optional: Desktop popups.
- [pygame] - Sound
- [python-notify] - Desktop popup
[python]: https://www.python.org/ [python]: https://www.python.org/
[setuptools]: https://setuptools.readthedocs.io/en/latest/ [setuptools]: https://setuptools.readthedocs.io/en/latest/
@ -87,7 +81,6 @@ Optional dependencies for this plugin.
[setproctitle]: https://pypi.org/project/setproctitle/ [setproctitle]: https://pypi.org/project/setproctitle/
[gtkosxapplication]: https://github.com/jralls/gtk-mac-integration [gtkosxapplication]: https://github.com/jralls/gtk-mac-integration
[chardet]: https://chardet.github.io/ [chardet]: https://chardet.github.io/
[gettext]: https://www.gnu.org/software/gettext/
[rencode]: https://github.com/aresch/rencode [rencode]: https://github.com/aresch/rencode
[pyxdg]: https://www.freedesktop.org/wiki/Software/pyxdg/ [pyxdg]: https://www.freedesktop.org/wiki/Software/pyxdg/
[six]: https://pythonhosted.org/six/ [six]: https://pythonhosted.org/six/

View File

@ -26,12 +26,16 @@ import sys
import tarfile import tarfile
import time import time
import chardet
import pkg_resources import pkg_resources
from deluge.decorators import deprecated from deluge.decorators import deprecated
from deluge.error import InvalidPathError from deluge.error import InvalidPathError
try:
import chardet
except ImportError:
chardet = None
try: try:
from urllib.parse import unquote_plus, urljoin from urllib.parse import unquote_plus, urljoin
from urllib.request import pathname2url from urllib.request import pathname2url
@ -983,12 +987,10 @@ def decode_bytes(byte_str, encoding='utf8'):
elif not isinstance(byte_str, bytes): elif not isinstance(byte_str, bytes):
return byte_str return byte_str
encodings = [ encodings = [lambda: ('utf8', 'strict'), lambda: ('iso-8859-1', 'strict')]
lambda: ('utf8', 'strict'), if chardet:
lambda: ('iso-8859-1', 'strict'), encodings.append(lambda: (chardet.detect(byte_str)['encoding'], 'strict'))
lambda: (chardet.detect(byte_str)['encoding'], 'strict'), encodings.append(lambda: (encoding, 'ignore'))
lambda: (encoding, 'ignore'),
]
if encoding.lower() not in ['utf8', 'utf-8']: if encoding.lower() not in ['utf8', 'utf-8']:
encodings.insert(0, lambda: (encoding, 'strict')) encodings.insert(0, lambda: (encoding, 'strict'))

View File

@ -19,6 +19,7 @@ from distutils import cmd
from distutils.command.build import build as _build from distutils.command.build import build as _build
from distutils.command.clean import clean as _clean from distutils.command.clean import clean as _clean
from distutils.command.install_data import install_data as _install_data from distutils.command.install_data import install_data as _install_data
from distutils.spawn import find_executable
from shutil import rmtree from shutil import rmtree
from setuptools import find_packages, setup from setuptools import find_packages, setup
@ -206,8 +207,8 @@ class BuildTranslations(cmd.Command):
else: else:
basedir = os.path.join(self.build_lib, 'deluge', 'i18n') basedir = os.path.join(self.build_lib, 'deluge', 'i18n')
if not windows_check(): intltool_merge = 'intltool-merge'
intltool_merge = 'intltool-merge' if not windows_check() and find_executable(intltool_merge):
intltool_merge_opts = '--utf8 --quiet' intltool_merge_opts = '--utf8 --quiet'
for data_file in (desktop_data, appdata_data): for data_file in (desktop_data, appdata_data):
# creates the translated file from .in file. # creates the translated file from .in file.