annotate setup.py @ 405:c56a728412f1

file organisation + setup refactoring: - `/src` has been renamed to `/sat_pubsub`, this is the recommended naming convention - revamped `setup.py` on the basis of SàT's `setup.py` - added a `VERSION` which is the unique place where version number will now be set - use same trick as in SàT to specify dev version (`D` at the end) - use setuptools_scm to retrieve Mercurial hash when in dev version
author Goffi <goffi@goffi.org>
date Fri, 16 Aug 2019 12:00:02 +0200
parents 26e46a3043e5
children a58610ab2983
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
405
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
1 #!/usr/bin/env python3
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
2 # -*- coding: utf-8 -*-
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 225
diff changeset
3
405
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
4 # SAT: an XMPP client
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
5 # Copyright (C) 2009-2016 Jérôme Poisson (goffi@goffi.org)
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
6 # Copyright (C) 2013-2016 Adrien Cossa (souliane@mailoo.org)
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 225
diff changeset
7
264
86e767dc6abb packaging for release
souliane <souliane@mailoo.org>
parents: 255
diff changeset
8 # This program is free software: you can redistribute it and/or modify
86e767dc6abb packaging for release
souliane <souliane@mailoo.org>
parents: 255
diff changeset
9 # it under the terms of the GNU Affero General Public License as published by
86e767dc6abb packaging for release
souliane <souliane@mailoo.org>
parents: 255
diff changeset
10 # the Free Software Foundation, either version 3 of the License, or
86e767dc6abb packaging for release
souliane <souliane@mailoo.org>
parents: 255
diff changeset
11 # (at your option) any later version.
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 225
diff changeset
12
264
86e767dc6abb packaging for release
souliane <souliane@mailoo.org>
parents: 255
diff changeset
13 # This program is distributed in the hope that it will be useful,
86e767dc6abb packaging for release
souliane <souliane@mailoo.org>
parents: 255
diff changeset
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
86e767dc6abb packaging for release
souliane <souliane@mailoo.org>
parents: 255
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
86e767dc6abb packaging for release
souliane <souliane@mailoo.org>
parents: 255
diff changeset
16 # GNU Affero General Public License for more details.
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 225
diff changeset
17
264
86e767dc6abb packaging for release
souliane <souliane@mailoo.org>
parents: 255
diff changeset
18 # You should have received a copy of the GNU Affero General Public License
86e767dc6abb packaging for release
souliane <souliane@mailoo.org>
parents: 255
diff changeset
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 225
diff changeset
20
405
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
21 from setuptools import setup, find_packages
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
22 import os
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 225
diff changeset
23
405
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
24 NAME = 'sat_pubsub'
264
86e767dc6abb packaging for release
souliane <souliane@mailoo.org>
parents: 255
diff changeset
25
193
8ab16e319bb8 Release Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents: 190
diff changeset
26 install_requires = [
254
d29e2360b05c minimum required wokkel version is now 0.7.1
Goffi <goffi@goffi.org>
parents: 239
diff changeset
27 'wokkel >= 0.7.1',
405
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
28 'psycopg2',
193
8ab16e319bb8 Release Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents: 190
diff changeset
29 'simplejson',
405
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
30 'uuid',
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
31 'sat_tmp',
193
8ab16e319bb8 Release Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents: 190
diff changeset
32 ]
190
6e6c89eca9db Make sure optional PostgreSQL connect parameters are passed as None, require
Ralph Meijer <ralphm@ik.nu>
parents: 189
diff changeset
33
405
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
34
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
35 with open(os.path.join(NAME, 'VERSION')) as f:
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
36 VERSION = f.read().strip()
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
37 is_dev_version = VERSION.endswith('D')
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
38
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
39
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
40 def sat_dev_version():
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
41 """Use mercurial data to compute version"""
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
42 def version_scheme(version):
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
43 return VERSION.replace('D', '.dev0')
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
44
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
45 def local_scheme(version):
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
46 return "+{rev}.{distance}".format(
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
47 rev=version.node[1:],
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
48 distance=version.distance)
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
49
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
50 return {'version_scheme': version_scheme,
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
51 'local_scheme': local_scheme}
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
52
190
6e6c89eca9db Make sure optional PostgreSQL connect parameters are passed as None, require
Ralph Meijer <ralphm@ik.nu>
parents: 189
diff changeset
53
405
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
54 setup(name=NAME,
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
55 version=VERSION,
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
56 description=u'XMPP Publish-Subscribe Service Component, build for the need of '
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
57 u'the « Salut à Toi » project',
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
58 author='Association « Salut à Toi »',
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
59 author_email='goffi@goffi.org',
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
60 url='https://salut-a-toi.org',
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
61 classifiers=['Development Status :: 5',
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
62 'Framework :: Twisted',
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
63 'License :: OSI Approved :: GNU Affero General Public License v3 '
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
64 'or later (AGPLv3+)',
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
65 'Operating System :: POSIX :: Linux',
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
66 'Topic :: Communications :: Chat'],
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
67 packages=find_packages() + ['twisted.plugins'],
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
68 data_files=[(os.path.join('share/doc', NAME),
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
69 ['CHANGELOG', 'COPYING', 'README']),
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
70 ],
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
71 zip_safe=True,
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
72 setup_requires=['setuptools_scm'] if is_dev_version else [],
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
73 use_scm_version=sat_dev_version if is_dev_version else False,
190
6e6c89eca9db Make sure optional PostgreSQL connect parameters are passed as None, require
Ralph Meijer <ralphm@ik.nu>
parents: 189
diff changeset
74 install_requires=install_requires,
405
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
75 package_data={'sat_pubsub': ['VERSION']},
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
76 python_requires='~=2.7',
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
77 )