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
=== modified file '.bzrignore'
--- .bzrignore 2010-02-14 23:12:51 +0000
+++ .bzrignore 2010-07-07 20:34:40 +0000
@@ -1,2 +1,4 @@
1.*.swp1.*.swp
2tmp.diff2tmp.diff
3MANIFEST
4dist
35
=== added file 'HACKING'
--- HACKING 1970-01-01 00:00:00 +0000
+++ HACKING 2010-07-07 20:34:40 +0000
@@ -0,0 +1,11 @@
1HOWTO do a source tarball release:
2
3 * edit setup.py and increment the version number
4 * 'python setup.py sdist'
5 * look at the contents of the tarball created in dist/ and think a spell
6 * sign the tarball using a command like:
7 gpg -a --detach-sign hydrazine-0.2.tar.gz
8 this should create a file like hydrazine-0.2.tar.gz.asc
9 * Upload the new release to launchpad with a command like:
10 lp-upload-project hydrazine 0.2 hydrazine-0.2.tar.gz
11 * Announce the release, ping someone to build updated packages for the PPA
012
=== modified file 'TODO'
--- TODO 2010-02-15 01:00:35 +0000
+++ TODO 2010-07-07 20:34:40 +0000
@@ -16,3 +16,5 @@
16set tags, either incrementally or entirely16set tags, either incrementally or entirely
1717
18show dates on bug18show dates on bug
19
20finish 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.
1921
=== added file 'setup.py'
--- setup.py 1970-01-01 00:00:00 +0000
+++ setup.py 2010-07-07 20:34:40 +0000
@@ -0,0 +1,29 @@
1#!/usr/bin/python
2
3from distutils.core import setup
4from os.path import join, dirname
5
6description = file(join(dirname(__file__), 'README'), 'rb').read()
7
8setup(
9 name='hydrazine',
10 version='0.1',
11 url='https://launchpad.net/hydrazine',
12 author='Martin Pool',
13 author_email='mbp@canonical.com',
14 license='GPLv3',
15 description='A dern fine collection of CLI tools for Launchpad.',
16 long_description=description,
17 py_modules=[],
18 packages=['hydrazine'],
19 scripts=['bugclient', 'check-membership', 'scan-merge-proposals',
20 'capture-bug-counts', 'feed-pqm', 'lp-attach'],
21 classifiers = [
22 'Development Status :: 4 - Beta',
23 'Intended Audience :: Developers',
24 'License :: OSI Approved :: GNU General Public License v3 (GPL3)',
25 'Operating System :: OS Independent',
26 'Programming Language :: Python',
27 'Topic :: Software Development',
28 ],
29 )

Subscribers

People subscribed via source and target branches

to all changes: