annotate setup.py @ 853:c2f6ada7858f

core (sqlite): automatic database update: - new Updater class check database consistency (by calculating a hash on the .schema), and updates base if necessary - database now has a version (1 for current, 0 will be for 0.3's database), for each change this version will be increased - creation statements and update statements are in the form of dict of dict with tuples. There is a help text at the top of the module to explain how it works - if we are on a development version, the updater try to update the database automaticaly (without deleting table or columns). The Updater.generateUpdateData method can be used to ease the creation of update data (i.e. the dictionary at the top, see the one for the key 1 for an example). - if there is an inconsistency, an exception is raised, and a message indicate the SQL statements that should fix the situation. - well... this is rather complicated, a KISS method would maybe have been better. The future will say if we need to simplify it :-/ - new DatabaseError exception
author Goffi <goffi@goffi.org>
date Sun, 23 Feb 2014 23:30:32 +0100
parents d40306d1da70
children 12cfa23c6ab9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
1 #!/usr/bin/env python
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
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 607
diff changeset
4 # SAT: a jabber client
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 607
diff changeset
5 # Copyright (C) 2009, 2010, 2011 Jérôme Poisson (goffi@goffi.org)
238
83d2bc0abf2a version, README, CHANGELOG and INSTALL updates
Goffi <goffi@goffi.org>
parents: 237
diff changeset
6
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 607
diff changeset
7 # 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
8 # 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
9 # 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
10 # (at your option) any later version.
238
83d2bc0abf2a version, README, CHANGELOG and INSTALL updates
Goffi <goffi@goffi.org>
parents: 237
diff changeset
11
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 607
diff changeset
12 # 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
13 # 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
14 # 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
15 # GNU Affero General Public License for more details.
238
83d2bc0abf2a version, README, CHANGELOG and INSTALL updates
Goffi <goffi@goffi.org>
parents: 237
diff changeset
16
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 607
diff changeset
17 # 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
18 # 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
19
230
b25cbec73c1e distutils: removes build and dist from manifest's prune
Goffi <goffi@goffi.org>
parents: 227
diff changeset
20 from distribute_setup import use_setuptools
b25cbec73c1e distutils: removes build and dist from manifest's prune
Goffi <goffi@goffi.org>
parents: 227
diff changeset
21 use_setuptools()
b25cbec73c1e distutils: removes build and dist from manifest's prune
Goffi <goffi@goffi.org>
parents: 227
diff changeset
22 from setuptools.command.install import install
b25cbec73c1e distutils: removes build and dist from manifest's prune
Goffi <goffi@goffi.org>
parents: 227
diff changeset
23 from setuptools import setup
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
24 from distutils.file_util import copy_file
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
25 import os
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
26 import sys
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
27 import subprocess
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
28 from stat import ST_MODE
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
29
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
30 NAME = 'sat'
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
31 LAUNCH_DAEMON_COMMAND = 'sat'
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
32
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
33
232
0cd5b3c4513f Distutils: added custom wokkel checking/building
Goffi <goffi@goffi.org>
parents: 230
diff changeset
34 class MercurialException(Exception):
0cd5b3c4513f Distutils: added custom wokkel checking/building
Goffi <goffi@goffi.org>
parents: 230
diff changeset
35 pass
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
36
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
37
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
38 def module_installed(module_name):
547
8b5e142354ca installation: added wokkel to dependencies, and removed custom wokkel installation in setup.py (muc branch is now merged mainstream)
Goffi <goffi@goffi.org>
parents: 480
diff changeset
39 """Try to import module_name, and return False if it failed
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
40 @param module_name: name of the module to test
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
41 @return: True if successful"""
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
42 try:
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
43 __import__(module_name)
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
44 except ImportError:
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
45 return False
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
46 return True
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
47
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
48
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
49 class CustomInstall(install):
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
50
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
51 def custom_auto_options(self):
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
52 """Change options for twistd in the shell script
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
53 Mainly change the paths"""
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
54 sh_buffer = ""
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
55 run_dir = os.path.dirname(self.sh_script_path)
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
56 with open(self.sh_script_path, 'r') as sh_file:
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
57 for ori_line in sh_file:
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
58 if ori_line.startswith('DAEMON='):
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
59 dest_line = 'DAEMON=""\n' # we want to launch sat as a daemon
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
60 elif ori_line.startswith('TAP_PATH='):
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
61 dest_line = 'TAP_PATH="%s/"\n' % run_dir
473
a11cde0cdf5b misc: Make the shell launcher use the same python interpreter than setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 472
diff changeset
62 elif ori_line.startswith('PYTHON='):
a11cde0cdf5b misc: Make the shell launcher use the same python interpreter than setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 472
diff changeset
63 dest_line = 'PYTHON="%s"\n' % sys.executable
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
64 else:
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
65 dest_line = ori_line
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
66 sh_buffer += dest_line
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
67
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
68 with open(self.sh_script_path, 'w') as sh_file:
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
69 sh_file.write(sh_buffer)
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
70
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
71 def custom_create_links(self):
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
72 """Create symbolic links to executables"""
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
73 # the script which launch the daemon
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
74 links = [(self.sh_script_path, LAUNCH_DAEMON_COMMAND)]
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
75 for source, dest in links:
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
76 dest_name, copied = copy_file(source, os.path.join(self.install_scripts, dest), link='sym')
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
77 assert (copied)
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
78 # we change the perm in the same way as in the original install_scripts
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
79 mode = ((os.stat(dest_name)[ST_MODE]) | 0555) & 07777
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
80 os.chmod(dest_name, mode)
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
81
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
82 def run(self):
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
83 install.run(self)
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
84 sys.stdout.write('running post installation stuff\n')
349
3ec237e82aed setup.py update:
Goffi <goffi@goffi.org>
parents: 335
diff changeset
85 sys.stdout.flush()
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
86 self.sh_script_path = os.path.join(self.install_lib, 'sat', 'sat.sh')
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
87 self.primitivus_path = os.path.join(self.install_lib, 'sat_frontends', 'primitivus')
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
88 self.custom_auto_options()
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
89 self.custom_create_links()
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
90
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
91
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
92 def preinstall_check():
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
93 """Check presence of problematic dependencies, and try to install them with package manager
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
94 This ugly stuff is necessary as distributions are not installed correctly with setuptools/distribute
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
95 Hope to remove this at some point"""
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
96
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
97 #modules_tocheck = ['twisted', 'twisted.words', 'twisted.web', 'wx', 'urwid']
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
98 modules_tocheck = ['wx', 'gobject'] # XXX: wx is the only one to be really difficult to install, python-gobject is not up-to-date in PyPi
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
99
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
100 package = {'twisted': 'python-twisted-core',
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
101 'twisted.words': 'python-twisted-words',
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
102 'twisted.web': 'python-twisted-web',
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
103 'wx': 'python-wxgtk2.8',
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
104 'urwid': 'python-urwid',
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
105 'gobject': 'python-gobject',
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
106 'mercurial': 'mercurial'} # this dict map dependencies to packages names for debian distributions
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
107
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
108 sys.stdout.write("Running pre-installation dependencies check\n")
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
109
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
110 # which modules are not installed ?
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
111 modules_toinstall = [mod for mod in modules_tocheck if not module_installed(mod)]
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
112 """# is mercurial available ?
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
113 hg_installed = subprocess.call('which hg', stdout=open('/dev/null', 'w'), shell=True) == 0
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
114 if not hg_installed:
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
115 modules_toinstall.append('mercurial')""" # hg can be installed from pypi
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
116
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
117 if modules_toinstall:
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
118 # are we on a distribution using apt ?
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
119 apt_path = subprocess.Popen('which apt-get', stdout=subprocess.PIPE, shell=True).communicate()[0][:-1]
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
120 not_installed = set()
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
121 if apt_path:
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
122 # we have apt, we'll try to use it
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
123 for module_name in modules_toinstall:
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
124 package_name = package[module_name]
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
125 sys.stdout.write("Installing %s\n" % package_name)
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
126 success = subprocess.call('%s -qy install %s' % (apt_path, package_name), shell=True) == 0
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
127 if not success:
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
128 not_installed.add(module_name)
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
129 else:
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
130 not_installed = set(modules_toinstall)
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
131
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
132 if not_installed:
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
133 # some packages can't be automatically installed, we print their name for manual installation
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
134 sys.stdout.write("You should install the following dependencies with your distribution recommanded tool before installing %s:\n" % NAME)
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
135 for module_name in not_installed:
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
136 sys.stdout.write("- %s (Debian name: %s)\n" % (module_name, package[module_name]))
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
137 sys.exit(2)
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
138
235
7a2ef5fe4e8d distutils: added preinstall_check hack + some tuning while testing
Goffi <goffi@goffi.org>
parents: 233
diff changeset
139
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
140 if sys.argv[1].lower() in ['egg_info', 'install']:
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
141 # we only check dependencies if egg_info or install is used
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
142 install_opt = os.environ.get("SAT_INSTALL", "")
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
143 if not "nopreinstall" in install_opt: # user can force preinstall skipping
349
3ec237e82aed setup.py update:
Goffi <goffi@goffi.org>
parents: 335
diff changeset
144 preinstall_check()
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
145
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
146 setup(name=NAME,
581
78ca32cc0b51 CHANGELOG + version updates (yes, that's a release \o/)
Goffi <goffi@goffi.org>
parents: 580
diff changeset
147 version='0.3.0',
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
148 description=u'Salut à Toi multi-frontend XMPP client',
580
07d7c496ece9 misc: setup.py long description update
Goffi <goffi@goffi.org>
parents: 575
diff changeset
149 long_description=u'Salut à Toi (SàT) is a XMPP client based on a daemon/frontend architecture. Its multi-frontends (desktop, web, console interface, CLI, etc) and multi-purposes (instant messaging, microblogging, games, file sharing, etc).',
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
150 author='Goffi (Jérôme Poisson)',
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
151 author_email='goffi@goffi.org',
575
f5ab27e0ff4c installation: setup.py description + website url update
Goffi <goffi@goffi.org>
parents: 573
diff changeset
152 url='http://sat.goffi.org',
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
153 classifiers=['Development Status :: 3 - Alpha',
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
154 'Environment :: Console',
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
155 'Environment :: X11 Applications :: GTK',
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
156 'Framework :: Twisted',
480
2a072735e459 Licence modification: the full project is now under AGPL v3+ instead of GPL v3+
Goffi <goffi@goffi.org>
parents: 473
diff changeset
157 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
158 'Operating System :: POSIX :: Linux',
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
diff changeset
159 'Topic :: Communications :: Chat'],
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
160 package_dir={'sat': 'src', 'sat_frontends': 'frontends/src'},
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
161 packages=['sat', 'sat.tools', 'sat.bridge', 'sat.plugins', 'sat.test', 'sat.core', 'sat.memory',
848
d40306d1da70 misc: setup.py was not installing sat_frontends.jp
souliane <souliane@mailoo.org>
parents: 774
diff changeset
162 'sat_frontends', 'sat_frontends.bridge', 'sat_frontends.quick_frontend', 'sat_frontends.jp',
719
56aa0e98c92e frontends tools: moved src/tools/frontends to frontends/src/tools
souliane <souliane@mailoo.org>
parents: 664
diff changeset
163 'sat_frontends.primitivus', 'sat_frontends.wix', 'sat_frontends.tools'],
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
164 package_data={'sat': ['sat.tac', 'sat.sh'],
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
165 'sat_frontends': ['wix/COPYING']},
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
166 data_files=[(os.path.join(sys.prefix, 'share/locale/fr/LC_MESSAGES'), ['i18n/fr/LC_MESSAGES/sat.mo']),
227
533507bb4e32 distutils wix installation
Goffi <goffi@goffi.org>
parents: 225
diff changeset
167 ('share/doc/%s' % NAME, ['CHANGELOG', 'COPYING', 'INSTALL', 'README', 'README4TRANSLATORS']),
533507bb4e32 distutils wix installation
Goffi <goffi@goffi.org>
parents: 225
diff changeset
168 ],
533507bb4e32 distutils wix installation
Goffi <goffi@goffi.org>
parents: 225
diff changeset
169 scripts=['frontends/src/jp/jp', 'frontends/src/primitivus/primitivus', 'frontends/src/wix/wix'],
230
b25cbec73c1e distutils: removes build and dist from manifest's prune
Goffi <goffi@goffi.org>
parents: 227
diff changeset
170 zip_safe=False,
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
171 dependency_links=['http://www.blarg.net/%7Esteveha/pyfeed-0.7.4.tar.gz', 'http://www.blarg.net/%7Esteveha/xe-0.7.4.tar.gz'],
664
cac98ca76479 install: added lxml to setup.py dependencies
Goffi <goffi@goffi.org>
parents: 652
diff changeset
172 install_requires=['twisted', 'wokkel >= 0.7.1', 'progressbar', 'urwid >= 1.1.0', 'urwid-satext', 'pyfeed', 'xe', 'mutagen', 'PIL', 'lxml'],
586
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
173 cmdclass={'install': CustomInstall},
6a718ede8be1 Fix coding style in setup.py.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 581
diff changeset
174 ) # XXX: wxpython doesn't work, it's managed with preinstall_check