Skip to content

Conversation

@mattpap
Copy link
Contributor

@mattpap mattpap commented Jan 4, 2024

This PR drops support for Python 3.9 and takes advantage of the following PEPs: 634 (pattern matching), 604 (A | B), 613 (TypeAlias), 647 (TypeGuard). I converted a few obvious cases from if-elif-else to match-case as a trial run. I tenatatively added this PR to 3.4 milestone, but I suppose we may want to postpone this till 3.5.

fixes #13515

@mattpap mattpap added status: ready type: task tag: codebase Improvements to code quality without affecting any functionality. labels Jan 4, 2024
@mattpap mattpap added this to the 3.4 milestone Jan 4, 2024
@codecov
Copy link

codecov bot commented Jan 4, 2024

Codecov Report

Attention: Patch coverage is 90.57971% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 92.60%. Comparing base (8a5a35e) to head (f6dacf0).
Report is 18 commits behind head on branch-3.5.

Additional details and impacted files
@@              Coverage Diff               @@
##           branch-3.5   #13634      +/-   ##
==============================================
+ Coverage       92.59%   92.60%   +0.01%     
==============================================
  Files             326      325       -1     
  Lines           20735    20732       -3     
==============================================
  Hits            19199    19199              
+ Misses           1536     1533       -3     

@bryevdv
Copy link
Member

bryevdv commented Jan 4, 2024

This is a nice minpy-bump, as they go. NEP 29 data for dropping Python 3.9 is Apr 05, 2024 so Bokeh 3.5 is probably ideal.

@mattpap mattpap force-pushed the mattpap/drop_python_3.9 branch from 07eae37 to e4a9cb4 Compare January 4, 2024 23:50
@mattpap
Copy link
Contributor Author

mattpap commented Jan 4, 2024

NEP 29 data for dropping Python 3.9 is Apr 05, 2024 so Bokeh 3.5 is probably ideal.

Our BEP 9 says it should be at least 3 months after the most recent Python release, which is about now. With pushing this to 3.5 I was thinking about panel.

@philippjfr
Copy link
Contributor

+1 on waiting until 3.5. That said I would suggest that we amend BEP 9 to align with NEP 29 if they are indeed not synced. I would consider NEP 29 quite aggressive and would not want to be out ahead of them.

@bryevdv
Copy link
Member

bryevdv commented Jan 19, 2024

@philippjfr we can revisit, but the original rationale for the difference from NEP-29 is here #10558 (comment) It's possible NEP-29 has also been updated since then too.

@mattpap mattpap force-pushed the mattpap/drop_python_3.9 branch from e4a9cb4 to f6dacf0 Compare March 7, 2024 09:39
@mattpap mattpap changed the base branch from branch-3.4 to branch-3.5 March 14, 2024 16:51
@bryevdv
Copy link
Member

bryevdv commented Mar 14, 2024

@mattpap I'd suggest merging this sooner rather than later in order to shave some work off our CI pipeline

@mattpap mattpap merged commit 9640218 into branch-3.5 Mar 14, 2024
@mattpap mattpap deleted the mattpap/drop_python_3.9 branch March 14, 2024 17:34
Chiemezuo pushed a commit to Chiemezuo/bokeh that referenced this pull request Aug 27, 2024
* Drop support for python 3.9

* Use str.remove{prefix,suffix}()

* Replace {typing_extensions->typing}.TypeGuard

* Use `A | B` instead of `Union[A, B]`

* Replace {typing_extensions->typing}.TypeAlias

* Try out pattern matching instead of if-elif-else

* Update dependencies in minimal-deps

* Disable bokeh-docker-test
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

reso: completed status: accepted tag: codebase Improvements to code quality without affecting any functionality. type: task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI unit-test on Python 3.9 fails systematically

4 participants