Mercurial > libervia-pubsub
annotate setup.py @ 419:794593086517
backend: publish-options implementation:
- removed some old code
- new ConstraintFailed exception
- publishing options implementation, following XEP-0060 §7.1.5
- first use of async/await syntax, used to simplify "publish" method
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 28 Dec 2019 19:56:47 +0100 |
parents | ee722faa3e93 |
children | 36c9fb677f1d |
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 | 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 | 7 |
264 | 8 # This program is free software: you can redistribute it and/or modify |
9 # it under the terms of the GNU Affero General Public License as published by | |
10 # the Free Software Foundation, either version 3 of the License, or | |
11 # (at your option) any later version. | |
233 | 12 |
264 | 13 # This program is distributed in the hope that it will be useful, |
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 # GNU Affero General Public License for more details. | |
233 | 17 |
264 | 18 # You should have received a copy of the GNU Affero General Public License |
19 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
233 | 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 | 23 |
405
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
24 NAME = 'sat_pubsub' |
264 | 25 |
193 | 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', |
406 | 29 'sat_tmp', |
405
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
30 'uuid', |
193 | 31 ] |
190
6e6c89eca9db
Make sure optional PostgreSQL connect parameters are passed as None, require
Ralph Meijer <ralphm@ik.nu>
parents:
189
diff
changeset
|
32 |
405
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
33 |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
34 with open(os.path.join(NAME, 'VERSION')) as f: |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
35 VERSION = f.read().strip() |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
36 is_dev_version = VERSION.endswith('D') |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
37 |
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 def sat_dev_version(): |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
40 """Use mercurial data to compute version""" |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
41 def version_scheme(version): |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
42 return VERSION.replace('D', '.dev0') |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
43 |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
44 def local_scheme(version): |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
45 return "+{rev}.{distance}".format( |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
46 rev=version.node[1:], |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
47 distance=version.distance) |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
48 |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
49 return {'version_scheme': version_scheme, |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
50 'local_scheme': local_scheme} |
c56a728412f1
file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents:
373
diff
changeset
|
51 |
190
6e6c89eca9db
Make sure optional PostgreSQL connect parameters are passed as None, require
Ralph Meijer <ralphm@ik.nu>
parents:
189
diff
changeset
|
52 |
416
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
53 setup( |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
54 name=NAME, |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
55 version=VERSION, |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
56 description="XMPP Publish-Subscribe Service Component, build for the need of " |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
57 "the « Salut à Toi » project", |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
58 author="Association « Salut à Toi »", |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
59 author_email="goffi@goffi.org", |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
60 url="https://salut-a-toi.org", |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
61 classifiers=[ |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
62 "Programming Language :: Python :: 3 :: Only", |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
63 "Programming Language :: Python :: 3.6", |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
64 "Programming Language :: Python :: 3.7", |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
65 "Development Status :: 5 - Production/Stable", |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
66 "Framework :: Twisted", |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
67 "License :: OSI Approved :: GNU Affero General Public License v3 " |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
68 "or later (AGPLv3+)", |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
69 "Operating System :: POSIX :: Linux", |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
70 "Topic :: Communications :: Chat" |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
71 ], |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
72 packages=find_packages() + ["twisted.plugins"], |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
73 data_files=[(os.path.join("share/doc", NAME), |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
74 ["CHANGELOG", "COPYING", "README"]), |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
75 ], |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
76 zip_safe=True, |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
77 setup_requires=["setuptools_scm"] if is_dev_version else [], |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
78 use_scm_version=sat_dev_version if is_dev_version else False, |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
79 install_requires=install_requires, |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
80 package_data={"sat_pubsub": ["VERSION"]}, |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
81 python_requires=">=3.6", |
ee722faa3e93
install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents:
414
diff
changeset
|
82 ) |