← Back to team overview

cloud-init-dev team mailing list archive

[Merge] lp:~paelzer/cloud-init/fixup-test-dependencies into lp:cloud-init

 

ChristianEhrhardt has proposed merging lp:~paelzer/cloud-init/fixup-test-dependencies into lp:cloud-init.

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~paelzer/cloud-init/fixup-test-dependencies/+merge/294203

Maybe there was another way meant to install test dependencies, but what I found was only manually resolving failing tests via apt-get install of python modules.

The only thing close was a section in the makefile about pip dependency installs.
But these sections were broken, referring to not existing filenames having no py2/3 support and so on.

So I extended/fixed that section to now handle dependency installs for the user as I assume it was maent to.
-- 
Your team cloud init development team is requested to review the proposed merge of lp:~paelzer/cloud-init/fixup-test-dependencies into lp:cloud-init.
=== modified file 'HACKING.rst'
--- HACKING.rst	2014-08-26 18:53:44 +0000
+++ HACKING.rst	2016-05-10 09:12:45 +0000
@@ -19,6 +19,10 @@
 
   - ``bzr commit``
 
+* Ensure test dependencies are installed
+
+  - ``make pip-test-requirement``
+
 * Check pep8 and test, and address any issues:
 
   - ``make test pep8``

=== modified file 'Makefile'
--- Makefile	2016-03-04 06:45:58 +0000
+++ Makefile	2016-05-10 09:12:45 +0000
@@ -9,18 +9,25 @@
 CODE_VERSION=$(shell python -c "from cloudinit import version; print version.version_string()")
 
 PIP_INSTALL := pip install
+PIP3_INSTALL := pip3 install
 
 ifeq ($(PYVER),3)
   pyflakes = pyflakes3
   unittests = unittest3
+  requirements = pip-requirement3
+  test-requirements = pip-test-requirement3
   yaml = yaml
 else
 ifeq ($(PYVER),2)
   pyflakes = pyflakes
   unittests = unittest
+  requirements = pip-requirement
+  test-requirements = pip-test-requirement
 else
   pyflakes = pyflakes pyflakes3
   unittests = unittest unittest3
+  requirements = pip-requirement pip-requirement3
+  test-requirements = pip-test-requirement pip-test-requirement3
 endif
 endif
 
@@ -47,13 +54,33 @@
 unittest3: clean_pyc
 	nosetests3 $(noseopts) tests/unittests
 
-pip-requirements:
-	@echo "Installing cloud-init dependencies..."
-	$(PIP_INSTALL) -r "$@.txt" -q
-
-pip-test-requirements:
-	@echo "Installing cloud-init test dependencies..."
-	$(PIP_INSTALL) -r "$@.txt" -q
+pip-requirements: $(requirements)
+
+pip-test-requirements: $(test-requirements)
+
+pip-pre:
+	# avoid broken dependency https://github.com/pypa/pip/issues/1064
+	pip install -U setuptools
+
+pip3-pre:
+	# avoid broken dependency https://github.com/pypa/pip/issues/1064
+	pip3 install -U setuptools
+
+pip-requirement: pip-pre
+	@echo "Installing cloud-init dependencies..."
+	$(PIP_INSTALL) -r "pip-requirements.txt" -q
+
+pip-test-requirement: pip-pre
+	@echo "Installing cloud-init test dependencies..."
+	$(PIP_INSTALL) -r "pip-test-requirements.txt" -q
+
+pip-requirement3: pip3-pre
+	@echo "Installing cloud-init dependencies..."
+	$(PIP3_INSTALL) -r "pip-requirements.txt" -q
+
+pip-test-requirement3: pip3-pre
+	@echo "Installing cloud-init test dependencies..."
+	$(PIP3_INSTALL) -r "pip-test-requirements.txt" -q
 
 test: $(unittests)
 

=== renamed file 'requirements.txt' => 'pip-requirements.txt'
=== renamed file 'test-requirements.txt' => 'pip-test-requirements.txt'
--- test-requirements.txt	2015-02-10 20:32:32 +0000
+++ pip-test-requirements.txt	2016-05-10 09:12:45 +0000
@@ -1,3 +1,4 @@
+# see requirements.txt for some detail what packages are needed for
 httpretty>=0.7.1
 mock
 nose
@@ -5,3 +6,9 @@
 pyflakes
 contextlib2
 setuptools
+oauthlib
+jinja2
+prettytable
+jsonpatch
+configobj
+pyserial


Follow ups