From b30ed5743625418fdc630ed6b33ed03494e81173 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Tue, 28 Apr 2020 15:27:37 +0000 Subject: [PATCH] Support charm-helpers from submodule --- .gitignore | 4 ++-- .gitmodules | 3 +++ build-requirements.txt | 2 ++ charm-prep.sh | 1 - lib/README.txt | 1 + mod/charm-helpers | 1 + tox.ini | 40 ++++++++++++++++++++++++++++++---------- 7 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 build-requirements.txt create mode 100644 lib/README.txt create mode 160000 mod/charm-helpers diff --git a/.gitignore b/.gitignore index 1ec1637..18cac16 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ -lib .tox -test-decrpyt.py .swp __pycache__ .stestr/ +lib/* +!lib/README.txt diff --git a/.gitmodules b/.gitmodules index bb016b7..cc44e0e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "mod/ops-openstack"] path = mod/ops-openstack url = https://github.com/gnuoy/ops-openstack.git +[submodule "mod/charm-helpers"] + path = mod/charm-helpers + url = https://github.com/juju/charm-helpers.git diff --git a/build-requirements.txt b/build-requirements.txt new file mode 100644 index 0000000..81ba415 --- /dev/null +++ b/build-requirements.txt @@ -0,0 +1,2 @@ +mod/charm-helpers +#file:///home/ubuntu/branches/ceph-iscsi/mod/charm-helpers diff --git a/charm-prep.sh b/charm-prep.sh index d41ad09..0f29b41 100755 --- a/charm-prep.sh +++ b/charm-prep.sh @@ -1,7 +1,6 @@ #!/bin/bash rm -rf lib/* -rm adapters.py interface_ceph_client.py ops ops_openstack.py pip install -t lib/ git+https://github.com/juju/charm-helpers.git diff --git a/lib/README.txt b/lib/README.txt new file mode 100644 index 0000000..7931d0d --- /dev/null +++ b/lib/README.txt @@ -0,0 +1 @@ +Only generated files should be in here diff --git a/mod/charm-helpers b/mod/charm-helpers new file mode 160000 index 0000000..f3f36f8 --- /dev/null +++ b/mod/charm-helpers @@ -0,0 +1 @@ +Subproject commit f3f36f85f54380a651ba05972e78467ad22468e3 diff --git a/tox.ini b/tox.ini index 7e543b8..4c3de17 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,5 @@ -# Classic charm (with zaza): ./tox.ini -# This file is managed centrally by release-tools and should not be modified -# within individual charm repos. See the 'global' dir contents for available -# choices of tox.ini for OpenStack Charms: -# https://github.com/openstack-charmers/release-tools -# -# TODO: Distill the func test requirements from the lint/unit test -# requirements. They are intertwined. Also, Zaza itself should specify -# all of its own requirements and if it doesn't, fix it there. +# Operator charm (with zaza): tox.ini + [tox] envlist = pep8,py3 skipsdist = True @@ -22,7 +15,9 @@ setenv = VIRTUAL_ENV={envdir} install_command = pip install {opts} {packages} commands = stestr run --slowest {posargs} -whitelist_externals = juju +whitelist_externals = + git + ln passenv = HOME TERM CS_* OS_* TEST_* deps = -r{toxinidir}/test-requirements.txt @@ -84,6 +79,31 @@ omit = basepython = python3 commands = {posargs} +[testenv:build] +basepython = python3 +deps = +commands = + git submodule update --init + pip install -t lib -r build-requirements.txt + ln -f -t lib -s ../mod/operator/ops + ln -f -t lib -s ../mod/interface-ceph-client/interface_ceph_client.py + ln -f -t lib -s ../mod/ops-openstack/ops_openstack.py + ln -f -t lib -s ../mod/ops-openstack/adapters.py + +[testenv:update-deps] +basepython = python3 +deps = +commands = + git submodule update --init + git -C mod/operator pull origin master + git -C mod/ops-openstack pull origin master + git -C mod/charm-helpers pull origin master + pip install -t lib -r build-requirements.txt --upgrade + ln -f -t lib -s ../mod/operator/ops + ln -f -t lib -s ../mod/interface-ceph-client/interface_ceph_client.py + ln -f -t lib -s ../mod/ops-openstack/ops_openstack.py + ln -f -t lib -s ../mod/ops-openstack/adapters.py + [testenv:func-noop] basepython = python3 commands =