Merge ~stub/charm-test:snap into charm-test:master

Proposed by Stuart Bishop
Status: Merged
Approved by: Stuart Bishop
Approved revision: 8222127eae31c0d0f4840f7b8fd0fced83a999a2
Merged at revision: 248a3d967021b446f71cc965c937c9b360ef8154
Proposed branch: ~stub/charm-test:snap
Merge into: charm-test:master
Diff against target: 110 lines (+67/-1)
7 files modified
.gitignore (+5/-0)
README.md (+18/-0)
charm-test (+1/-0)
charm_test.py (+0/-0)
dev/null (+0/-1)
setup.py (+21/-0)
snap/snapcraft.yaml (+22/-0)
Reviewer Review Type Date Requested Status
Tom Haddon Approve
Review via email: mp+347458@code.launchpad.net

Commit message

Snap and distutils packaging

Description of the change

Do the snapcraft dance to transform the 7k Python script into a 13.5MB snap. Or upload it to pip and pip install it, because the easiest way to write the snapcraft.yaml is to create a Python setup.py

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Tom Haddon (mthaddon) wrote :

LGTM, with a minimal update to README.md

review: Approve
Revision history for this message
Tom Haddon (mthaddon) wrote :

LGTM

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 248a3d967021b446f71cc965c937c9b360ef8154

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2new file mode 100644
3index 0000000..b424693
4--- /dev/null
5+++ b/.gitignore
6@@ -0,0 +1,5 @@
7+build/
8+snap/.snapcraft
9+parts/
10+prime/
11+stage/
12diff --git a/README.md b/README.md
13new file mode 100644
14index 0000000..c9d7087
15--- /dev/null
16+++ b/README.md
17@@ -0,0 +1,18 @@
18+= charm-test
19+
20+charm-test will run a charm's tests in an lxd container. Charms
21+need to provide the necessary makefile targets, per the charm-test
22+protocol.
23+
24+== Charm requirements
25+
26+Charms need to provide a Makefile in the top level directory with the
27+following targets:
28+
29+* charmbuild: Build the charm into `${BUILDDEST}`
30+
31+* testdeps: Install all dependencies into the container required to
32+ run the tests.
33+
34+* test: Run the tests. The default Juju model is available, eg. for
35+ amulet tests.
36diff --git a/charm-test b/charm-test
37new file mode 120000
38index 0000000..7672cfc
39--- /dev/null
40+++ b/charm-test
41@@ -0,0 +1 @@
42+charm_test.py
43\ No newline at end of file
44diff --git a/charm-test.py b/charm-test.py
45deleted file mode 120000
46index a024413..0000000
47--- a/charm-test.py
48+++ /dev/null
49@@ -1 +0,0 @@
50-charm-test
51\ No newline at end of file
52diff --git a/charm-test b/charm_test.py
53index 97be0ca..97be0ca 100755
54--- a/charm-test
55+++ b/charm_test.py
56diff --git a/setup.py b/setup.py
57new file mode 100644
58index 0000000..085d36b
59--- /dev/null
60+++ b/setup.py
61@@ -0,0 +1,21 @@
62+import setuptools
63+
64+with open('README.md', 'r') as fh:
65+ long_description = fh.read()
66+
67+setuptools.setup(
68+ name='charm-test',
69+ version='0.0.1',
70+ author='Tom Haddon',
71+ author_email='tom.haddon@canonical.com',
72+ description="Run a Juju charm's test suite",
73+ long_description=long_description,
74+ long_description_content_type='text/markdown',
75+ url='https://launchpad.net/charm-test',
76+ py_modules=['charm_test'],
77+ entry_points={
78+ 'console_scripts': [
79+ 'charm-test=charm_test:main',
80+ ],
81+ },
82+)
83diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
84new file mode 100644
85index 0000000..06fdfbe
86--- /dev/null
87+++ b/snap/snapcraft.yaml
88@@ -0,0 +1,22 @@
89+name: charm-test
90+version: auto
91+version-script: git describe --dirty --always --tags | sed -r 's/v(.*)/\1/g'
92+summary: Run charm tests in containment
93+description: >
94+ charm-test will run a charm's tests in an lxd container. Charms
95+ need to provide the necessary makefile targets, per the charm-test
96+ protocol.
97+grade: stable
98+confinement: classic
99+apps:
100+ charm-test:
101+ command: usr/bin/python3 $SNAP/bin/charm-test
102+parts:
103+ charm-test:
104+ plugin: python
105+ python-version: python3
106+ source: .
107+ python-packages:
108+ - pyyaml
109+ stage-packages:
110+ - libc6

Subscribers

People subscribed via source and target branches