annotate setup.py @ 161:98a485512289

installation: fixed version in setup.py
author Goffi <goffi@goffi.org>
date Sat, 28 Apr 2018 11:04:17 +0200
parents 9d3d700a65b7
children c63922860f80
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
127
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
1 #!/usr/bin/env python2
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
3
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # Cagou: a SàT frontend
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
5 # Copyright (C) 2009-2016 Jérôme Poisson (goffi@goffi.org)
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # Copyright (C) 2013-2016 Adrien Cossa (souliane@mailoo.org)
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
7
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
8 # This program is free software: you can redistribute it and/or modify
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # it under the terms of the GNU Affero General Public License as published by
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
10 # the Free Software Foundation, either version 3 of the License, or
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
11 # (at your option) any later version.
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
12
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
13 # This program is distributed in the hope that it will be useful,
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
16 # GNU Affero General Public License for more details.
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
17
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
18 # You should have received a copy of the GNU Affero General Public License
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
20
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
21 from setuptools import setup, find_packages
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
22 import os
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
23 import textwrap
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
24
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
25 NAME = 'cagou'
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
26
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
27 install_requires = [
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
28 'kivy',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
29 'pillow',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
30 'sat',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
31 ]
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
32
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
33 with open(os.path.join(NAME, 'VERSION')) as f:
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
34 VERSION = f.read().strip()
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
35 is_dev_version = VERSION.endswith('D')
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
36
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
37
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
38 def cagou_dev_version():
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
39 """Use mercurial data to compute version"""
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
40 def version_scheme(version):
161
98a485512289 installation: fixed version in setup.py
Goffi <goffi@goffi.org>
parents: 127
diff changeset
41 return VERSION.replace('D', '.dev0')
127
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
42
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
43 def local_scheme(version):
161
98a485512289 installation: fixed version in setup.py
Goffi <goffi@goffi.org>
parents: 127
diff changeset
44 return "+{rev}.{distance}".format(
127
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
45 rev=version.node[1:],
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
46 distance=version.distance)
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
47
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
48 return {'version_scheme': version_scheme,
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
49 'local_scheme': local_scheme}
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
50
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
51
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
52 setup(name=NAME,
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
53 version=VERSION,
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
54 description=u'Desktop/Android frontend for Salut à Toi XMPP client',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
55 long_description=textwrap.dedent("""\
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
56 Cagou is a desktop/Android frontend for Salut à Toi.
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
57 It provides native graphical interface with a modern user interface,
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
58 using touch screen abilitiy when available, and with split ability inspired from Blender
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
59 """),
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
60 author='Association « Salut à Toi »',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
61 author_email='contact@goffi.org',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
62 url='https://salut-a-toi.org',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
63 classifiers=['Development Status :: 3 - Alpha',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
64 'Programming Language :: Python :: 2.7',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
65 'Programming Language :: Python :: 2 :: Only',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
66 'Environment :: X11 Applications',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
67 'Framework :: Twisted',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
68 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
69 'Operating System :: POSIX :: Linux',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
70 'Operating System :: Android',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
71 'Topic :: Internet :: XMPP',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
72 'Topic :: Communications :: Chat',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
73 'Intended Audience :: End Users/Desktop',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
74 ],
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
75 packages=find_packages(),
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
76 scripts=['bin/cagou'],
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
77 zip_safe=False,
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
78 setup_requires=['setuptools_scm'] if is_dev_version else [],
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
79 use_scm_version=cagou_dev_version if is_dev_version else False,
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
80 install_requires=install_requires,
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
81 package_data={'cagou': ['VERSION']},
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
82 python_requires='~=2.7',
9d3d700a65b7 setup: proper setup.py:
Goffi <goffi@goffi.org>
parents:
diff changeset
83 )