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

ci: Remove Python 3.8; add Python 3.12. #842

Merged
merged 3 commits into from
Dec 5, 2024
Merged

Conversation

Niloth-p
Copy link
Contributor

@Niloth-p Niloth-p commented Dec 3, 2024

Fixes: Failing CI for Py 3.8
Fixes: #829
Fixes: #841 can be closed as well.

Removes Python 3.8.
Adds Py 3.11 Zulip 7.0 to matrix strategy.
Adds Python 3.12.

Self-review checklist
  • Self-reviewed the changes for clarity and maintainability
    (variable names, code reuse, readability, etc.).

Communicate decisions, questions, and potential concerns.

  • Explains differences from previous plans (e.g., issue description).
  • Highlights technical choices and bugs encountered.
  • Calls out remaining decisions and concerns.
  • Automated tests verify logic where appropriate.

Individual commits are ready for review (see commit discipline).

  • Each commit is a coherent idea.
  • Commit message(s) explain reasoning and motivation for changes.

Completed manual review and testing of the following:

  • Visual appearance of the changes.
  • Responsiveness and internationalization.
  • Strings and tooltips.
  • End-to-end functionality of buttons, interactions and flows.
  • Corner cases, error conditions, and easily imagined bugs.

Use `importlib-metadata` for newer Python versions as well.

Fixes zulip#829.
@Niloth-p Niloth-p changed the title ci: Remove Python 3.8; add Python 3.11 to CI matrix. ci: Remove Python 3.8; add Python 3.12. Dec 4, 2024
Copy link
Contributor Author

@Niloth-p Niloth-p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-reviewed.

name: Debian 12 (Python 3.11, backend + documentation)
os: bookworm
legacy_client_interface: "7"
server_version: refs/tags/7.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Earliest major Zulip version that has the same entry in its matrix.

name: Ubuntu 24.04 (Python 3.12, backend)
os: noble
legacy_client_interface: "8"
server_version: refs/tags/8.5
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Earliest minor Zulip version that supports the platform is 8.3.

But, 8.3 and 8.4 are unable to use pip inside the venv, due to version conflicts related to pkg_resources. Only versions 8.5 onwards seem to be working.

Traceback
Traceback (most recent call last):
  File "/srv/zulip-py3-venv/bin/pip", line 5, in <module>
    from pip._internal.cli.main import main
  File "/srv/zulip-venv-cache/e2c2c053635e882ff393067adf908813bcad92ef/zulip-py3-venv/lib/python3.12/site-packages/pip/_internal/cli/main.py", line 10, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/srv/zulip-venv-cache/e2c2c053635e882ff393067adf908813bcad92ef/zulip-py3-venv/lib/python3.12/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/srv/zulip-venv-cache/e2c2c053635e882ff393067adf908813bcad92ef/zulip-py3-venv/lib/python3.12/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
    from pip._internal.cli import cmdoptions
  File "/srv/zulip-venv-cache/e2c2c053635e882ff393067adf908813bcad92ef/zulip-py3-venv/lib/python3.12/site-packages/pip/_internal/cli/cmdoptions.py", line 25, in <module>
    from pip._internal.cli.progress_bars import BAR_TYPES
  File "/srv/zulip-venv-cache/e2c2c053635e882ff393067adf908813bcad92ef/zulip-py3-venv/lib/python3.12/site-packages/pip/_internal/cli/progress_bars.py", line 12, in <module>
    from pip._internal.utils.logging import get_indentation
  File "/srv/zulip-venv-cache/e2c2c053635e882ff393067adf908813bcad92ef/zulip-py3-venv/lib/python3.12/site-packages/pip/_internal/utils/logging.py", line 18, in <module>
    from pip._internal.utils.misc import ensure_dir
  File "/srv/zulip-venv-cache/e2c2c053635e882ff393067adf908813bcad92ef/zulip-py3-venv/lib/python3.12/site-packages/pip/_internal/utils/misc.py", line 21, in <module>
    from pip._vendor import pkg_resources
  File "/srv/zulip-venv-cache/e2c2c053635e882ff393067adf908813bcad92ef/zulip-py3-venv/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3254, in <module>
    @_call_aside
     ^^^^^^^^^^^
  File "/srv/zulip-venv-cache/e2c2c053635e882ff393067adf908813bcad92ef/zulip-py3-venv/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3238, in _call_aside
    f(*args, **kwargs)
  File "/srv/zulip-venv-cache/e2c2c053635e882ff393067adf908813bcad92ef/zulip-py3-venv/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3280, in _initialize_master_working_set
    tuple(
  File "/srv/zulip-venv-cache/e2c2c053635e882ff393067adf908813bcad92ef/zulip-py3-venv/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3281, in <genexpr>
    dist.activate(replace=False)
  File "/srv/zulip-venv-cache/e2c2c053635e882ff393067adf908813bcad92ef/zulip-py3-venv/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2788, in activate
    declare_namespace(pkg)
  File "/srv/zulip-venv-cache/e2c2c053635e882ff393067adf908813bcad92ef/zulip-py3-venv/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2285, in declare_namespace
    _handle_ns(packageName, path_item)
  File "/srv/zulip-venv-cache/e2c2c053635e882ff393067adf908813bcad92ef/zulip-py3-venv/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2202, in _handle_ns
    loader = importer.find_module(packageName)
             ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'FileFinder' object has no attribute 'find_module'

os: bookworm
legacy_client_interface: "7"
server_version: refs/tags/7.0
# Ubuntu 24.04 ships with Python 3.12.3.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though, the Zulip workflow mentions 3.12.2, the actual version used now seems to be 3.12.3.

@@ -56,7 +56,7 @@
"lxml",
"BeautifulSoup4",
"typing_extensions>=4.5.0",
'importlib-metadata >= 3.6; python_version < "3.10"',
"importlib-metadata>=3.6",
Copy link
Contributor Author

@Niloth-p Niloth-p Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for #829, included in this commit as it is necessary for the Py 3.12 tests (but not for the 3.11 one).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, isn't the point of #829 that we can just drop this dependency and use the built-in module in 3.10? Or do we need to wait until we drop 3.9 support to drop it?

Copy link
Contributor Author

@Niloth-p Niloth-p Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can't drop it before dropping 3.9 support.
We could conditionally use the built-in module for >=3.10 without waiting until the dependency is dropped though.

@Niloth-p Niloth-p marked this pull request as ready for review December 4, 2024 06:40
@timabbott timabbott merged commit a56304d into zulip:main Dec 5, 2024
14 checks passed
@timabbott
Copy link
Member

Seems OK, merged, thanks @Niloth-p!

@Niloth-p Niloth-p deleted the ci-11 branch December 6, 2024 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants