Merge lp:~abentley/juju-ci-tools/python-canary into lp:juju-ci-tools

Proposed by Aaron Bentley
Status: Work in progress
Proposed branch: lp:~abentley/juju-ci-tools/python-canary
Merge into: lp:juju-ci-tools
Diff against target: 56 lines (+12/-8)
2 files modified
Makefile (+10/-6)
juju-ci-tools-common (+2/-2)
To merge this branch: bzr merge lp:~abentley/juju-ci-tools/python-canary
Reviewer Review Type Date Requested Status
Juju Release Engineering Pending
Review via email: mp+286563@code.launchpad.net

Commit message

Use a canary to install python so that make test installs updated deps

Description of the change

This branch updates make test to autodetect python dependency changes.

It uses a canary to do this, and introduces a new python-deps target.

Every time one of the files the canary depends on changes, make test will rerun pipdeps.

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

I think this breaks "make test" on windows and the osx slave. I do run this command to be certain the scripts can run on those hosts. Can we the apt-calls for non-ubuntu?

Revision history for this message
Martin Packman (gz) wrote :

I think this is okay, because only python-deps happens for tests, and just the pip install should be cross-platform correct for windows and osx?

Revision history for this message
Aaron Bentley (abentley) wrote :

@martin As written, the python-deps starts by installing pip using apt, so it would break on Windows.

1284. By Aaron Bentley

Merged trunk into python-canary.

1285. By Aaron Bentley

Make pip one of the equivs packages.

Revision history for this message
Aaron Bentley (abentley) wrote :

> I think this breaks "make test" on windows and the osx slave. I do run this
> command to be certain the scripts can run on those hosts. Can we the apt-calls
> for non-ubuntu?

I've changed it so that pip is one of the packages installed by install-deps, instead of being handled separately. Basically, if you don't install-deps, you're responsible for installing pip.

This gives PYTHON_PACKAGE_CANARY a dependency on apt-deps, but this is an *ordering* dependency-- if make was going to run apt-deps anyhow, it runs it before PYTHON_PACKAGE_CANARY. But it won't run apt-deps unless another target (like install-deps) is required.

So:
  make install-deps:
    1. make apt-deps
    2. make python-deps

  make test
    1. make python-deps
    2. python -m unittest ...

I think this addresses the concern of unwanted apt operations on Windows and Mac and also fixes the problem that pip wasn't being handled the same way as other debian packages.

Does that work for you?

Revision history for this message
Aaron Bentley (abentley) wrote :

Turns out I didn't understand how ordering-only dependencies work. Sigh.

Unmerged revisions

1285. By Aaron Bentley

Make pip one of the equivs packages.

1284. By Aaron Bentley

Merged trunk into python-canary.

1283. By Aaron Bentley

Use a canary to install python so that make test installs updated deps

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.python-canary'
2=== modified file 'Makefile'
3--- Makefile 2015-12-11 20:38:31 +0000
4+++ Makefile 2016-02-24 15:03:51 +0000
5@@ -1,5 +1,5 @@
6 p=test*.py
7-test:
8+test: python-deps
9 TMPDIR=/tmp python -m unittest discover -vv ./tests -p "$(p)"
10 lint:
11 flake8 $$(find -name '*.py')
12@@ -10,15 +10,19 @@
13 find . -name '*.pyc' -delete
14 apt-update:
15 sudo apt-get -qq update
16-juju-ci-tools.common_0.1.0-0_all.deb: apt-update
17+juju-ci-tools.common_0.1.0-1_all.deb: apt-update
18 sudo apt-get install -y equivs
19 equivs-build juju-ci-tools-common
20-install-deps: juju-ci-tools.common_0.1.0-0_all.deb apt-update
21+PYTHON_PACKAGE_CANARY := .python-canary
22+$(PYTHON_PACKAGE_CANARY): requirements.txt pipdeps.py | apt-deps
23+ ./pipdeps.py install
24+ touch $(PYTHON_PACKAGE_CANARY)
25+python-deps: $(PYTHON_PACKAGE_CANARY)
26+install-deps: apt-deps python-deps
27+apt-deps: juju-ci-tools.common_0.1.0-1_all.deb apt-update
28 sudo dpkg -i juju-ci-tools.common_0.1.0-0_all.deb || true
29 sudo apt-get install -y -f
30 sudo apt-get install -y juju-local juju juju-quickstart juju-deployer
31- sudo apt-get install -y python-pip
32- ./pipdeps.py install
33 name=NAMEHERE
34 assess_file=assess_$(name).py
35 test_assess_file=tests/test_assess_$(name).py
36@@ -26,4 +30,4 @@
37 install -m 755 template_assess.py.tmpl $(assess_file)
38 install -m 644 template_test.py.tmpl $(test_assess_file)
39 sed -i -e "s/TEMPLATE/$(name)/g" $(assess_file) $(test_assess_file)
40-.PHONY: lint test cover clean new-assess apt-update install-deps
41+.PHONY: lint test cover clean new-assess apt-update install-deps python-deps apt-deps
42
43=== modified file 'juju-ci-tools-common'
44--- juju-ci-tools-common 2015-12-18 17:30:38 +0000
45+++ juju-ci-tools-common 2016-02-24 15:03:51 +0000
46@@ -3,8 +3,8 @@
47 Standards-Version: 3.9.2
48
49 Package: juju-ci-tools.common
50-Version: 0.1.0-0
51-Depends: s3cmd, euca2ools, uvtool-libvirt, uvtool, simplestreams, distro-info-data
52+Version: 0.1.0-1
53+Depends: s3cmd, euca2ools, uvtool-libvirt, uvtool, simplestreams, distro-info-data, python-pip
54 Architecture: all
55 Description: juju-ci-tools-common
56 A metapackage providing the dependencies for juju-reports

Subscribers

People subscribed via source and target branches