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

Add support for Python 3.12 #1541

Closed
wants to merge 2 commits into from
Closed

Conversation

punchagan
Copy link
Member

@punchagan punchagan commented Aug 2, 2024

What does this PR do, and why?

Allows developing and installing zulip-terminal with Python 3.12.

External discussion & connections

How did you test this?

  • Manually - Behavioral changes
  • Manually - Visual changes
  • Adapting existing automated tests
  • Adding automated tests for new behavior (or missing tests)
  • Existing automated tests should already cover this (only a refactor of tested code)

Self-review checklist for each commit

  • It is a minimal coherent idea
  • It has a commit summary following the documented style (title & body)
  • It has a commit summary describing the motivation and reasoning for the change
  • It individually passes linting and tests
  • It contains test additions for any new behavior
  • It flows clearly from a previous branch commit, and/or prepares for the next commit

Bump up the version of typing_extensions to allow supporting Python
3.12, along with all the versions currently supported. The latest
version of the library doesn't support Python 3.7. So, this commit
chooses a version that supports both Python 3.7 and 3.12.
@zulipbot zulipbot added the size: XS [Automatic label added by zulipbot] label Aug 2, 2024
@Niloth-p
Copy link
Collaborator

Niloth-p commented Aug 2, 2024

I'm not familiar enough with dependency version management to review this, but I gave it a shot anyways.

  • Just went through this list checking for any deprecations, and it looks like we're good on that front.

  • Mypy ran into some errors when running linting for tests/.
    pytest imports numpy and exceptiongroup. Using:

if TYPE_CHECKING:
	from numpy import ndarray

And I get the error: Cannot find implementation or library stub for module named "exceptiongroup"/"numpy" [import-not-found]

I assume it's something to do with typing compatibility?

Github Actions must not have caught it since it does linting only on 3.8.
But, how come I'm getting them but you're not? Do you use PyPy or something, or am I doing something wrong? I tried with CPython 3.12.2.

@punchagan
Copy link
Member Author

punchagan commented Aug 2, 2024

I'm not familiar enough with dependency version management to review this, but I gave it a shot anyways.

Thanks for taking the time to do the review!

But, how come I'm getting them but you're not? Do you use PyPy or something, or am I doing something wrong? I tried with CPython 3.12.2.

I'm using CPython 3.12.3 that comes with my distro. How did you setup 3.12.2? Can you share the full traceback?

@punchagan
Copy link
Member Author

Duplicate #1379

@punchagan punchagan closed this Aug 5, 2024
@punchagan punchagan deleted the update-typing-ext branch August 5, 2024 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: XS [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants