annotate setup.py @ 3028:ab2696e34d29

Python 3 port: /!\ this is a huge commit /!\ starting from this commit, SàT is needs Python 3.6+ /!\ SàT maybe be instable or some feature may not work anymore, this will improve with time This patch port backend, bridge and frontends to Python 3. Roughly this has been done this way: - 2to3 tools has been applied (with python 3.7) - all references to python2 have been replaced with python3 (notably shebangs) - fixed files not handled by 2to3 (notably the shell script) - several manual fixes - fixed issues reported by Python 3 that where not handled in Python 2 - replaced "async" with "async_" when needed (it's a reserved word from Python 3.7) - replaced zope's "implements" with @implementer decorator - temporary hack to handle data pickled in database, as str or bytes may be returned, to be checked later - fixed hash comparison for password - removed some code which is not needed anymore with Python 3 - deactivated some code which needs to be checked (notably certificate validation) - tested with jp, fixed reported issues until some basic commands worked - ported Primitivus (after porting dependencies like urwid satext) - more manual fixes
author Goffi <goffi@goffi.org>
date Tue, 13 Aug 2019 19:08:41 +0200
parents c90a2586fdf9
children 25af53e2990a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2963
diff changeset
1 #!/usr/bin/env python3
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
3
2574
fbcdb761981c setup: use NAME to get version
Goffi <goffi@goffi.org>
parents: 2572
diff changeset
4 # SAT: an XMPP client
1766
d17772b0fe22 copyright update
Goffi <goffi@goffi.org>
parents: 1720
diff changeset
5 # Copyright (C) 2009-2016 Jérôme Poisson (goffi@goffi.org)
d17772b0fe22 copyright update
Goffi <goffi@goffi.org>
parents: 1720
diff changeset
6 # Copyright (C) 2013-2016 Adrien Cossa (souliane@mailoo.org)
238
83d2bc0abf2a version, README, CHANGELOG and INSTALL updates
Goffi <goffi@goffi.org>
parents: 237
diff changeset
7
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 607
diff changeset
8 # This program is free software: you can redistribute it and/or modify
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 607
diff changeset
9 # it under the terms of the GNU Affero General Public License as published by
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 607
diff changeset
10 # the Free Software Foundation, either version 3 of the License, or
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 607
diff changeset
11 # (at your option) any later version.
238
83d2bc0abf2a version, README, CHANGELOG and INSTALL updates
Goffi <goffi@goffi.org>
parents: 237
diff changeset
12
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 607
diff changeset
13 # This program is distributed in the hope that it will be useful,
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 607
diff changeset
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 607
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 607
diff changeset
16 # GNU Affero General Public License for more details.
238
83d2bc0abf2a version, README, CHANGELOG and INSTALL updates
Goffi <goffi@goffi.org>
parents: 237
diff changeset
17
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 607
diff changeset
18 # You should have received a copy of the GNU Affero General Public License
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 607
diff changeset
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
238
83d2bc0abf2a version, README, CHANGELOG and INSTALL updates
Goffi <goffi@goffi.org>
parents: 237
diff changeset
20
2562
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
21 from setuptools import setup, find_packages
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
22 import os
2562
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
23
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
24 NAME = 'sat'
1100
2be46f391cfa setup: SAT_INSTALL environment variable handles "clean" and "purge" options
souliane <souliane@mailoo.org>
parents: 1054
diff changeset
25
2562
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
26 install_requires = [
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
27 'babel',
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
28 'dbus-python',
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
29 'html2text',
2906
7dbdbd132649 template (i18n): activate ext.i18n.trimmed policy, to have clean translation strings. Set minimal jinja2 version to 2.10
Goffi <goffi@goffi.org>
parents: 2874
diff changeset
30 'jinja2>=2.10',
2562
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
31 'langid',
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
32 'lxml >= 3.1.0',
2874
da0193ae1c24 misc (setup): minimum markdown version is not 3.0
Goffi <goffi@goffi.org>
parents: 2857
diff changeset
33 'markdown >= 3.0',
2562
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
34 'miniupnpc',
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
35 'mutagen',
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
36 'netifaces',
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
37 'pillow',
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
38 'progressbar',
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
39 'pycrypto >= 2.6.1',
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
40 'pygments',
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
41 'pygobject',
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
42 'PyOpenSSL',
2611
c180ca699e72 install (setup): added python-dateutil as dependency (was already a dependency of Wokkel)
Goffi <goffi@goffi.org>
parents: 2576
diff changeset
43 'python-dateutil',
2562
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
44 'python-potr',
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
45 'pyxdg',
2962
b2c9b85372de install: updated minimal version for sat_tmp and urwid-satext
Goffi <goffi@goffi.org>
parents: 2906
diff changeset
46 'sat_tmp >= 0.7.0a4',
2562
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
47 'shortuuid',
2963
c90a2586fdf9 install: remove "service_identity" which is need by Twisted, and request "tls" extra for twisted
Goffi <goffi@goffi.org>
parents: 2962
diff changeset
48 'twisted[tls] >= 15.2.0',
2562
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
49 'urwid >= 1.2.0',
2962
b2c9b85372de install: updated minimal version for sat_tmp and urwid-satext
Goffi <goffi@goffi.org>
parents: 2906
diff changeset
50 'urwid-satext >= 0.7.0a2',
2562
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
51 'wokkel >= 0.7.1',
2857
88f10630d5ea plugin XEP-0384: removed version restriction, it is now compatible with (and require) last version of python-omemo (0.10.4)
Goffi <goffi@goffi.org>
parents: 2817
diff changeset
52 'omemo',
2738
eb58f26ed236 plugin XEP-0384: update to last python-omemo + trust management:
Goffi <goffi@goffi.org>
parents: 2679
diff changeset
53 'omemo_backend_signal',
2562
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
54 ]
1123
e89bd3a26c86 installation: setup.py update:
Goffi <goffi@goffi.org>
parents: 1115
diff changeset
55
1150
beaf8d4475e4 misc (D-Bus, installation): added a .service file for D-Bus auto-launch feature + installation from setup.py (path adaptation now use regex).
Goffi <goffi@goffi.org>
parents: 1138
diff changeset
56 DBUS_DIR = 'dbus-1/services'
2637
534b264d63df install: fixed DBUS_FILE path
Goffi <goffi@goffi.org>
parents: 2620
diff changeset
57 DBUS_FILE = 'misc/org.salutatoi.SAT.service'
2574
fbcdb761981c setup: use NAME to get version
Goffi <goffi@goffi.org>
parents: 2572
diff changeset
58 with open(os.path.join(NAME, 'VERSION')) as f:
2571
4aca060075b7 setup: version is now set in SAT/VERSION, sat is not imported anymore in setup
Goffi <goffi@goffi.org>
parents: 2567
diff changeset
59 VERSION = f.read().strip()
2572
7e7f4e344a96 setup: use scm version
Goffi <goffi@goffi.org>
parents: 2571
diff changeset
60 is_dev_version = VERSION.endswith('D')
7e7f4e344a96 setup: use scm version
Goffi <goffi@goffi.org>
parents: 2571
diff changeset
61
7e7f4e344a96 setup: use scm version
Goffi <goffi@goffi.org>
parents: 2571
diff changeset
62
7e7f4e344a96 setup: use scm version
Goffi <goffi@goffi.org>
parents: 2571
diff changeset
63 def sat_dev_version():
7e7f4e344a96 setup: use scm version
Goffi <goffi@goffi.org>
parents: 2571
diff changeset
64 """Use mercurial data to compute version"""
7e7f4e344a96 setup: use scm version
Goffi <goffi@goffi.org>
parents: 2571
diff changeset
65 def version_scheme(version):
2576
cb7bf936d8e8 setup, tools(utils): fixed versioning in setup and getRepositoryData
Goffi <goffi@goffi.org>
parents: 2574
diff changeset
66 return VERSION.replace('D', '.dev0')
2572
7e7f4e344a96 setup: use scm version
Goffi <goffi@goffi.org>
parents: 2571
diff changeset
67
7e7f4e344a96 setup: use scm version
Goffi <goffi@goffi.org>
parents: 2571
diff changeset
68 def local_scheme(version):
2576
cb7bf936d8e8 setup, tools(utils): fixed versioning in setup and getRepositoryData
Goffi <goffi@goffi.org>
parents: 2574
diff changeset
69 return "+{rev}.{distance}".format(
2572
7e7f4e344a96 setup: use scm version
Goffi <goffi@goffi.org>
parents: 2571
diff changeset
70 rev=version.node[1:],
7e7f4e344a96 setup: use scm version
Goffi <goffi@goffi.org>
parents: 2571
diff changeset
71 distance=version.distance)
7e7f4e344a96 setup: use scm version
Goffi <goffi@goffi.org>
parents: 2571
diff changeset
72
7e7f4e344a96 setup: use scm version
Goffi <goffi@goffi.org>
parents: 2571
diff changeset
73 return {'version_scheme': version_scheme,
7e7f4e344a96 setup: use scm version
Goffi <goffi@goffi.org>
parents: 2571
diff changeset
74 'local_scheme': local_scheme}
1150
beaf8d4475e4 misc (D-Bus, installation): added a .service file for D-Bus auto-launch feature + installation from setup.py (path adaptation now use regex).
Goffi <goffi@goffi.org>
parents: 1138
diff changeset
75
2565
ea106dfa2145 setup, constant: use https address in APP_URL, and keep pypi NAME separated from constants
Goffi <goffi@goffi.org>
parents: 2564
diff changeset
76
ea106dfa2145 setup, constant: use https address in APP_URL, and keep pypi NAME separated from constants
Goffi <goffi@goffi.org>
parents: 2564
diff changeset
77 setup(name=NAME,
2571
4aca060075b7 setup: version is now set in SAT/VERSION, sat is not imported anymore in setup
Goffi <goffi@goffi.org>
parents: 2567
diff changeset
78 version=VERSION,
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2963
diff changeset
79 description='Salut à Toi multipurpose and multi frontend XMPP client',
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2963
diff changeset
80 long_description='Salut à Toi (SàT) is a XMPP client based on a daemon/frontend '
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2963
diff changeset
81 'architecture. Its multi frontend (desktop, web, console '
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2963
diff changeset
82 'interface, CLI, etc) and multipurpose (instant messaging, '
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2963
diff changeset
83 'microblogging, games, file sharing, etc).',
1123
e89bd3a26c86 installation: setup.py update:
Goffi <goffi@goffi.org>
parents: 1115
diff changeset
84 author='Association « Salut à Toi »',
e89bd3a26c86 installation: setup.py update:
Goffi <goffi@goffi.org>
parents: 1115
diff changeset
85 author_email='contact@goffi.org',
2571
4aca060075b7 setup: version is now set in SAT/VERSION, sat is not imported anymore in setup
Goffi <goffi@goffi.org>
parents: 2567
diff changeset
86 url='https://salut-a-toi.org',
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
87 classifiers=['Development Status :: 3 - Alpha',
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
88 'Environment :: Console',
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
89 'Framework :: Twisted',
2620
72f6f37ab648 core: some more line limiting
Goffi <goffi@goffi.org>
parents: 2611
diff changeset
90 'License :: OSI Approved :: GNU Affero General Public License v3 '
72f6f37ab648 core: some more line limiting
Goffi <goffi@goffi.org>
parents: 2611
diff changeset
91 'or later (AGPLv3+)',
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
92 'Operating System :: POSIX :: Linux',
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
93 'Topic :: Communications :: Chat'],
2562
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
94 packages=find_packages() + ['twisted.plugins'],
2640
f93619e16ea0 install (setup.py): don't use sys.prefix for locales
Goffi <goffi@goffi.org>
parents: 2637
diff changeset
95 data_files=[('share/locale/fr/LC_MESSAGES',
2620
72f6f37ab648 core: some more line limiting
Goffi <goffi@goffi.org>
parents: 2611
diff changeset
96 ['i18n/fr/LC_MESSAGES/sat.mo']),
72f6f37ab648 core: some more line limiting
Goffi <goffi@goffi.org>
parents: 2611
diff changeset
97 (os.path.join('share/doc', NAME),
72f6f37ab648 core: some more line limiting
Goffi <goffi@goffi.org>
parents: 2611
diff changeset
98 ['CHANGELOG', 'COPYING', 'INSTALL', 'README', 'README4TRANSLATORS']),
2562
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
99 (os.path.join('share', DBUS_DIR), [DBUS_FILE]),
227
533507bb4e32 distutils wix installation
Goffi <goffi@goffi.org>
parents: 225
diff changeset
100 ],
2562
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
101 scripts=['sat_frontends/jp/jp', 'sat_frontends/primitivus/primitivus', 'bin/sat'],
230
b25cbec73c1e distutils: removes build and dist from manifest's prune
Goffi <goffi@goffi.org>
parents: 227
diff changeset
102 zip_safe=False,
2572
7e7f4e344a96 setup: use scm version
Goffi <goffi@goffi.org>
parents: 2571
diff changeset
103 setup_requires=['setuptools_scm'] if is_dev_version else [],
7e7f4e344a96 setup: use scm version
Goffi <goffi@goffi.org>
parents: 2571
diff changeset
104 use_scm_version=sat_dev_version if is_dev_version else False,
2562
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
105 install_requires=install_requires,
2571
4aca060075b7 setup: version is now set in SAT/VERSION, sat is not imported anymore in setup
Goffi <goffi@goffi.org>
parents: 2567
diff changeset
106 package_data={'sat': ['VERSION']},
2562
26edcf3a30eb core, setup: huge cleaning:
Goffi <goffi@goffi.org>
parents: 2454
diff changeset
107 python_requires='~=2.7',
1846
fdc1dfcee35e install: removed "nox" option as there is no more X dependency since WIX has been deprecated
Goffi <goffi@goffi.org>
parents: 1809
diff changeset
108 )