Merge lp:~ericsnowcurrently/fake-juju/deb-for-python-lib into lp:~landscape/fake-juju/trunk-old

Proposed by Eric Snow
Status: Merged
Approved by: Eric Snow
Approved revision: 52
Merged at revision: 41
Proposed branch: lp:~ericsnowcurrently/fake-juju/deb-for-python-lib
Merge into: lp:~landscape/fake-juju/trunk-old
Diff against target: 310 lines (+130/-42)
9 files modified
Makefile (+88/-25)
debian/changelog (+6/-0)
debian/control (+24/-2)
debian/fake-juju.install (+1/-0)
debian/python-fakejuju.install (+1/-0)
debian/rules (+3/-0)
python/Makefile (+0/-9)
python/README.rst (+2/-1)
python/setup.py (+5/-5)
To merge this branch: bzr merge lp:~ericsnowcurrently/fake-juju/deb-for-python-lib
Reviewer Review Type Date Requested Status
🤖 Landscape Builder test results Approve
Francis Ginther (community) Approve
Landscape Pending
Review via email: mp+309171@code.launchpad.net

Commit message

Add a python-fakejuju debian package.

Description of the change

Add a python-fakejuju debian package.

To post a comment you must log in.
Revision history for this message
🤖 Landscape Builder (landscape-builder) :
review: Abstain (executing tests)
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: make ci-test
Result: Success
Revno: 51
Branch: lp:~ericsnowcurrently/fake-juju/deb-for-python-lib
Jenkins: https://ci.lscape.net/job/latch-test-xenial/325/

review: Approve (test results)
Revision history for this message
Francis Ginther (fginther) wrote :

Tested trusty and xenial builds (with the necessary PPAs) and both build. Everything else looks reasonable.

review: Approve
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :
Download full text (67.0 KiB)

The attempt to merge lp:~ericsnowcurrently/fake-juju/deb-for-python-lib into lp:fake-juju failed. Below is the output from the failed tests.

sudo apt-get -y install --force-yes \
 wget \
 python3-pip \
 golang-go \
 golang-1.6
Reading package lists...
Building dependency tree...
Reading state information...
golang-go is already the newest version (2:1.6-1ubuntu4).
golang-1.6 is already the newest version (1.6.2-0ubuntu5~16.04).
wget is already the newest version (1.17.1-1ubuntu1.1).
python3-pip is already the newest version (8.1.1-2ubuntu0.2).
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-38 linux-headers-4.4.0-38-generic linux-headers-4.4.0-42
  linux-headers-4.4.0-42-generic linux-image-4.4.0-38-generic
  linux-image-4.4.0-42-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
# See tests/jujuclient-archive/UPGRADE when a newer jujuclient version is needed.
sudo python3 -m pip install \
 --ignore-installed \
        --no-cache-dir \
 --no-index \
 --find-links /var/tmp/tarmac/fake-juju/trunk/tests/jujuclient-archive \
 --requirement /var/tmp/tarmac/fake-juju/trunk/tests/jujuclient-archive/requirements
Ignoring indexes: https://pypi.python.org/simple
Collecting jujuclient==0.53.2 (from -r /var/tmp/tarmac/fake-juju/trunk/tests/jujuclient-archive/requirements (line 1))
Collecting PyYAML==3.12 (from -r /var/tmp/tarmac/fake-juju/trunk/tests/jujuclient-archive/requirements (line 2))
Collecting six==1.10.0 (from -r /var/tmp/tarmac/fake-juju/trunk/tests/jujuclient-archive/requirements (line 3))
Collecting websocket-client==0.37.0 (from -r /var/tmp/tarmac/fake-juju/trunk/tests/jujuclient-archive/requirements (line 4))
Installing collected packages: PyYAML, six, websocket-client, jujuclient
  Running setup.py install for PyYAML: started
    Running setup.py install for PyYAML: finished with status 'done'
  Running setup.py install for websocket-client: started
    Running setup.py install for websocket-client: finished with status 'done'
  Running setup.py install for jujuclient: started
    Running setup.py install for jujuclient: finished with status 'done'
Successfully installed PyYAML-3.12 jujuclient-0.53.2 six-1.10.0 websocket-client-0.37.0
make test
make[1]: Entering directory '/var/tmp/tarmac/fake-juju/trunk'
for VERSION in 1.24.7 1.25.6 2.0-beta17; do \
    make build JUJU_VERSION=$VERSION SKIP_PYTHON_LIB=TRUE; \
done
make[2]: Entering directory '/var/tmp/tarmac/fake-juju/trunk'
case 1.24.7 in \
 1.*) make build-common PATH=$PATH JUJU_VERSION=1.24.7 ;;\
 2.*) make build-common PATH=/usr/lib/go-1.6/bin:$PATH JUJU_VERSION=1.24.7 ;;\
esac
make[3]: Entering directory '/var/tmp/tarmac/fake-juju/trunk'
case 1.24.7 in \
 1.*) PROJECT="juju-core" ;;\
 2.*) PROJECT="juju" ;;\
esac;\
wget https://launchpad.net/$PROJECT/1.24/1.24.7/+download/juju-core_1.24.7.tar.gz
rm -rf 1.24.7/src # Go doesn't play nice with existing files.
tar -C 1.24.7 --strip=1 -z -xf juju-core_1.24.7.tar.gz
patch -p0 < patches/juju-core_1.24.7.patch
patching file 1.24.7/src/github.com/juju/juju/testcharms/charm.go
patching file 1.24.7/src/github.com/juju/juju/prov...

Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

No approved revision specified.

52. By Eric Snow

Add python-txjuju to the ci-test make target.

Revision history for this message
🤖 Landscape Builder (landscape-builder) :
review: Abstain (executing tests)
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: make ci-test
Result: Success
Revno: 52
Branch: lp:~ericsnowcurrently/fake-juju/deb-for-python-lib
Jenkins: https://ci.lscape.net/job/latch-test-xenial/342/

review: Approve (test results)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2016-09-20 18:26:47 +0000
3+++ Makefile 2016-10-26 14:47:12 +0000
4@@ -1,5 +1,8 @@
5-JUJUCLIENT_DOWNLOADS = $(shell pwd)/tests/jujuclient-archive
6-JUJUCLIENT_REQ = $(JUJUCLIENT_DOWNLOADS)/requirements
7+
8+ifdef JUJU_VERSIONS
9+# If someone explicitly set JUJU_VERSIONS then we ignore JUJU_VERSION.
10+JUJU_VERSION =
11+endif
12
13
14 ifdef JUJU_VERSION #############################
15@@ -25,7 +28,7 @@
16 wget https://launchpad.net/$$PROJECT/$(shell (echo $* | cut -f 1 -d - | cut -f 1,2 -d .))/$*/+download/$@
17
18 .PHONY: build
19-build: $(JUJU_VERSION)/$(JUJU_VERSION)
20+build: $(JUJU_VERSION)/$(JUJU_VERSION) py-build
21
22 .PHONY: build-common
23 build-common: $(JUJU_TARBALL) $(JUJU_PATCH)
24@@ -35,16 +38,16 @@
25 cd $(JUJU_VERSION) && GOPATH=$(shell pwd)/$(JUJU_VERSION) PATH=$(PATH) go build
26
27 .PHONY: install
28-install: $(JUJU_VERSION)/$(JUJU_VERSION)
29+install: $(JUJU_VERSION)/$(JUJU_VERSION) py-install-dev
30 install -D $(JUJU_VERSION)/$(JUJU_VERSION) $(INSTALLED)
31
32 .PHONY: install-dev
33-install-dev: $(JUJU_VERSION)/$(JUJU_VERSION)
34+install-dev: $(JUJU_VERSION)/$(JUJU_VERSION) py-install-dev
35 mkdir -p $(INSTALLDIR)
36 ln -s --backup=existing --suffix .orig $(shell pwd)/$(JUJU_VERSION)/$(JUJU_VERSION) $(INSTALLED)
37
38 .PHONY: clean
39-clean:
40+clean: py-clean
41 rm -f $(JUJU_TARBALL)
42 rm -rf $(JUJU_VERSION)/src
43 rm -f $(JUJU_VERSION)/$(JUJU_VERSION)
44@@ -52,60 +55,120 @@
45 rm -f tests/*.pyc
46
47 .PHONY: test
48-test: $(JUJU_VERSION)/$(JUJU_VERSION)
49+test: $(JUJU_VERSION)/$(JUJU_VERSION) py-test
50 env JUJU_VERSION=$(JUJU_VERSION) python3 -m unittest tests.test_fake
51
52
53 else ###########################################
54 # for all versions
55
56+ifndef JUJU_VERSIONS
57 JUJU1_VERSIONS = 1.24.7 1.25.6
58 JUJU2_VERSIONS = 2.0-beta17
59-VERSIONS = $(JUJU1_VERSIONS) $(JUJU2_VERSIONS)
60-BUILT_VERSIONS = $(foreach version,$(VERSIONS),$(version)/$(version))
61+JUJU_VERSIONS = $(JUJU1_VERSIONS) $(JUJU2_VERSIONS)
62+endif
63+BUILT_VERSIONS = $(foreach version,$(JUJU_VERSIONS),$(version)/$(version))
64
65 $(BUILT_VERSIONS):
66- for VERSION in $(VERSIONS); do \
67- $(MAKE) build JUJU_VERSION=$$VERSION; \
68+ for VERSION in $(JUJU_VERSIONS); do \
69+ $(MAKE) build JUJU_VERSION=$$VERSION SKIP_PYTHON_LIB=TRUE; \
70 done
71
72 .PHONY: build
73-build: $(BUILT_VERSIONS)
74+build: $(BUILT_VERSIONS) py-build
75
76 .PHONY: install
77-install:
78- for VERSION in $(VERSIONS); do \
79- $(MAKE) install JUJU_VERSION=$$VERSION; \
80+install: py-install
81+ for VERSION in $(JUJU_VERSIONS); do \
82+ $(MAKE) install JUJU_VERSION=$$VERSION SKIP_PYTHON_LIB=TRUE; \
83 done
84
85 .PHONY: install-dev
86-install-dev:
87- for VERSION in $(VERSIONS); do \
88- $(MAKE) install-dev JUJU_VERSION=$$VERSION; \
89+install-dev: py-install-dev
90+ for VERSION in $(JUJU_VERSIONS); do \
91+ $(MAKE) install-dev JUJU_VERSION=$$VERSION SKIP_PYTHON_LIB=TRUE; \
92 done
93
94 .PHONY: clean
95-clean:
96- for VERSION in $(VERSIONS) ; do \
97- $(MAKE) clean JUJU_VERSION=$$VERSION; \
98+clean: py-clean
99+ for VERSION in $(JUJU_VERSIONS) ; do \
100+ $(MAKE) clean JUJU_VERSION=$$VERSION SKIP_PYTHON_LIB=TRUE; \
101 done
102
103 .PHONY: test
104 # Use xargs here so that we don't throw away the return codes, and correctly fail if any of the tests fail
105-test: $(BUILT_VERSIONS)
106- #@echo -n $(VERSIONS) | xargs -t -d' ' -I {} env JUJU_VERSION={} python3 -m unittest tests.test_fake
107- @echo -n $(VERSIONS) | xargs -t -d' ' -I {} $(MAKE) test JUJU_VERSION={}
108+test: $(BUILT_VERSIONS) py-test
109+ #@echo -n $(JUJU_VERSIONS) | xargs -t -d' ' -I {} env JUJU_VERSION={} python3 -m unittest tests.test_fake
110+ @echo -n $(JUJU_VERSIONS) | xargs -t -d' ' -I {} $(MAKE) test JUJU_VERSION={} SKIP_PYTHON_LIB=TRUE
111
112
113 endif ##########################################
114
115+# for the Python library
116+
117+PYTHON = python
118+ifndef PYTHON_INSTALLDIR
119+PYTHON_INSTALLDIR = $(DESTDIR)/usr/lib/python2.7/dist-packages
120+endif
121+PYTHON_INSTALL_OPTION = --install-lib $(PYTHON_INSTALLDIR)
122+
123+PYTHON_LIB_ROOT = $(shell pwd)/python
124+# TODO: read from python/fakejuju/__init__.py
125+PYTHON_LIB_VERSION = 0.9.0b1
126+PYTHON_LIB_SOURCE_TARBALL = $(PYTHON_LIB_ROOT)/dist/fakejuju-$(PYTHON_LIB_VERSION).tar.gz
127+
128+$(PYTHON_LIB_SOURCE_TARBALL): python/fakejuju
129+ echo $(PYTHON_LIB_SOURCE_TARBALL)
130+ cd python; \
131+ $(PYTHON) setup.py sdist
132+
133+.PHONY: py-build
134+py-build: $(PYTHON_LIB_SOURCE_TARBALL)
135+
136+.PHONY: py-install
137+py-install: py-build
138+ if [ ! "$(SKIP_PYTHON_LIB)" ]; then \
139+ mkdir -p $(PYTHON_INSTALL_DIR); \
140+ cd python; \
141+ $(PYTHON) setup.py install $(PYTHON_INSTALL_OPTION); \
142+ fi
143+
144+.PHONY: py-install-dev
145+py-install-dev:
146+ if [ ! "$(SKIP_PYTHON_LIB)" ]; then \
147+ ln -snv $(PYTHON_LIB_ROOT)/fakejuju $(PYTHON_INSTALLDIR)/fakejuju; \
148+ fi
149+
150+.PHONY: py-clean
151+py-clean:
152+ if [ ! "$(SKIP_PYTHON_LIB)" ]; then \
153+ rm -rf python/dist; \
154+ rm -rf python/fakejuju.egg-info; \
155+ rm -f python/fakejuju/*.pyc; \
156+ rm -f python/fakejuju/tests/*.pyc; \
157+ fi
158+
159+.PHONY: py-test
160+py-test:
161+ if [ ! "$(SKIP_PYTHON_LIB)" ]; then \
162+ $(PYTHON) -m unittest discover -t $(PYTHON_LIB_ROOT) -s $(PYTHON_LIB_ROOT)/fakejuju; \
163+ fi
164+
165+
166+#################################################
167+# other targets
168+
169+JUJUCLIENT_DOWNLOADS = $(shell pwd)/tests/jujuclient-archive
170+JUJUCLIENT_REQ = $(JUJUCLIENT_DOWNLOADS)/requirements
171+
172 .PHONY: ci-test
173 ci-test:
174 sudo apt-get -y install --force-yes \
175 wget \
176 python3-pip \
177 golang-go \
178- golang-1.6
179+ golang-1.6 \
180+ python-txjuju
181 # See tests/jujuclient-archive/UPGRADE when a newer jujuclient version is needed.
182 sudo python3 -m pip install \
183 --ignore-installed \
184
185=== modified file 'debian/changelog'
186--- debian/changelog 2016-05-26 14:09:16 +0000
187+++ debian/changelog 2016-10-26 14:47:12 +0000
188@@ -1,3 +1,9 @@
189+fake-juju (0.18-1) trusty; urgency=medium
190+
191+ * Add support for 2.0 final and add a Python library.
192+
193+ -- Eric Snow <eric.snow@canonical.com> Mon, 24 Oct 2016 13:37:34 -0600
194+
195 fake-juju (0.17-1) trusty; urgency=medium
196
197 * Add support for beta 6 and fix beta 2
198
199=== modified file 'debian/control'
200--- debian/control 2016-06-23 20:27:10 +0000
201+++ debian/control 2016-10-26 14:47:12 +0000
202@@ -3,11 +3,33 @@
203 Section: devel
204 Priority: optional
205 Standards-Version: 3.9.2
206-Build-Depends: debhelper (>= 9), wget, python-jujuclient, golang-1.6, golang
207+Build-Depends: debhelper (>= 9),
208+ golang,
209+ golang-1.6,
210+ python-all (>= 2.6.6-3),
211+ python-fixtures,
212+ python-jujuclient,
213+ python-testtools,
214+ python-twisted-core (>= 16.0.0),
215+ python-txjuju,
216+ python-yaml,
217+ wget
218
219 Package: fake-juju
220 Architecture: any
221-Depends: ${shlibs:Depends}, ${misc:Depends}, juju-mongodb
222+Depends: ${shlibs:Depends}, ${misc:Depends},
223+ juju-mongodb,
224+ python-fakejuju
225 Description: A fake implentation of Juju using the dummy provider.
226 Provide a fake Juju server behaving like a regular one, except
227 that the provider will be a dummy one.
228+
229+Package: python-fakejuju
230+Architecture: any
231+Depends: ${python:Depends}, ${misc:Depends}, ${extra:Depends}, ${shlibs:Depends},
232+ python-fixtures,
233+ python-testtools,
234+ python-twisted-core (>= 16.0.0),
235+ python-txjuju,
236+ python-yaml
237+Description: Python bindings for managing fake-juju.
238
239=== added file 'debian/fake-juju.install'
240--- debian/fake-juju.install 1970-01-01 00:00:00 +0000
241+++ debian/fake-juju.install 2016-10-26 14:47:12 +0000
242@@ -0,0 +1,1 @@
243+usr/bin/fake-juju-*
244
245=== added file 'debian/python-fakejuju.install'
246--- debian/python-fakejuju.install 1970-01-01 00:00:00 +0000
247+++ debian/python-fakejuju.install 2016-10-26 14:47:12 +0000
248@@ -0,0 +1,1 @@
249+usr/lib/python*
250
251=== modified file 'debian/rules'
252--- debian/rules 2015-09-22 02:41:33 +0000
253+++ debian/rules 2016-10-26 14:47:12 +0000
254@@ -1,4 +1,7 @@
255 #!/usr/bin/make -f
256+
257+dh_extra_flags = -pfake-juju -ppython-fakejuju
258+
259 %:
260 dh $@
261
262
263=== removed file 'python/Makefile'
264--- python/Makefile 2016-10-06 21:44:31 +0000
265+++ python/Makefile 1970-01-01 00:00:00 +0000
266@@ -1,9 +0,0 @@
267-PYTHON = python
268-
269-.PHONY: test
270-test:
271- $(PYTHON) -m unittest discover -t $(shell pwd) -s $(shell pwd)/fakejuju
272-
273-.PHONY: install-dev
274-install-dev:
275- ln -s $(shell pwd)/fakejuju /usr/local/lib/python2.7/dist-packages/fakejuju
276
277=== renamed file 'python/README.md' => 'python/README.rst'
278--- python/README.md 2016-10-06 21:43:43 +0000
279+++ python/README.rst 2016-10-26 14:47:12 +0000
280@@ -1,1 +1,2 @@
281-# fakejuju
282+fakejuju
283+=========
284
285=== modified file 'python/setup.py'
286--- python/setup.py 2016-10-06 21:44:31 +0000
287+++ python/setup.py 2016-10-26 14:47:12 +0000
288@@ -18,7 +18,7 @@
289 PROJECT_URL = 'https://launchpad.net/fake-juju'
290 LICENSE = 'LGPLv3'
291
292-with open(os.path.join(basedir, 'README.md')) as readme_file:
293+with open(os.path.join(basedir, 'README.rst')) as readme_file:
294 DESCRIPTION = readme_file.read()
295
296 # dymanically generated data
297@@ -42,11 +42,11 @@
298
299 # dependencies
300
301-DEPS = ['yaml',
302- # for testing
303+DEPS = ['fixtures',
304+ 'testtools',
305 'txjuju',
306- 'fixtures',
307- 'testtools',
308+ 'twisted',
309+ 'yaml',
310 ]
311
312

Subscribers

People subscribed via source and target branches

to all changes: