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

What should I do about ws4py? #615

Open
dimaqq opened this issue Nov 22, 2024 · 6 comments
Open

What should I do about ws4py? #615

dimaqq opened this issue Nov 22, 2024 · 6 comments
Assignees

Comments

@dimaqq
Copy link

dimaqq commented Nov 22, 2024

This is what gets installed:

pylxd==2.3.5
  cryptography==43.0.1
    cffi==1.17.1
      pycparser==2.22
  python-dateutil==2.9.0.post0
    six==1.16.0
  requests==2.32.3
    certifi==2024.8.30
    charset-normalizer==3.3.2
    idna==3.10
    urllib3==1.26.20
  requests-toolbelt==1.0.0
    requests==2.32.3
      certifi==2024.8.30
      charset-normalizer==3.3.2
      idna==3.10
      urllib3==1.26.20
  ws4py==0.5.1

And that works fine in my local env, but the Jenkins job barfs...
(I don't quite know what Jenkins does, but still?)

Building wheels for collected packages: juju, ws4py
  Building wheel for juju (pyproject.toml): started
  Building wheel for juju (pyproject.toml): finished with status 'done'
  Created wheel for juju: filename=juju-3.5.2.0-py3-none-any.whl size=283168 sha256=f19ece3d052a8acc76b27a8a0f0588b5ef15677554269325f877a053bf65d7e6
  Stored in directory: /home/jenkins/.cache/pip/wheels/74/32/a3/6fab14d05865e07fb4e28c16a9ff3abae6f17e145b87ce14a3
  Building wheel for ws4py (setup.py): started
  Building wheel for ws4py (setup.py): finished with status 'error'
  Running setup.py clean for ws4py
Successfully built juju
Failed to build ws4py
�[31m  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [88 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib
      creating build/lib/ws4py
      copying ws4py/compat.py -> build/lib/ws4py
      copying ws4py/websocket.py -> build/lib/ws4py
      copying ws4py/async_websocket.py -> build/lib/ws4py
      copying ws4py/utf8validator.py -> build/lib/ws4py
      copying ws4py/messaging.py -> build/lib/ws4py
      copying ws4py/manager.py -> build/lib/ws4py
      copying ws4py/streaming.py -> build/lib/ws4py
      copying ws4py/framing.py -> build/lib/ws4py
      copying ws4py/__init__.py -> build/lib/ws4py
      copying ws4py/exc.py -> build/lib/ws4py
      creating build/lib/ws4py/client
      copying ws4py/client/geventclient.py -> build/lib/ws4py/client
      copying ws4py/client/threadedclient.py -> build/lib/ws4py/client
      copying ws4py/client/tornadoclient.py -> build/lib/ws4py/client
      copying ws4py/client/__init__.py -> build/lib/ws4py/client
      creating build/lib/ws4py/server
      copying ws4py/server/geventserver.py -> build/lib/ws4py/server
      copying ws4py/server/wsgirefserver.py -> build/lib/ws4py/server
      copying ws4py/server/cherrypyserver.py -> build/lib/ws4py/server
      copying ws4py/server/tulipserver.py -> build/lib/ws4py/server
      copying ws4py/server/wsgiutils.py -> build/lib/ws4py/server
      copying ws4py/server/__init__.py -> build/lib/ws4py/server
      /home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
      !!
      
              ********************************************************************************
              Please avoid running ``setup.py`` directly.
              Instead, use pypa/build, pypa/installer or other
              standards-based tools.
      
              See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
              ********************************************************************************
      
      !!
        self.initialize_options()
      installing to build/bdist.linux-x86_64/wheel
      running install
      running install_lib
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-xxao179z/ws4py_32bb9ce314c5496fa5cc0637a096257a/setup.py", line 40, in <module>
          setup(name = "ws4py",
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/dist.py", line 1233, in run_command
          super().run_command(command)
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 403, in run
          self.run_command("install")
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/dist.py", line 1233, in run_command
          super().run_command(command)
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/command/install.py", line 78, in run
          return orig.install.run(self)
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/_distutils/command/install.py", line 708, in run
          self.run_command(cmd_name)
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/dist.py", line 1233, in run_command
          super().run_command(command)
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
          cmd_obj.ensure_finalized()
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
          self.finalize_options()
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 17, in finalize_options
          self.set_undefined_options('install',('install_layout','install_layout'))
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 296, in set_undefined_options
          setattr(self, dst_option, getattr(src_cmd_obj, src_option))
        File "/home/jenkins/go/src/github.com/juju/python-libjuju/.tox/py38/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
          raise AttributeError(attr)
      AttributeError: install_layout
      [end of output]
@simondeziel
Copy link
Member

simondeziel commented Nov 22, 2024

@dimaqq have you tried bringing this to the ws4py folks? I feel they would be in a better position to understand/help than us.

@dimaqq
Copy link
Author

dimaqq commented Nov 25, 2024

The last release of ws4py was... Released: Mar 1, 2018

I'll open a ticket, but let's see if in space anyone can hear me whine.

@dimaqq
Copy link
Author

dimaqq commented Nov 25, 2024

I've opened Lawouach/WebSocket-for-Python#296

In the meantime, I've put the few tests that use pylxd behiond pytest.importorskip.

That means pylxd is no longer exercised in CI in python-libjuju but those two tests can be run manually, so I guess that's OK.

P.S. if WebSocket is an essential part of listening to the event stream, I would advocate using a newer library. If not, maybe the dependency can be optional?

@simondeziel
Copy link
Member

@hamistao WDYT about potentially switching to https://github.com/python-websockets/websockets? From a cursory look, it seems like a potential replacement and it is backed by Tidelift which is a sign of "good health" IMHO and it seems to be considerably more popular than ws4py.

According to https://websockets.readthedocs.io/en/stable/project/changelog.html, we'd have to use 13.1 for backward compat with Python 3.8 which we need for support of Ubuntu 20.04.

@hamistao
Copy link
Contributor

hamistao commented Nov 25, 2024

@simondeziel I really like your proposal! Although I don't have a ton of experience with neither library, websockets has a lot going for it. It is getting a lot more attention on GitHub, both from the development standpoint and the community. Its documentation looks a not nicer. I checked and it seems to have all the features we need. Also it just may help us get rid of #585.

May I assign this to myself?

@simondeziel
Copy link
Member

@simondeziel I really like your proposal! Although I don't have a ton of experience with neither library, websockets is getting a lot more attention on GitHub, both from the development standpoint and the community. I checked and it seems to have all the features we need. Also it just may help us get rid of #585.

Indeed, 2 birds with one stone :)

May I assign this to myself?

Please :)

@hamistao hamistao self-assigned this Nov 25, 2024
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