Merge lp:~coreygoldberg/autopilot/tox-and-packaging into lp:autopilot

Proposed by Corey Goldberg
Status: Merged
Approved by: Martin Pitt
Approved revision: 328
Merged at revision: 327
Proposed branch: lp:~coreygoldberg/autopilot/tox-and-packaging
Merge into: lp:autopilot
Diff against target: 95 lines (+24/-15)
6 files modified
.bzrignore (+3/-0)
MANIFEST.in (+2/-1)
bin/autopilot (+1/-4)
docs/faq/contribute.rst (+1/-1)
setup.py (+4/-9)
tox.ini (+13/-0)
To merge this branch: bzr merge lp:~coreygoldberg/autopilot/tox-and-packaging
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Thomi Richards (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+186034@code.launchpad.net

Commit message

add tox config and packaging fixes

Description of the change

this branch adds tox support and fixes some packaging issues.
The result is that you can now build/sdist/test against supported Python versions (2.7/3.3) by running 'tox' in the root dir of the source.

changes:

=== modified file '.bzrignore'

added more files to ignore list

=== modified file 'MANIFEST.in'

added sources to MANIFEST.in so they are included in package build.
lttng_module extension and debian changelog are both referenced in setup.py, and therefore need to exist.

=== modified file 'bin/autopilot'

script was using a non-Py3 compatible sorted().
changed from using cmp to a sort key.

=== modified file 'docs/faq/contribute.rst'

FAQ was using wrong path for autopilot script when running from source branch.

=== added file 'tox.ini'

config for python-tox

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

Thanks for the setup.py and the sorted() fixes!

18 +recursive-include debian changelog

Upstream releases generally shouldn't ship packaging information, so debian/ should not be included. But if you do it, why only debian/changelog? Most upstream projects these days don't ship a changelog as you can always get it from VCS, or they autogenerate it from "bzr log" or similar.

64 +commands =
65 + autopilot run autopilot.tests.unit

That runs only the unit tests; could we make this a bit more clever to run the full test suite if there's a $DISPLAY? When porting to py3 I found that a lot of issues only turn up with the integration tests.

review: Needs Fixing
Revision history for this message
Corey Goldberg (coreygoldberg) wrote :

>> 18 +recursive-include debian changelog

I included changelog here because it was already being referenced in setup.py:

try:
    from debian import changelog
    chl = changelog.Changelog(open('debian/changelog'))
    version = str(chl.get_version())
except ImportError:
    # If we don't have python-debian installed, guess a coarse-grained version
    # string
    version = '1.4.0'

so, it grabs version info from debian/changelog.

is there a better way to get version info in setup.py?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Martin Pitt (pitti) wrote :

debian/changelog also only has 1.4, so I think it's no worse to just stay at the "1.4.0" that's right in setup.py as a fallback.

328. By Corey Goldberg

removed debian changelog dependency from setup.py

Revision history for this message
Corey Goldberg (coreygoldberg) wrote :

I removed the changelog reference and hardcoded a constant in setup.py:

VERSION = '1.4.0'

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

LGTM

review: Approve
Revision history for this message
Martin Pitt (pitti) wrote :

LGTM2

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 2012-10-14 22:33:09 +0000
3+++ .bzrignore 2013-09-17 15:30:35 +0000
4@@ -1,1 +1,4 @@
5 build
6+dist
7+autopilot.egg-info
8+.tox
9
10=== modified file 'MANIFEST.in'
11--- MANIFEST.in 2012-05-17 03:09:40 +0000
12+++ MANIFEST.in 2013-09-17 15:30:35 +0000
13@@ -1,2 +1,3 @@
14 graft bin
15-graft build/sphinx/html
16+graft build/sphinx/html
17+recursive-include lttng_module *.c *.h
18
19=== modified file 'bin/autopilot'
20--- bin/autopilot 2013-09-08 17:25:37 +0000
21+++ bin/autopilot 2013-09-17 15:30:35 +0000
22@@ -56,10 +56,7 @@
23 if args.run_order:
24 test_list_fn = lambda: iterate_tests(test_suite)
25 else:
26- test_list_fn = lambda: sorted(
27- iterate_tests(test_suite),
28- lambda a, b: cmp(a.id(), b.id())
29- )
30+ test_list_fn = lambda: sorted(iterate_tests(test_suite), key=id)
31
32 if args.suites:
33 from collections import OrderedDict
34
35=== modified file 'docs/faq/contribute.rst'
36--- docs/faq/contribute.rst 2013-07-29 04:39:33 +0000
37+++ docs/faq/contribute.rst 2013-09-17 15:30:35 +0000
38@@ -65,7 +65,7 @@
39
40 $ bzr branch lp:autopilot ~/src/autopilot/trunk
41 $ cd ~/src/autopilot/trunk
42- $ autopilot list autopilot.tests
43+ $ ./bin/autopilot list autopilot.tests
44
45 Loading tests from: /home/example/src/autopilot/trunk
46
47
48=== modified file 'setup.py'
49--- setup.py 2013-08-20 05:43:12 +0000
50+++ setup.py 2013-09-17 15:30:35 +0000
51@@ -21,14 +21,9 @@
52
53 from setuptools import find_packages, setup, Extension
54
55-try:
56- from debian import changelog
57- chl = changelog.Changelog(open('debian/changelog'))
58- version = str(chl.get_version())
59-except ImportError:
60- # If we don't have python-debian installed, guess a coarse-grained version
61- # string
62- version = '1.4.0'
63+
64+VERSION = '1.4.0'
65+
66
67 autopilot_tracepoint = Extension(
68 'autopilot.tracepoint',
69@@ -39,7 +34,7 @@
70
71 setup(
72 name='autopilot',
73- version=version,
74+ version=VERSION,
75 description='Functional testing tool for Ubuntu.',
76 author='Thomi Richards',
77 author_email='thomi.richards@canonical.com',
78
79=== added file 'tox.ini'
80--- tox.ini 1970-01-01 00:00:00 +0000
81+++ tox.ini 2013-09-17 15:30:35 +0000
82@@ -0,0 +1,13 @@
83+# Tox (http://tox.testrun.org/) is a tool for running tests
84+# in multiple virtualenvs. This configuration file will run the
85+# test suite on all supported python versions. To use it, "pip install tox"
86+# and then run "tox" from this directory.
87+
88+
89+[tox]
90+envlist = py27, py33
91+
92+[testenv]
93+sitepackages = True
94+commands =
95+ autopilot run autopilot.tests.unit

Subscribers

People subscribed via source and target branches