Merge ~smoser/cloud-init:bug/package-build-no-stylechecks into cloud-init:master

Proposed by Scott Moser
Status: Merged
Merged at revision: 6b5369be71054a677b89fa8080f7ddd029ce4986
Proposed branch: ~smoser/cloud-init:bug/package-build-no-stylechecks
Merge into: cloud-init:master
Diff against target: 91 lines (+12/-18)
3 files modified
packages/debian/control.in (+0/-4)
test-requirements.txt (+0/-6)
tox.ini (+12/-8)
Reviewer Review Type Date Requested Status
Joshua Powers (community) Approve
Server Team CI bot continuous-integration Approve
cloud-init Commiters Pending
Review via email: mp+324541@code.launchpad.net

Commit message

tox/build: do not package depend on style requirements.

When the style/checking dependencies were updated in
test-requirements.txt, the debian package build dependencies created
by ./packages/bddeb were also updated. Pycodestyle was added to the list
in order to pin its version. That broke the package build for 16.04. The
reason for this is simply that python3-pycodestyle is not available in
16.04.

The change here is to remove style dependencies from test-requirements,
and add them to the tox environments directly. We had previously changed
the package build process to not run pep8 or flake8 simply to avoid having
to code to N different versions of style checkers (3bcb72c593f).

The link between package build and test-requirements still exists, though.
So future breakage can occur if any package is added to
test-requirements.txt (or requirements.txt) if the target distro release
does not have a python3-<packagename> in its archive.

There is also a bit of a tox.ini cleanup here, in that we do not have to
explictly list '-rrequirements.txt' as the setup.py pulls those in. And
lastly, we drop the -rtest-requirements.txt from the base 'testenv', and
add these test requirements only to environments that need to run test.

Finally, a change to packages/debian/control.in to drop the build
dependencies that were listed for style checking and also a dependency
on iproute2 which was a bad unit test that has been previously fixed.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Joshua Powers (powersj) wrote :

+1 passes CI, build test working again, all tox envs, except centos6, look good. Thanks for doing this.

The tox centos6 env, tested on centos 6 lxd, fail with the following, and I can get these cleaned up in a separate merge.

======================================================================
ERROR: Test read_user_data_callback() no files are found.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/cloud-init/tests/unittests/test_datasource/test_altcloud.py", line 422, in test_callback_none
    self.assertIsNone(dsac.read_user_data_callback(self.mount_dir))
AttributeError: 'TestReadUserDataCallback' object has no attribute 'assertIsNone'

======================================================================
FAIL: test_scripts_shebanged (tests.unittests.test_datasource.test_smartos.TestSmartOSDataSource)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/cloud-init/tests/unittests/test_datasource/test_smartos.py", line 465, in test_scripts_shebanged
    self.assertEqual(shebang, "#!/bin/bash")
AssertionError: '/bin/true' != '#!/bin/bash'
- /bin/true
+ #!/bin/bash

Revision history for this message
Joshua Powers (powersj) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/packages/debian/control.in b/packages/debian/control.in
2index b58561e..6c39d53 100644
3--- a/packages/debian/control.in
4+++ b/packages/debian/control.in
5@@ -6,10 +6,6 @@ Maintainer: Scott Moser <smoser@ubuntu.com>
6 Build-Depends: debhelper (>= 9),
7 dh-python,
8 dh-systemd,
9- iproute2,
10- pep8,
11- pyflakes,
12- python3-pyflakes | pyflakes (<< 1.1.0-2),
13 ${python},
14 ${test_requires},
15 ${requires}
16diff --git a/test-requirements.txt b/test-requirements.txt
17index 1b39ea5..d9d41b5 100644
18--- a/test-requirements.txt
19+++ b/test-requirements.txt
20@@ -11,9 +11,3 @@ coverage
21 # Only really needed on older versions of python
22 contextlib2
23 setuptools
24-
25-# Used for syle checking
26-pycodestyle==2.3.1
27-pyflakes==1.5.0
28-flake8==3.3.0
29-hacking==0.13.0
30diff --git a/tox.ini b/tox.ini
31index 03bb5f1..6276662 100644
32--- a/tox.ini
33+++ b/tox.ini
34@@ -4,13 +4,16 @@ recreate = True
35
36 [testenv]
37 commands = python -m nose {posargs:tests/unittests}
38-deps = -r{toxinidir}/test-requirements.txt
39- -r{toxinidir}/requirements.txt
40 setenv =
41 LC_ALL = en_US.utf-8
42
43 [testenv:flake8]
44 basepython = python3
45+deps =
46+ pycodestyle==2.3.1
47+ pyflakes==1.5.0
48+ flake8==3.3.0
49+ hacking==0.13.0
50 commands = {envpython} -m flake8 {posargs:cloudinit/ tests/ tools/}
51
52 # https://github.com/gabrielfalcao/HTTPretty/issues/223
53@@ -23,11 +26,17 @@ commands = {envpython} -m pylint {posargs:cloudinit}
54
55 [testenv:py3]
56 basepython = python3
57+deps = -r{toxinidir}/test-requirements.txt
58 commands = {envpython} -m nose {posargs:--with-coverage \
59 --cover-erase --cover-branches --cover-inclusive \
60 --cover-package=cloudinit tests/unittests}
61
62+[testenv:py27]
63+basepython = python2.7
64+deps = -r{toxinidir}/test-requirements.txt
65+
66 [testenv:py26]
67+deps = -r{toxinidir}/test-requirements.txt
68 commands = nosetests {posargs:tests/unittests}
69 setenv =
70 LC_ALL = C
71@@ -39,8 +48,7 @@ exclude = .venv,.tox,dist,doc,*egg,.git,build,tools
72
73 [testenv:doc]
74 basepython = python3
75-deps = {[testenv]deps}
76- sphinx
77+deps = sphinx
78 commands = {envpython} -m sphinx {posargs:doc/rtd doc/rtd_html}
79
80 [testenv:xenial]
81@@ -63,10 +71,6 @@ deps =
82 nose==1.3.7
83 unittest2==1.1.0
84 contextlib2==0.5.1
85- pep8==1.7.0
86- pyflakes==1.1.0
87- flake8==2.5.4
88- hacking==0.10.2
89
90 [testenv:centos6]
91 basepython = python2.6

Subscribers

People subscribed via source and target branches