Skip to content

Commit

Permalink
ci: Add Python 3.12.
Browse files Browse the repository at this point in the history
Use `importlib-metadata` for newer Python versions as well.

Fixes #829.
  • Loading branch information
Niloth-p authored and timabbott committed Dec 5, 2024
1 parent f785e31 commit a56304d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/zulip-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ jobs:
os: bookworm
legacy_client_interface: "7"
server_version: refs/tags/7.0
# Ubuntu 24.04 ships with Python 3.12.3.
- docker_image: zulip/ci:noble
name: Ubuntu 24.04 (Python 3.12, backend)
os: noble
legacy_client_interface: "8"
server_version: refs/tags/8.5

runs-on: ubuntu-latest
name: ${{ matrix.name }} (Zulip ${{matrix.server_version}})
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zulip-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions zulip/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def recur_expand(target_root: Any, dir: Any) -> Generator[Tuple[str, List[str]],
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
python_requires=">=3.9",
url="https://www.zulip.org/",
Expand Down
3 changes: 2 additions & 1 deletion zulip_bots/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
python_requires=">=3.9",
url="https://www.zulip.org/",
Expand All @@ -55,7 +56,7 @@
"lxml",
"BeautifulSoup4",
"typing_extensions>=4.5.0",
'importlib-metadata >= 3.6; python_version < "3.10"',
"importlib-metadata>=3.6",
],
packages=find_packages(),
package_data=package_data,
Expand Down
5 changes: 0 additions & 5 deletions zulip_bots/zulip_bots/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ class DuplicateRegisteredBotNameError(Exception):


def import_module_from_zulip_bot_registry(name: str) -> Tuple[str, Optional[ModuleType]]:
# Prior to Python 3.10, calling importlib.metadata.entry_points returns a
# SelectableGroups object when no parameters is given. Currently we use
# the importlib_metadata library for compatibility, but we need to migrate
# to the built-in library when we start to adapt Python 3.10.
# https://importlib-metadata.readthedocs.io/en/latest/using.html#entry-points
registered_bots = metadata.entry_points(group="zulip_bots.registry")
matching_bots = [bot for bot in registered_bots if bot.name == name]

Expand Down
1 change: 1 addition & 0 deletions zulip_botserver/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
python_requires=">=3.9",
url="https://www.zulip.org/",
Expand Down

0 comments on commit a56304d

Please sign in to comment.