annotate setup.py @ 489:fa0d2a4783fa default tip

install: use PEP-440 compatible version in `setup`: setuptools from version v66 doesn't accept anymore non PEP-440 compatible version. This is a Q&D fix, move to `pyproject.toml` with proper versioning as for Libervia backend should be done sooner than later.
author Goffi <goffi@goffi.org>
date Fri, 12 Jan 2024 23:46:24 +0100
parents 9125a6e440c0
children
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',
439
36c9fb677f1d removed `sat_tmp.twisted` patches + update minimum Twisted version:
Goffi <goffi@goffi.org>
parents: 416
diff changeset
28 'twisted >= 20.3.0',
405
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
29 'psycopg2',
406
a58610ab2983 removed old code:
Goffi <goffi@goffi.org>
parents: 405
diff changeset
30 'sat_tmp',
405
c56a728412f1 file organisation + setup refactoring:
Goffi <goffi@goffi.org>
parents: 373
diff changeset
31 'uuid',
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
416
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
54 setup(
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
55 name=NAME,
489
fa0d2a4783fa install: use PEP-440 compatible version in `setup`:
Goffi <goffi@goffi.org>
parents: 477
diff changeset
56 version=VERSION.replace('D', '.dev0'),
416
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
57 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
58 "the « Salut à Toi » project",
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
59 author="Association « Salut à Toi »",
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
60 author_email="goffi@goffi.org",
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
61 url="https://salut-a-toi.org",
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
62 classifiers=[
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
63 "Programming Language :: Python :: 3 :: Only",
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
64 "Programming Language :: Python :: 3.6",
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
65 "Programming Language :: Python :: 3.7",
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
66 "Development Status :: 5 - Production/Stable",
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
67 "Framework :: Twisted",
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
68 "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
69 "or later (AGPLv3+)",
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
70 "Operating System :: POSIX :: Linux",
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
71 "Topic :: Communications :: Chat"
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
72 ],
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
73 packages=find_packages() + ["twisted.plugins"],
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
74 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
75 ["CHANGELOG", "COPYING", "README"]),
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
76 ],
477
9125a6e440c0 install (setup): installation is actually not zip safe:
Goffi <goffi@goffi.org>
parents: 439
diff changeset
77 zip_safe=False,
416
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
78 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
79 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
80 install_requires=install_requires,
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
81 package_data={"sat_pubsub": ["VERSION"]},
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
82 python_requires=">=3.6",
ee722faa3e93 install (setup.py): updated setup.py for Python 3
Goffi <goffi@goffi.org>
parents: 414
diff changeset
83 )