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

Installing zulip-term in Python 3.10 fallbacks to zulip-term 0.2.1 #1145

Closed
JPTIZ opened this issue Dec 21, 2021 · 5 comments
Closed

Installing zulip-term in Python 3.10 fallbacks to zulip-term 0.2.1 #1145

JPTIZ opened this issue Dec 21, 2021 · 5 comments
Labels
area: infrastructure Project infrastructure bug Something isn't working
Milestone

Comments

@JPTIZ
Copy link

JPTIZ commented Dec 21, 2021

As previously mentioned in #1143, newer versions of zulip installed through pip fail to start due to the following error:

Traceback (most recent call last):
    return self.do_api_query(marshalled_request, versioned_url, method=method,
  File "/home/jptiz/.local/lib/python3.10/site-packages/zulip/__init__.py", line 501, in do_api_query
  File "/home/jptiz/.local/lib/python3.10/site-packages/zulipterminal/cli/run.py", line 123, in main
    Controller(zuliprc_path, zterm['theme']).main()
  File "/home/jptiz/.local/lib/python3.10/site-packages/zulip/__init__.py", line 618, in call_endpoint
  File "/home/jptiz/.local/lib/python3.10/site-packages/zulipterminal/core.py", line 30, in __init__
    self.model = Model(self)
  File "/home/jptiz/.local/lib/python3.10/site-packages/zulipterminal/model.py", line 40, in __init__
    self._update_initial_data()
  File "/home/jptiz/.local/lib/python3.10/site-packages/zulip/__init__.py", line 447, in ensure_session
    session.headers.update({"User-agent": self.get_user_agent()})
    self.ensure_session()
  File "/home/jptiz/.local/lib/python3.10/site-packages/zulip/__init__.py", line 447, in ensure_session
    return self.do_api_query(marshalled_request, versioned_url, method=method,
  File "/home/jptiz/.local/lib/python3.10/site-packages/zulipterminal/model.py", line 159, in _update_initial_data
    raise urwid.ExitMainLoop()
    session.headers.update({"User-agent": self.get_user_agent()})
  File "/home/jptiz/.local/lib/python3.10/site-packages/zulip/__init__.py", line 463, in get_user_agent
    session.headers.update({"User-agent": self.get_user_agent()})
  File "/home/jptiz/.local/lib/python3.10/site-packages/zulip/__init__.py", line 463, in get_user_agent
  File "/home/jptiz/.local/lib/python3.10/site-packages/zulip/__init__.py", line 501, in do_api_query
  File "/home/jptiz/.local/lib/python3.10/site-packages/zulip/__init__.py", line 463, in get_user_agent
    vendor, vendor_version, dummy = platform.linux_distribution()
    vendor, vendor_version, dummy = platform.linux_distribution()
AttributeError: module 'platform' has no attribute 'linux_distribution'
urwid.main_loop.ExitMainLoop
AttributeError: module 'platform' has no attribute 'linux_distribution'
    self.ensure_session()
    vendor, vendor_version, dummy = platform.linux_distribution()
Zulip Terminal has crashed!
  File "/home/jptiz/.local/lib/python3.10/site-packages/zulip/__init__.py", line 447, in ensure_session
AttributeError: module 'platform' has no attribute 'linux_distribution'
You can ask for help at:
    session.headers.update({"User-agent": self.get_user_agent()})
  File "/home/jptiz/.local/lib/python3.10/site-packages/zulip/__init__.py", line 463, in get_user_agent
https://chat.zulip.org/#narrow/stream/206-zulip-terminal

Some debugging

Looking at the end of installation log, zulip-term-0.2.1 is installed instead of 0.6.0:

$ pip install zulip-term
...
Installing collected packages: urwid, typing, zulip, urwid-readline, emoji, zulip-term
Successfully installed emoji-0.5.0 typing-3.6.4 urwid-2.0.1 urwid-readline-0.7 zulip-0.4.7 zulip-term-0.2.1

Getting the 0.6.0 .whl file and building it manually shows that 0.6.0 is incompatible with Python 3.10:

$ pip wheel zulip_term-0.6.0+git-py3-none-any.whl
Processing ./zulip_term-0.6.0+git-py3-none-any.whl
...
ERROR: Package 'zulip-term' requires a different Python: 3.10.1 not in '<3.10,>=3.6'

Which might be the cause, maybe it is falling back to a previous version which apparently didn't had any Python restrictions (at least checking 0.2.0 tagged commit's file tree).

@neiljp
Copy link
Collaborator

neiljp commented Dec 29, 2021

@JPTIZ Thanks for reporting this!

Your debugging seems accurate to me 👍 We don't (cannot?) say that we are compatible with future python versions, in the releases we make.

To summarize:

  • As you say, 0.6.0 itself is specified as incompatible with 3.10
  • At some published version we started supporting a specific range of python versions, which seems to be as far back as at least 0.3.1, but is not in 0.2.0
  • 0.2.1 was released, though I don't see a tag for it in the git log, and presumably didn't have a python constraint, so is likely the latest released version which is "compatible" with Python 3.10

Note that we extended support in main to a pre-release of 3.10 at the end of August with CI testing, and updated to 3.10 later, so the development branch in git should support 3.10 just fine - or at least as far as we know based on tests, since I'm not sure how much direct manual testing with that version it's received.

Are you using 3.10 with the main branch installed at the moment? Have things performed broadly OK?

I'm not sure how we can fix this for future python versions unless we avoid early versions from installing from pypi, though this is definitely an issue for the next release!

@neiljp neiljp added this to the Next Release milestone Dec 29, 2021
@neiljp neiljp added area: infrastructure Project infrastructure bug Something isn't working labels Dec 29, 2021
@JPTIZ
Copy link
Author

JPTIZ commented Dec 29, 2021

@JPTIZ Thanks for reporting this!

Your debugging seems accurate to me +1 We don't (cannot?) say that we are compatible with future python versions, in the releases we make.

And I agree, from a stability point of view at least. It is a safe decision that can rely on tools like pyenv if a prior Python version is needed to run zulip, although I would also agree if the decision was to accept newer versions until there is a stated breaking-change on a newer Python's release notes (e.g. when async was introduced as a keyword, which broke scripts where it was a variable name), as Python should have some level of backward compatibility.

...

Are you using 3.10 with the main branch installed at the moment? Have things performed broadly OK?

I'm not sure how we can fix this for future python versions unless we avoid early versions from installing from pypi, though this is definitely an issue for the next release!

Everything ok for now, didn't have any issues at all, or at least no new issues. All issues I have are known issues that I already had on Py3.9, such as the negative message count bug, eventual (sort of rare) freezes when writing on private messages and not being able to send private messages to someone who has accents (~) on its name. No crashes or any new problem emerging from Py3.10.

@neiljp
Copy link
Collaborator

neiljp commented Mar 4, 2022

@JPTIZ Just a note to say I've mentioned this issue in the documentation in #1159 and plan to close this after merging, using this for reference only.

I'm not sure if you're on chat.zulip.org (in which case I'd be happy to chat in #zulip-terminal or elsewhere), but otherwise I'd be interested to hear briefly here about anything which we don't have in a reported issue, which sounds like it could include accents on names? If there's a way we could improve that behavior that would be great; does that occur in the web app or mobile?

@JPTIZ
Copy link
Author

JPTIZ commented Mar 7, 2022

I'm not sure if you're on chat.zulip.org (in which case I'd be happy to chat in #zulip-terminal or elsewhere),

Now I am :)

but otherwise I'd be interested to hear briefly here about anything which we don't have in a reported issue, which sounds like it could include accents on names? If there's a way we could improve that behavior that would be great; does that occur in the web app or mobile?

Didn't try on mobile, but web-app works pretty fine. On zulip-terminal, though, it says it couldn't find user named <name of the person that has accents ("~" in my case) in its name>. Of course, it might be another thing, but the only difference I could notice was the accent on the "target" user of the message. As I have a accent in my chat.zulip.org username, we could try to test this there.

This and the miscounting of unread messages are the only issues I have currently.

@neiljp
Copy link
Collaborator

neiljp commented Mar 8, 2022

@JPTIZ I think I found you on #zulip-terminal, and started a new topic in there about the accent issue, so please do drop in :)

I'm going to close this now, since I've merged #1159.

@neiljp neiljp closed this as completed Mar 8, 2022
neiljp added a commit to neiljp/zulip-terminal that referenced this issue Apr 13, 2023
The note relating to zulip#1145 is retained, but testing in CI indicates a more
specific error is given if there is no matching python for a user's
environment - now that versions 0.2.0 and 0.2.1 have been yanked from PyPI.

Instead of a broken install of a very old version, a recent pip should error
with a message along the lines of
`ERROR: Package 'zulip-term' requires a different Python: 3.11.3 not in <3.11,>=3.7'`
neiljp added a commit to neiljp/zulip-terminal that referenced this issue Apr 13, 2023
The note relating to zulip#1145 is retained, but testing in CI indicates a more
specific error is given if there is no matching python for a user's
environment - now that versions 0.2.0 and 0.2.1 have been yanked from PyPI.

Instead of a broken install of a very old version, a recent pip should error
with a message along the lines of
`ERROR: Package 'zulip-term' requires a different Python: 3.11.3 not in <3.11,>=3.7'`
neiljp added a commit that referenced this issue Apr 14, 2023
The note relating to #1145 is retained, but testing in CI indicates a more
specific error is given if there is no matching python for a user's
environment - now that versions 0.2.0 and 0.2.1 have been yanked from PyPI.

Instead of a broken install of a very old version, a recent pip should error
with a message along the lines of
`ERROR: Package 'zulip-term' requires a different Python: 3.11.3 not in <3.11,>=3.7'`
Subhasish-Behera pushed a commit to Subhasish-Behera/zulip-terminal that referenced this issue Jun 25, 2023
The note relating to zulip#1145 is retained, but testing in CI indicates a more
specific error is given if there is no matching python for a user's
environment - now that versions 0.2.0 and 0.2.1 have been yanked from PyPI.

Instead of a broken install of a very old version, a recent pip should error
with a message along the lines of
`ERROR: Package 'zulip-term' requires a different Python: 3.11.3 not in <3.11,>=3.7'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: infrastructure Project infrastructure bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants