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
=== added file '.python-canary'
=== modified file 'Makefile'
--- Makefile 2015-12-11 20:38:31 +0000
+++ Makefile 2016-02-24 15:03:51 +0000
@@ -1,5 +1,5 @@
1p=test*.py1p=test*.py
2test:2test: python-deps
3 TMPDIR=/tmp python -m unittest discover -vv ./tests -p "$(p)"3 TMPDIR=/tmp python -m unittest discover -vv ./tests -p "$(p)"
4lint:4lint:
5 flake8 $$(find -name '*.py')5 flake8 $$(find -name '*.py')
@@ -10,15 +10,19 @@
10 find . -name '*.pyc' -delete10 find . -name '*.pyc' -delete
11apt-update:11apt-update:
12 sudo apt-get -qq update12 sudo apt-get -qq update
13juju-ci-tools.common_0.1.0-0_all.deb: apt-update13juju-ci-tools.common_0.1.0-1_all.deb: apt-update
14 sudo apt-get install -y equivs14 sudo apt-get install -y equivs
15 equivs-build juju-ci-tools-common15 equivs-build juju-ci-tools-common
16install-deps: juju-ci-tools.common_0.1.0-0_all.deb apt-update16PYTHON_PACKAGE_CANARY := .python-canary
17$(PYTHON_PACKAGE_CANARY): requirements.txt pipdeps.py | apt-deps
18 ./pipdeps.py install
19 touch $(PYTHON_PACKAGE_CANARY)
20python-deps: $(PYTHON_PACKAGE_CANARY)
21install-deps: apt-deps python-deps
22apt-deps: juju-ci-tools.common_0.1.0-1_all.deb apt-update
17 sudo dpkg -i juju-ci-tools.common_0.1.0-0_all.deb || true23 sudo dpkg -i juju-ci-tools.common_0.1.0-0_all.deb || true
18 sudo apt-get install -y -f24 sudo apt-get install -y -f
19 sudo apt-get install -y juju-local juju juju-quickstart juju-deployer25 sudo apt-get install -y juju-local juju juju-quickstart juju-deployer
20 sudo apt-get install -y python-pip
21 ./pipdeps.py install
22name=NAMEHERE26name=NAMEHERE
23assess_file=assess_$(name).py27assess_file=assess_$(name).py
24test_assess_file=tests/test_assess_$(name).py28test_assess_file=tests/test_assess_$(name).py
@@ -26,4 +30,4 @@
26 install -m 755 template_assess.py.tmpl $(assess_file)30 install -m 755 template_assess.py.tmpl $(assess_file)
27 install -m 644 template_test.py.tmpl $(test_assess_file)31 install -m 644 template_test.py.tmpl $(test_assess_file)
28 sed -i -e "s/TEMPLATE/$(name)/g" $(assess_file) $(test_assess_file)32 sed -i -e "s/TEMPLATE/$(name)/g" $(assess_file) $(test_assess_file)
29.PHONY: lint test cover clean new-assess apt-update install-deps33.PHONY: lint test cover clean new-assess apt-update install-deps python-deps apt-deps
3034
=== modified file 'juju-ci-tools-common'
--- juju-ci-tools-common 2015-12-18 17:30:38 +0000
+++ juju-ci-tools-common 2016-02-24 15:03:51 +0000
@@ -3,8 +3,8 @@
3Standards-Version: 3.9.23Standards-Version: 3.9.2
44
5Package: juju-ci-tools.common5Package: juju-ci-tools.common
6Version: 0.1.0-06Version: 0.1.0-1
7Depends: s3cmd, euca2ools, uvtool-libvirt, uvtool, simplestreams, distro-info-data7Depends: s3cmd, euca2ools, uvtool-libvirt, uvtool, simplestreams, distro-info-data, python-pip
8Architecture: all8Architecture: all
9Description: juju-ci-tools-common9Description: juju-ci-tools-common
10 A metapackage providing the dependencies for juju-reports10 A metapackage providing the dependencies for juju-reports

Subscribers

People subscribed via source and target branches