collective / collective.xmpp.chat

11 stars 11 forks source link

NameError: name 'sys_platform' is not defined #18

Open MrTango opened 9 years ago

MrTango commented 9 years ago

i get the following error when i try to install collective.xmpp.chat on debian. setuptools and zc.buildout newest versions, also tried with older versions.

$ ./bin/buildout 
Installing instance.
/home/maik/.virtualenvs/conversejs/lib/python2.7/site-packages/pkg_resources/__init__.py:203: RuntimeWarning: You have iterated over the result of pkg_resources.parse_version. This is a legacy behavior which is inconsistent with the new version class introduced in setuptools 8.0. In most cases, conversion to a tuple is unnecessary. For comparison of versions, sort the Version instances directly. If you have another use case requiring the tuple, please file a bug with the setuptools project describing that need.
  stacklevel=1,
Getting distribution for 'collective.xmpp.chat==0.3.1'.
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.34.tar.gz
Extracting in /tmp/easy_install-DUUB3x/collective.xmpp.chat-0.3.1/temp/tmp47Vgxo
Now working in /tmp/easy_install-DUUB3x/collective.xmpp.chat-0.3.1/temp/tmp47Vgxo/distribute-0.6.34
Building a Distribute egg in /tmp/easy_install-DUUB3x/collective.xmpp.chat-0.3.1
Traceback (most recent call last):
  File "setup.py", line 248, in <module>
    scripts = scripts,
  File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
    _setup_distribution = dist = klass(attrs)
  File "/tmp/easy_install-DUUB3x/collective.xmpp.chat-0.3.1/temp/tmp47Vgxo/distribute-0.6.34/setuptools/dist.py", line 225, in __init__
    _Distribution.__init__(self,attrs)
  File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "/tmp/easy_install-DUUB3x/collective.xmpp.chat-0.3.1/temp/tmp47Vgxo/distribute-0.6.34/setuptools/dist.py", line 257, in finalize_options
    ep.require(installer=self.fetch_build_egg)
  File "/tmp/easy_install-DUUB3x/collective.xmpp.chat-0.3.1/temp/tmp47Vgxo/distribute-0.6.34/pkg_resources.py", line 2025, in require
    working_set.resolve(self.dist.requires(self.extras),env,installer))
  File "/tmp/easy_install-DUUB3x/collective.xmpp.chat-0.3.1/temp/tmp47Vgxo/distribute-0.6.34/pkg_resources.py", line 2235, in requires
    dm = self._dep_map
  File "/tmp/easy_install-DUUB3x/collective.xmpp.chat-0.3.1/temp/tmp47Vgxo/distribute-0.6.34/pkg_resources.py", line 2464, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/tmp/easy_install-DUUB3x/collective.xmpp.chat-0.3.1/temp/tmp47Vgxo/distribute-0.6.34/pkg_resources.py", line 2497, in _compute_dependencies
    common = frozenset(reqs_for_extra(None))
  File "/tmp/easy_install-DUUB3x/collective.xmpp.chat-0.3.1/temp/tmp47Vgxo/distribute-0.6.34/pkg_resources.py", line 2494, in reqs_for_extra
    if req.marker_fn(override={'extra':extra}):
  File "/tmp/easy_install-DUUB3x/collective.xmpp.chat-0.3.1/temp/tmp47Vgxo/distribute-0.6.34/_markerlib/markers.py", line 109, in marker_fn
    return eval(compiled_marker, environment)
  File "<environment marker>", line 1, in <module>
NameError: name 'sys_platform' is not defined
/tmp/easy_install-DUUB3x/collective.xmpp.chat-0.3.1/distribute-0.6.34-py2.7.egg
error: Could not build the egg.
An error occurred when trying to install collective.xmpp.chat 0.3.1. Look above this message for any errors that were output by easy_install.
While:
  Installing instance.
  Getting distribution for 'collective.xmpp.chat==0.3.1'.
Error: Couldn't install: collective.xmpp.chat 0.3.1
jcbrand commented 9 years ago

Is this for an existing installation that you're updating or for a new installation? Did you see my lightning talk I gave on XMPP/Plone? There's a much simpler way possible than using collective.xmpp.core, especially if you're willing to use Prosody XMPP server.

jcbrand commented 9 years ago

But the new code needs cleaning up, documentation, packaging and releasing etc.

MrTango commented 9 years ago

it's a new Plone 5 buildout ;) Is the other way somewhere documented, so i can look into it? I just interested in how i can combine conversejs with Plone.

jcbrand commented 9 years ago

The new way is much simpler and IMO much better, but unfortunately it's not yet completely implemented in Plone.

The work I've done so far on this was for a non-Plone site and then I just did a quick and dirty implementation in Plone to test and show that XMPP authentication can be delegated to a Plone site.

However, that's only part of the story. We also need a way to start an XMPP session when the user logs in. I know how to do this, but it still needs to be done.

To finish this off and get a proper release will take time and I'm currently looking for funding to implement this for Plone.

In the meantime, I can take a look at the bug above, but if it was up to me and I had the budget, I would definitely not use the old collective.xmpp.core code (which collective.xmpp.chat is currently based) and instead develop the new approach of delegating authentication.

Advantages (off the top of my head):

In other words, fewer complicated moving parts all around.

MrTango commented 9 years ago

That sounds interesting. I do not have a real project by now. If i get one, i'll contact you. Do you have a guess how big the effort is to finalize this?

jcbrand commented 9 years ago

Thanks. Depends on a few things, but a rough estimate would be 2 to 4 days of work.

Something I forgot to mention above is that you can also let Plone manage the relationships (i.e. friendships or follows) between users, instead of doing that through XMPP/converse.js.

The XMPP server will ask Plone to give it the roster. The simplest solution in such a case is to let all users in the site be friends/contacts with one another. That code is already implemented. More complicated schemes (where users have to add one another as friends somewhere in Plone) can be imagined but are not yet implemented.

holdenhao commented 6 years ago

FYI, I fixed this by patching distribute 0.6.49 with version of markers.py taken from https://pypi.python.org/pypi/markerlib/0.6.0. This fix was taken from:

https://github.com/easybuilders/easybuild-framework/commit/f1bb87db8989ef886585779b0a160903b37e49b4#diff-9dda168ea76fc27d241c177bd7640636R239