Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debuild issues #70

Open
willkelly opened this issue Mar 30, 2014 · 2 comments
Open

Debuild issues #70

willkelly opened this issue Mar 30, 2014 · 2 comments
Assignees

Comments

@willkelly
Copy link
Contributor

I got the following via email. I'm making this issue and letting the user know to check back here in case there are questions or solutions.

  • I found the package manager, ZPM, but wasn't able to get it running. Is this
    supposed to be usable, or am I doing something funky? I first tried the
    instructions in the README, but debuild failed (see below). I then installed
    the zpm python package with python setup.py install, but running zpm bundle
    to build my test ZAR fails with a jinja template error (also below).

    In case it is helpful, here is the debuild failure (this is on ubuntu 12.04):

    dpkg-buildpackage: source package zpm
    dpkg-buildpackage: source version 0.1-1
    dpkg-buildpackage: source changed by Lars Butler (larsbutler) [email protected]
    dpkg-source --before-build zpm
    fakeroot debian/rules clean
    dh clean --with python2 --buildsystem=python_distutils
    dh_testdir -O--buildsystem=python_distutils
    dh_auto_clean -O--buildsystem=python_distutils
    running clean
    'build/lib.linux-x86_64-2.7' does not exist -- can't clean it
    'build/bdist.linux-x86_64' does not exist -- can't clean it
    'build/scripts-2.7' does not exist -- can't clean it
    dh_clean -O--buildsystem=python_distutils
    dpkg-source -b zpm
    dpkg-source: info: using source format `3.0 (quilt)'
    dpkg-source: info: building zpm using existing ./zpm_0.1.orig.tar.gz
    dpkg-source: info: local changes detected, the modified files are:
    zpm/.coveragerc
    dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/zpm_0.1-1.diff.P9fg62
    dpkg-source: info: you can integrate the local changes with dpkg-source --commit
    dpkg-buildpackage: error: dpkg-source -b zpm gave error exit status 2
    debuild: fatal error at line 1350:
    dpkg-buildpackage -rfakeroot -d -us -uc -S failed

    Here is the jinja template error:

    root@ra:~/zvm# zpm bundle
    adding OMS.json
    adding /root/zvm/oms.py
    adding /root/zvm/zar.json
    Traceback (most recent call last):
    File "/usr/local/bin/zpm", line 5, in
    pkg_resources.run_script('zpm==0.1', 'zpm')
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
    self.require(requires)[0].run_script(script_name, ns)
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script
    execfile(script_filename, namespace, namespace)
    File "/usr/local/lib/python2.7/dist-packages/zpm-0.1-py2.7.egg/EGG-INFO/scripts/zpm", line 23, in
    args.func(args)
    File "/usr/local/lib/python2.7/dist-packages/zpm-0.1-py2.7.egg/zpmlib/commands.py", line 101, in bundle
    zpm.bundle_project(root)
    File "/usr/local/lib/python2.7/dist-packages/zpm-0.1-py2.7.egg/zpmlib/zpm.py", line 187, in bundle_project
    _add_ui(tar, zar)
    File "/usr/local/lib/python2.7/dist-packages/zpm-0.1-py2.7.egg/zpmlib/zpm.py", line 150, in _add_ui
    tmpl = env.get_template(path)
    File "/usr/local/lib/python2.7/dist-packages/Jinja2-2.6-py2.7.egg/jinja2/environment.py", line 719, in get_template
    return self._load_template(name, self.make_globals(globals))
    File "/usr/local/lib/python2.7/dist-packages/Jinja2-2.6-py2.7.egg/jinja2/environment.py", line 693, in _load_template
    template = self.loader.load(self, name, globals)
    File "/usr/local/lib/python2.7/dist-packages/Jinja2-2.6-py2.7.egg/jinja2/loaders.py", line 115, in load
    source, filename, uptodate = self.get_source(environment, name)
    File "/usr/local/lib/python2.7/dist-packages/Jinja2-2.6-py2.7.egg/jinja2/loaders.py", line 227, in get_source
    raise TemplateNotFound(template)
    jinja2.exceptions.TemplateNotFound: index.html

    The ZAR is created, but the jinja error, along with the next failure, suggests
    the manifest isn't created correctly:

    root@ra:/zvm# export OS_TENANT_NAME=admin
    root@ra:
    /zvm# export OS_USERNAME=admin
    root@ra:/zvm# export OS_PASSWORD=admin
    root@ra:
    /zvm# export OS_AUTH_URL=http://23.253.106.203/auth/v1.0
    root@ra:~/zvm# zpm deploy OMS.zar OMS/test
    deploying OMS.zar
    Traceback (most recent call last):
    File "/usr/local/bin/zpm", line 5, in
    pkg_resources.run_script('zpm==0.1', 'zpm')
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
    self.require(requires)[0].run_script(script_name, ns)
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script
    execfile(script_filename, namespace, namespace)
    File "/usr/local/lib/python2.7/dist-packages/zpm-0.1-py2.7.egg/EGG-INFO/scripts/zpm", line 23, in
    args.func(args)
    File "/usr/local/lib/python2.7/dist-packages/zpm-0.1-py2.7.egg/zpmlib/commands.py", line 132, in deploy
    zpm.deploy_project(args)
    File "/usr/local/lib/python2.7/dist-packages/zpm-0.1-py2.7.egg/zpmlib/zpm.py", line 201, in deploy_project
    client.auth()
    File "/usr/local/lib/python2.7/dist-packages/zpm-0.1-py2.7.egg/zpmlib/miniswift.py", line 65, in auth
    data = r.json()
    File "/usr/local/lib/python2.7/dist-packages/requests-2.2.1-py2.7.egg/requests/models.py", line 741, in json
    return json.loads(self.text, **kwargs)
    File "/usr/lib/python2.7/dist-packages/simplejson/init.py", line 413, in loads
    return _default_decoder.decode(s)
    File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 402, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 420, in raw_decode
    raise JSONDecodeError("No JSON object could be decoded", s, idx)
    simplejson.decoder.JSONDecodeError: No JSON object could be decoded: line 1 column 0 (char 0)

@mgeisler
Copy link
Contributor

Thanks for reporting this! I haven't looked into why building the Debian package fails. However, I would suggest not bothering with a Debian package at all and instead installing ZPM into a virtual Python environment:

$ virtualenv zpm-venv
$ source zpm/venv/bin/activate
$ pip install .

This will give you a self-contained installation inside the zpm-venv directory. You find the zpm script as zpm-venv/bin/zpm and you can then symlink it into a more convenient place on your PATH.

@larsbutler
Copy link
Member

This bug report tells me that the readme is misleading. It seems to imply that running the packaging steps is necessary in order to install zpm, which is not true. I will amend the readme to make it a little more clear.

For the moment, the best way to install is to use pip install git+[repo url], or clone and run python setup.py install. I'll fix up the readme to add these instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants