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

Support Python 3.8 #478

Merged
merged 4 commits into from
Jan 2, 2020
Merged

Support Python 3.8 #478

merged 4 commits into from
Jan 2, 2020

Conversation

neiljp
Copy link
Collaborator

@neiljp neiljp commented Nov 7, 2019

This PR primarily adds a Python 3.8 test entry in Travis and claims support for installation with it via setup.py.

We no longer need special options to test Python 3.7 (or 3.8), so I've removed this too.

NOTE: Pending a later release of the zulip package, I'm keeping this as a draft for now, since while the tests run fine, the current released zulip API version doesn't support 3.8. I've tested this is the case using a docker image.

@zulipbot zulipbot added the size: S [Automatic label added by zulipbot] label Nov 7, 2019
setup.py Outdated Show resolved Hide resolved
@LeifW
Copy link

LeifW commented Dec 12, 2019

Trying to run on python 3.8, after I login, it crashes with:

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): %20https:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): inner-product.zulipchat.com:443
DEBUG:urllib3.connectionpool:https://inner-product.zulipchat.com:443 "POST /api/v1/fetch_api_key HTTP/1.1" 200 None
INFO:root:

module 'platform' has no attribute 'linux_distribution'


ERROR:root:module 'platform' has no attribute 'linux_distribution'
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/zulipterminal/cli/run.py", line 241, in main
    Controller(zuliprc_path,
  File "/usr/lib/python3.8/site-packages/zulipterminal/core.py", line 40, in __init__
    self.model = Model(self)
  File "/usr/lib/python3.8/site-packages/zulipterminal/model.py", line 109, in __init__
    self._update_initial_data()
  File "/usr/lib/python3.8/site-packages/zulipterminal/model.py", line 440, in _update_initial_data
    results = {
  File "/usr/lib/python3.8/site-packages/zulipterminal/model.py", line 441, in <dictcomp>
    name: self.exception_safe_result(future)
  File "/usr/lib/python3.8/site-packages/zulipterminal/model.py", line 386, in exception_safe_result
    return future.result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
    raise self._exception
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.8/site-packages/zulipterminal/model.py", line 353, in get_messages
    response = self.client.get_messages(message_filters=request)
  File "/usr/lib/python3.8/site-packages/zulip/__init__.py", line 703, in get_messages
    return self.call_endpoint(
  File "/usr/lib/python3.8/site-packages/zulip/__init__.py", line 623, in call_endpoint
    return self.do_api_query(marshalled_request, versioned_url, method=method,
  File "/usr/lib/python3.8/site-packages/zulip/__init__.py", line 505, in do_api_query
    self.ensure_session()
  File "/usr/lib/python3.8/site-packages/zulip/__init__.py", line 450, in ensure_session
    session.headers.update({"User-agent": self.get_user_agent()})
  File "/usr/lib/python3.8/site-packages/zulip/__init__.py", line 466, in get_user_agent
    vendor, vendor_version, dummy = platform.linux_distribution()
AttributeError: module 'platform' has no attribute 'linux_distribution'

This says that's been removed in Python 3.8: pymssql/pymssql#586

@neiljp
Copy link
Collaborator Author

neiljp commented Dec 12, 2019

@LeifW The issue you are seeing is within the zulip library; there is a fix in that repo and a release of that is pending right now.

@LeifW
Copy link

LeifW commented Dec 12, 2019

Found zulip/python-zulip-api#530

@neiljp neiljp marked this pull request as ready for review December 15, 2019 06:30
@neiljp neiljp force-pushed the 2019-11-python-3.8 branch 2 times, most recently from 432fbe2 to 723f9fd Compare December 19, 2019 06:20
Travis no longer requires these settings for Python 3.7 to work.
The zulip package containing the Zulip Python API fails under Python 3.8
prior to version 0.6.3, which in turn prevents zulip-term from running
under that python version unless we depend on this updated dependency.
@neiljp neiljp force-pushed the 2019-11-python-3.8 branch 3 times, most recently from 6acd602 to cda8f22 Compare January 1, 2020 23:47
@neiljp
Copy link
Collaborator Author

neiljp commented Jan 2, 2020

After a brief confusion over whether pipenv was breaking things, I'm merging this now so that we can get things tested - it seems OK in CI 👍

@neiljp neiljp merged commit f7b3b7f into zulip:master Jan 2, 2020
@neiljp
Copy link
Collaborator Author

neiljp commented Jan 2, 2020

@LeifW Please let us know if the latest development version has any 3.8-related issues for you here, or in a new issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: S [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants