Merge lp:~statik/hydrazine/add-setup into lp:hydrazine

Proposed by Elliot Murphy
Status: Merged
Merged at revision: 74
Proposed branch: lp:~statik/hydrazine/add-setup
Merge into: lp:hydrazine
Diff against target: 68 lines (+44/-0)
4 files modified
.bzrignore (+2/-0)
HACKING (+11/-0)
TODO (+2/-0)
setup.py (+29/-0)
To merge this branch: bzr merge lp:~statik/hydrazine/add-setup
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+29421@code.launchpad.net

Description of the change

This adds a setup.py for generating source tarball releases to enable packaging for Ubuntu.
It also adds some notes about how to do releases to make it easy for weary release managers to DTRT.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Elliot Murphy wrote:
> Elliot Murphy has proposed merging lp:~statik/hydrazine/add-setup into lp:hydrazine.
>
> Requested reviews:
> hydrazine-core (hydrazine-core)
>
>
> This adds a setup.py for generating source tarball releases to enable packaging for Ubuntu.
> It also adds some notes about how to do releases to make it easy for weary release managers to DTRT.
>

Just a comment. I think it would be better to put __version__ into
hydrazine/__init__.py and then update it from there. And in setup you
can do:

  import hydrazine
  ...
    version=hydrazine.__version__,

That way you get the version in the python runtime as well, and they
stay in sync. Also note that a fairly common design is to use:

 version_info = (0, 1, 0, 'dev', 0) # 5-tuple version using integers
 __version__ = '.'.join(map(str, version_info))

bzr uses a slightly more complex tuple => string conversion, but the
tuple can be useful for not needing to parse a semi-arbitrary string.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkw08lgACgkQJdeBCYSNAAMGXgCggdi3yWZWW9D1E4lyfai4YUXf
kDIAoNHW+qjECkGEy35MlJcZz3QyEFl+
=UAIu
-----END PGP SIGNATURE-----

Revision history for this message
Elliot Murphy (statik) wrote :

I especially appreciate that you included sample code in your review, that makes it much easier to get my head around. However, this seems like YAGNI to me. I added the setup.py because it was the shortest path to a functioning and correct ubuntu package. Exposing a 5-tuple version number to python code is not needed by any of the current code or the packaging. Of course, I'm just driving by here, so maybe exposing rich API versioning is perfectly in line with the goals for hydrazine, but I'd prefer not to include it in this branch, and wait until some code actually needs to check versions and make decisions based on them.

Revision history for this message
Martin Pool (mbp) wrote :

Thanks very much Elliot, I've drafted you in to <https://edge.launchpad.net/~hydrazine-core> so if you like you can create a PPA there and upload the package. You can also land this yourself.

We should probably put the packaging into a separate branch rather than turning this into a native package.

I think John has a point that it's useful for the binaries to be able to answer 'lp-attach --version', even if you don't expect to do API versioning. But this is certainly a step forward and we could add that later.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2010-02-14 23:12:51 +0000
3+++ .bzrignore 2010-07-07 20:34:40 +0000
4@@ -1,2 +1,4 @@
5 .*.swp
6 tmp.diff
7+MANIFEST
8+dist
9
10=== added file 'HACKING'
11--- HACKING 1970-01-01 00:00:00 +0000
12+++ HACKING 2010-07-07 20:34:40 +0000
13@@ -0,0 +1,11 @@
14+HOWTO do a source tarball release:
15+
16+ * edit setup.py and increment the version number
17+ * 'python setup.py sdist'
18+ * look at the contents of the tarball created in dist/ and think a spell
19+ * sign the tarball using a command like:
20+ gpg -a --detach-sign hydrazine-0.2.tar.gz
21+ this should create a file like hydrazine-0.2.tar.gz.asc
22+ * Upload the new release to launchpad with a command like:
23+ lp-upload-project hydrazine 0.2 hydrazine-0.2.tar.gz
24+ * Announce the release, ping someone to build updated packages for the PPA
25
26=== modified file 'TODO'
27--- TODO 2010-02-15 01:00:35 +0000
28+++ TODO 2010-07-07 20:34:40 +0000
29@@ -16,3 +16,5 @@
30 set tags, either incrementally or entirely
31
32 show dates on bug
33+
34+finish writing man pages for each tool included in the ubuntu package. for extra credit make the man page content and the help text printed by each tool DRY.
35
36=== added file 'setup.py'
37--- setup.py 1970-01-01 00:00:00 +0000
38+++ setup.py 2010-07-07 20:34:40 +0000
39@@ -0,0 +1,29 @@
40+#!/usr/bin/python
41+
42+from distutils.core import setup
43+from os.path import join, dirname
44+
45+description = file(join(dirname(__file__), 'README'), 'rb').read()
46+
47+setup(
48+ name='hydrazine',
49+ version='0.1',
50+ url='https://launchpad.net/hydrazine',
51+ author='Martin Pool',
52+ author_email='mbp@canonical.com',
53+ license='GPLv3',
54+ description='A dern fine collection of CLI tools for Launchpad.',
55+ long_description=description,
56+ py_modules=[],
57+ packages=['hydrazine'],
58+ scripts=['bugclient', 'check-membership', 'scan-merge-proposals',
59+ 'capture-bug-counts', 'feed-pqm', 'lp-attach'],
60+ classifiers = [
61+ 'Development Status :: 4 - Beta',
62+ 'Intended Audience :: Developers',
63+ 'License :: OSI Approved :: GNU General Public License v3 (GPL3)',
64+ 'Operating System :: OS Independent',
65+ 'Programming Language :: Python',
66+ 'Topic :: Software Development',
67+ ],
68+ )

Subscribers

People subscribed via source and target branches

to all changes: