Merge lp:~lifeless/bzr-avahi/safesetup into lp:bzr-avahi

Proposed by Robert Collins
Status: Merged
Merged at revision: not available
Proposed branch: lp:~lifeless/bzr-avahi/safesetup
Merge into: lp:bzr-avahi
Diff against target: 92 lines (+44/-25)
3 files modified
__init__.py (+1/-7)
setup.py (+18/-18)
version.py (+25/-0)
To merge this branch: bzr merge lp:~lifeless/bzr-avahi/safesetup
Reviewer Review Type Date Requested Status
James Henstridge Needs Fixing
Review via email: mp+20329@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

Don't execute setup.py just because it was imported.

Revision history for this message
James Henstridge (jamesh) wrote :

As discussed on IRC, this patch doesn't stop setup.py from running setup().

review: Needs Fixing
lp:~lifeless/bzr-avahi/safesetup updated
37. By Robert Collins

Second take at setup guarding.

Revision history for this message
Robert Collins (lifeless) wrote :

On Mon, 2010-03-01 at 02:09 +0000, James Henstridge wrote:
> Review: Needs Fixing
> As discussed on IRC, this patch doesn't stop setup.py from running setup().

I pushed a newer one that does.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '__init__.py'
2--- __init__.py 2008-05-12 02:03:47 +0000
3+++ __init__.py 2010-03-01 05:24:14 +0000
4@@ -43,13 +43,7 @@
5 import browse
6 """)
7
8-version_info = (0, 3, 0, 'dev', 0)
9-
10-if version_info[3] == 'final':
11- version_string = '%d.%d.%d' % version_info[:3]
12-else:
13- version_string = '%d.%d.%d%s%d' % version_info
14-__version__ = version_string
15+from version import *
16
17
18 # Register hooks to advertise branches.
19
20=== modified file 'setup.py'
21--- setup.py 2008-02-13 10:52:18 +0000
22+++ setup.py 2010-03-01 05:24:14 +0000
23@@ -18,21 +18,21 @@
24 from distutils.core import setup
25 import os
26
27-# Get version number from this copy of bzr-avahi:
28-globals = {}
29-execfile(os.path.join(os.path.dirname(__file__), '__init__.py'), globals)
30-version = globals['__version__']
31-del globals
32-
33-setup(
34- name='bzr-avahi',
35- version=version,
36- maintainer='James Henstridge',
37- maintainer_email='james@jamesh.id.au',
38- description='Bazaar plugin to advertise and browse branches via mDNS',
39- license='GNU GPL',
40- url='https://launchpad.net/bzr-avahi',
41- packages=['bzrlib.plugins.avahi', 'bzrlib.plugins.avahi.tests'],
42- package_dir={'bzrlib.plugins.avahi': '.',
43- 'bzrlib.plugins.avahi.tests': 'tests'},
44-)
45+from version import *
46+
47+if __name__ == "__main__":
48+ # Get version number from this copy of bzr-avahi:
49+
50+ setup(
51+ name='bzr-avahi',
52+ version=version,
53+ maintainer='James Henstridge',
54+ maintainer_email='james@jamesh.id.au',
55+ description='Bazaar plugin to advertise and browse branches via mDNS',
56+ license='GNU GPL',
57+ url='https://launchpad.net/bzr-avahi',
58+ packages=['bzrlib.plugins.avahi', 'bzrlib.plugins.avahi.tests'],
59+ package_dir={'bzrlib.plugins.avahi': '.',
60+ 'bzrlib.plugins.avahi.tests': 'tests'},
61+ )
62+
63
64=== added file 'version.py'
65--- version.py 1970-01-01 00:00:00 +0000
66+++ version.py 2010-03-01 05:24:14 +0000
67@@ -0,0 +1,25 @@
68+# bzr-avahi - share and browse Bazaar branches with mDNS
69+# Copyright (C) 2007-2008 James Henstridge
70+#
71+# This program is free software; you can redistribute it and/or modify
72+# it under the terms of the GNU General Public License as published by
73+# the Free Software Foundation; either version 2 of the License, or
74+# (at your option) any later version.
75+#
76+# This program is distributed in the hope that it will be useful,
77+# but WITHOUT ANY WARRANTY; without even the implied warranty of
78+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
79+# GNU General Public License for more details.
80+#
81+# You should have received a copy of the GNU General Public License along
82+# with this program; if not, write to the Free Software Foundation, Inc.,
83+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
84+
85+__all__ = ['version_info', '__version__']
86+version_info = (0, 3, 0, 'dev', 0)
87+
88+if version_info[3] == 'final':
89+ version_string = '%d.%d.%d' % version_info[:3]
90+else:
91+ version_string = '%d.%d.%d%s%d' % version_info
92+__version__ = version_string

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: