Merge lp:~rockstar/tarmac/die-makefile-die into lp:tarmac

Proposed by Paul Hummer
Status: Merged
Approved by: Paul Hummer
Approved revision: 393
Merged at revision: 388
Proposed branch: lp:~rockstar/tarmac/die-makefile-die
Merge into: lp:tarmac
Diff against target: 117 lines (+67/-29)
2 files modified
Makefile (+0/-28)
setup.py (+67/-1)
To merge this branch: bzr merge lp:~rockstar/tarmac/die-makefile-die
Reviewer Review Type Date Requested Status
dobey Approve
Paul Hummer Pending
Review via email: mp+49671@code.launchpad.net

Commit message

Kill the Makefile

Description of the change

I killed the Makefile. Rodney and I had already talked about it, and it didn't take too much effort for Rodney to convince me that we don't need it.

All the functionality has been ported over to distutils stuff, except for test-fail, which I couldn't find a use for anywhere.

To post a comment you must log in.
Revision history for this message
dobey (dobey) wrote :

The clean command needs to derive from the one provided by distutils and chain up to it. For a simple example, the ubuntuone-storage-protocol clean command does this:

http://bazaar.launchpad.net/~ubuntuone-control-tower/ubuntuone-storage-protocol/trunk/view/head:/setup.py#L57

review: Needs Fixing
lp:~rockstar/tarmac/die-makefile-die updated
393. By Paul Hummer

CleanCommand now DTRT

Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'Makefile'
--- Makefile 2010-07-20 06:46:47 +0000
+++ Makefile 1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
1TESTFLAGS=
2test:
3 trial $(TESTFLAGS) tarmac
4
5test-fail:
6 trial this-will-fail
7
8build:
9 mkdir build
10 mkdir build/docs
11
12build/docs/introduction.html: build docs/introduction.txt
13 rst2html docs/introduction.txt build/docs/introduction.html
14
15build/docs/writingplugins.html: build docs/writingplugins.txt
16 rst2html docs/writingplugins.txt build/docs/writingplugins.html
17
18doc: build/docs/introduction.html build/docs/writingplugins.html
19
20clean:
21 rm -rf build
22
23release:
24 python setup.py sdist
25 cd dist
26 gpg --armor --sign --detach-sig `find . -name "tarmac-*"`
27
28.PHONY: test test-fail
290
=== modified file 'setup.py'
--- setup.py 2010-08-17 17:08:07 +0000
+++ setup.py 2011-02-14 17:46:28 +0000
@@ -17,13 +17,79 @@
17# along with Tarmac. If not, see <http://www.gnu.org/licenses/>.17# along with Tarmac. If not, see <http://www.gnu.org/licenses/>.
18'''Tarmac installation script.'''18'''Tarmac installation script.'''
1919
20from distutils.core import setup20from distutils.command import clean
21from distutils.core import Command, setup
22import os
2123
22from tarmac import __version__24from tarmac import __version__
2325
26
27class BaseCommand(Command):
28 '''A base command...'''
29
30 user_options = []
31
32 def initialize_options(self):
33 self.cwd = None
34
35 def finalize_options(self):
36 self.cwd = os.getcwd()
37
38
39class CleanCommand(clean.clean):
40 '''Customized command for clean.'''
41
42 description = 'Customized clean command'
43
44 def run(self):
45 os.system('rm -rf build _trial_temp dist')
46
47 super(CleanCommand, self).run()
48
49
50class DocCommand(BaseCommand):
51 '''Command for building the docs.'''
52
53 description = 'Build the docs'
54
55 def run(self):
56 if not os.path.exists('build/docs'):
57 os.makedirs('build/docs')
58 os.system(
59 'rst2html docs/introduction.txt build/docs/introduction.html')
60 os.system(
61 'rst2html docs/writingplugins.txt build/docs/writingplugins.html')
62
63
64class ReleaseCommand(BaseCommand):
65 '''A command for cutting releases.'''
66
67 description = 'Cut a release'
68
69 def run(self):
70 os.system('python setup.py sdist')
71 os.system(
72 'gpg --armor --sign --detach-sig `find dist -name "tarmac-*"`')
73
74
75class TestCommand(BaseCommand):
76 '''A Command for running the tests.'''
77
78 description = 'Run the tests'
79
80 def run(self):
81 os.system('trial tarmac')
82
83
24setup(84setup(
25 author='Paul Hummer',85 author='Paul Hummer',
26 author_email='Paul Hummer <paul@eventuallyanyway.com',86 author_email='Paul Hummer <paul@eventuallyanyway.com',
87 cmdclass={
88 'clean': CleanCommand,
89 'docs': DocCommand,
90 'release': ReleaseCommand,
91 'test': TestCommand
92 },
27 name=u'tarmac',93 name=u'tarmac',
28 version=__version__,94 version=__version__,
29 description=u'Tarmac - The Launchpad Lander',95 description=u'Tarmac - The Launchpad Lander',

Subscribers

People subscribed via source and target branches