Skip to content

Conversation

neiljp
Copy link
Collaborator

@neiljp neiljp commented Nov 2, 2023

What does this PR do, and why?

This was motivated by confirming which python was being used for running ZT, originally in the context of testing locally with python 3.12 and others (eg. for #1379).

Having this information included is also useful to users, as well as for having feedback from them. Initial console output is therefore updated to show this, and included in the About popup in a new Detected Environment category, including the platform - which resolves the last part of #1216.

In much the same way as the detected platform, a test step is also added to CI to ensure that the expected python version matches that detected.

Note that this includes the platform (CPython vs PyPy), and if present the branch - which appears to be where the PyPy implementation version is stored.

This also includes an infrastructure simplification to avoid MacOS testing on 3.x, which was a simple way to test on the latest version, but randomly breaks CI if version support is not updated - and would require a special case for python environment detection.

Outstanding aspect(s)

External discussion & connections

  • Discussed in #zulip-terminal in topic
  • Fully fixes #
  • Partially fixes issue #
  • Builds upon previous unmerged work in PR #
  • Is a follow-up to work in PR #
  • Requires merge of PR #
  • Merge will enable work on #

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

Visual changes

This extracts the mocking to occur automatically given a platform
string, and provide the expected output text, which is tested in various
tests.
Tests and fixture updated.
@zulipbot zulipbot added the size: L [Automatic label added by zulipbot] label Nov 2, 2023
@neiljp neiljp force-pushed the 2023-10-24-python-version-detection branch 3 times, most recently from 067c461 to a27e393 Compare November 3, 2023 00:18
Using '3.x' automatically selected a high single version of python on
MacOS.

However, it bumped the python version over the version that we support,
breaking with no warning - and also using different python versions
between PRs.

This could be useful to have with a manual trigger, or if it did not
break regular builds.

This is an effective revert of d8bae88.
Note that a side-effect of the change to use a specific python version
on MacOS in a recent commit is that this platform does not need to be
excluded manually.
This includes the established Platform (PLATFORM), and the recent
addition of the python version and implementation.

Test updated.
@neiljp neiljp force-pushed the 2023-10-24-python-version-detection branch from 6c5378a to e10b610 Compare November 3, 2023 06:27
@zulipbot zulipbot added size: XL [Automatic label added by zulipbot] and removed size: L [Automatic label added by zulipbot] labels Nov 3, 2023
@neiljp neiljp marked this pull request as ready for review November 3, 2023 21:51
@neiljp neiljp added the area: infrastructure Project infrastructure label Nov 6, 2023
@neiljp neiljp added this to the Next Release milestone Nov 6, 2023
@neiljp neiljp merged commit abdc454 into zulip:main Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: infrastructure Project infrastructure size: XL [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants