Skip to content

Commit a56304d

Browse files
Niloth-ptimabbott
authored andcommitted
ci: Add Python 3.12.
Use `importlib-metadata` for newer Python versions as well. Fixes zulip#829.
1 parent f785e31 commit a56304d

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

.github/workflows/zulip-ci.yml

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ jobs:
3535
os: bookworm
3636
legacy_client_interface: "7"
3737
server_version: refs/tags/7.0
38+
# Ubuntu 24.04 ships with Python 3.12.3.
39+
- docker_image: zulip/ci:noble
40+
name: Ubuntu 24.04 (Python 3.12, backend)
41+
os: noble
42+
legacy_client_interface: "8"
43+
server_version: refs/tags/8.5
3844

3945
runs-on: ubuntu-latest
4046
name: ${{ matrix.name }} (Zulip ${{matrix.server_version}})

.github/workflows/zulip-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
fail-fast: false
3333
matrix:
3434
os: [ubuntu-latest, windows-latest]
35-
python-version: ["3.9", "3.10", "3.11"]
35+
python-version: ["3.9", "3.10", "3.11", "3.12"]
3636

3737
steps:
3838
- uses: actions/checkout@v4

zulip/setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def recur_expand(target_root: Any, dir: Any) -> Generator[Tuple[str, List[str]],
4545
"Programming Language :: Python :: 3.9",
4646
"Programming Language :: Python :: 3.10",
4747
"Programming Language :: Python :: 3.11",
48+
"Programming Language :: Python :: 3.12",
4849
],
4950
python_requires=">=3.9",
5051
url="https://www.zulip.org/",

zulip_bots/setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"Programming Language :: Python :: 3.9",
3636
"Programming Language :: Python :: 3.10",
3737
"Programming Language :: Python :: 3.11",
38+
"Programming Language :: Python :: 3.12",
3839
],
3940
python_requires=">=3.9",
4041
url="https://www.zulip.org/",
@@ -55,7 +56,7 @@
5556
"lxml",
5657
"BeautifulSoup4",
5758
"typing_extensions>=4.5.0",
58-
'importlib-metadata >= 3.6; python_version < "3.10"',
59+
"importlib-metadata>=3.6",
5960
],
6061
packages=find_packages(),
6162
package_data=package_data,

zulip_bots/zulip_bots/finder.py

-5
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ class DuplicateRegisteredBotNameError(Exception):
3535

3636

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

zulip_botserver/setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"Programming Language :: Python :: 3.9",
2424
"Programming Language :: Python :: 3.10",
2525
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
2627
],
2728
python_requires=">=3.9",
2829
url="https://www.zulip.org/",

0 commit comments

Comments
 (0)