Python snaps

Barry Warsaw barry at ubuntu.com
Fri Apr 3 19:11:45 UTC 2015


On Apr 03, 2015, at 01:57 PM, Dustin Kirkland wrote:

>I didn't, but I do now, and the error was the same:

I get a different error:

[...]
Traceback (most recent call last):
  File "./snap.py", line 229, in _entry_point
    return super()._entry_point(config)
  File "./snap.py", line 76, in _entry_point
    return config['project']['entry_point']
  File "/usr/lib/python3.4/configparser.py", line 1203, in __getitem__
    raise KeyError(key)
KeyError: 'entry_point'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./snap.py", line 288, in <module>
    sys.exit(main())
  File "./snap.py", line 281, in main
    package.make_pex(config, dirs.bin)
  File "./snap.py", line 112, in make_pex
    subprocess.check_call(self._pexcmd(config, binary), shell=True)
  File "./snap.py", line 238, in _pexcmd
    ep = self._entry_point(config)
  File "./snap.py", line 234, in _entry_point
    assert len(eps['console_scripts']) == 1, eps['console_scripts']
  File "/usr/lib/python3.4/configparser.py", line 937, in __getitem__
    raise KeyError(key)
KeyError: 'console_scripts'


Then I ran `python3 setup.py egg_info` on your git repo and noticed that
there's no ssh_import_id.egg-info/entry_points.txt file.  Indeed, looking at
your setup.py there are no console entry points defined.

snap.py doesn't currently handle the `scripts` tag in setup.py.  I'm not sure
pex itself handles that either because of the way it wraps invocation of your
entry points.

If you *can* define an entry point for the app you want to deploy, just add it
to your ini file, e.g.:

[project]
name: ssh-import-id
origin: git https://github.com/dustinkirkland/ssh-import-id
entry_point: mypackage.mymodule:mainfunc

(this is passed directly to pex's -e argument)

Cheers,
-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/snappy-devel/attachments/20150403/24ea922e/attachment.pgp>


More information about the snappy-devel mailing list