From c94da617ed2d2202233ba60b7646e2dd2e49f3dc Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 24 Jan 2023 11:07:21 -0800 Subject: [PATCH] Remove Python 3.6; add Python 3.10. Signed-off-by: Anders Kaseorg --- .github/workflows/zulip-ci.yml | 44 ++++++------------- .github/workflows/zulip-tests.yml | 11 ++--- pyproject.toml | 2 +- zulip/README.md | 2 +- .../bridge_with_matrix/test_matrix.py | 2 +- zulip/setup.py | 4 +- zulip_bots/setup.py | 4 +- .../zulip_bots/bots/chessbot/requirements.txt | 3 +- zulip_botserver/setup.py | 4 +- 9 files changed, 28 insertions(+), 48 deletions(-) diff --git a/.github/workflows/zulip-ci.yml b/.github/workflows/zulip-ci.yml index b2667bd..67b6b64 100644 --- a/.github/workflows/zulip-ci.yml +++ b/.github/workflows/zulip-ci.yml @@ -17,33 +17,24 @@ jobs: fail-fast: false matrix: include: - # Base images are built using `tools/ci/Dockerfile.prod.template`. - # The comments at the top explain how to build and upload these images. - # Bionic ships with Python 3.6. - - docker_image: zulip/ci:bionic - name: Ubuntu 18.04 Bionic (Python 3.6, backend) - os: bionic - is_bionic: true - include_frontend_tests: false - # Configure this test to run with the Zulip 3.2 release. - legacy_client_interface: 3 - server_version: refs/tags/3.2 - # Focal ships with Python 3.8.2. + # Focal ships with Python 3.8.10. - docker_image: zulip/ci:focal - name: Ubuntu 20.04 Focal (Python 3.8, backend) + name: Ubuntu 20.04 (Python 3.8, backend) os: focal - is_focal: true - include_frontend_tests: false - legacy_client_interface: 4 - server_version: refs/tags/4.0 + legacy_client_interface: "3" + server_version: refs/tags/3.2 # Bullseye ships with Python 3.9.2. - docker_image: zulip/ci:bullseye - name: Debian 11 Bullseye (Python 3.9, backend) + name: Debian 11 (Python 3.9, backend) os: bullseye - is_bullseye: true - include_frontend_tests: false - legacy_client_interface: 4 + legacy_client_interface: "4" server_version: refs/tags/4.0 + # Ubuntu 22.04 ships with Python 3.10.6. + - docker_image: zulip/ci:jammy + name: Ubuntu 22.04 (Python 3.10, backend) + os: jammy + legacy_client_interface: "6" + server_version: refs/tags/6.0 runs-on: ubuntu-latest name: ${{ matrix.name }} (Zulip ${{matrix.server_version}}) @@ -58,25 +49,18 @@ jobs: HOME: /home/github/ steps: - - name: 'Checkout python-zulip-api' + - name: "Check out python-zulip-api" uses: actions/checkout@v2 with: path: api - - name: 'Checkout Zulip server ${{ matrix.server_version }}' + - name: "Check out Zulip server ${{ matrix.server_version }}" uses: actions/checkout@v2 with: repository: zulip/zulip ref: ${{ matrix.server_version }} path: server - - name: Do Bionic hack - if: ${{ matrix.is_bionic }} - run: | - # Temporary hack till `sudo service redis-server start` gets fixes in Bionic. See - # https://chat.zulip.org/#narrow/stream/3-backend/topic/Ubuntu.20bionic.20CircleCI - sudo sed -i '/^bind/s/bind.*/bind 0.0.0.0/' /etc/redis/redis.conf - - name: Install dependencies run: | cd server diff --git a/.github/workflows/zulip-tests.yml b/.github/workflows/zulip-tests.yml index fb01449..b06fbb1 100644 --- a/.github/workflows/zulip-tests.yml +++ b/.github/workflows/zulip-tests.yml @@ -13,10 +13,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Setup Python 3.6 + - name: Set up Python 3.7 uses: actions/setup-python@v2 with: - python-version: 3.6 + python-version: "3.7" - name: Install dependencies run: tools/provision --force @@ -32,15 +32,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python-version: [3.6, 3.7, 3.8, 3.9] - exclude: - - os: windows-latest - python-version: 3.6 # cryptography install fails on Windows with python 3.6 since pip is quite old. + python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 - - name: Setup Python ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} diff --git a/pyproject.toml b/pyproject.toml index 577099b..031d919 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.black] line-length = 100 -target-version = ["py36"] +target-version = ["py37"] [tool.isort] src_paths = [ diff --git a/zulip/README.md b/zulip/README.md index 2472b3e..40bcc8f 100644 --- a/zulip/README.md +++ b/zulip/README.md @@ -3,7 +3,7 @@ The [Zulip API](https://zulip.com/api) Python bindings require the following dependencies: -* **Python (version >= 3.6)** +* **Python (version >= 3.7)** * requests (version >= 0.12.1) **Note**: If you'd like to use the Zulip bindings with Python 2, we diff --git a/zulip/integrations/bridge_with_matrix/test_matrix.py b/zulip/integrations/bridge_with_matrix/test_matrix.py index 034ed83..0881fbe 100644 --- a/zulip/integrations/bridge_with_matrix/test_matrix.py +++ b/zulip/integrations/bridge_with_matrix/test_matrix.py @@ -41,7 +41,7 @@ topic = matrix ZULIP_MESSAGE_TEMPLATE: str = "**{username}** [{uid}]: {message}" -# For Python 3.6 compatibility. +# For Python 3.7 compatibility. # (Since 3.8, there is unittest.IsolatedAsyncioTestCase!) # source: https://stackoverflow.com/a/46324983 def async_test(coro: Callable[..., Awaitable[Any]]) -> Callable[..., Any]: diff --git a/zulip/setup.py b/zulip/setup.py index 7c22ff3..c859bfc 100755 --- a/zulip/setup.py +++ b/zulip/setup.py @@ -42,12 +42,12 @@ setup( "License :: OSI Approved :: Apache Software License", "Topic :: Communications :: Chat", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], - python_requires=">=3.6", + python_requires=">=3.7", url="https://www.zulip.org/", project_urls={ "Source": "https://github.com/zulip/python-zulip-api/", diff --git a/zulip_bots/setup.py b/zulip_bots/setup.py index 778ed8c..8f6f753 100644 --- a/zulip_bots/setup.py +++ b/zulip_bots/setup.py @@ -34,12 +34,12 @@ setup( "License :: OSI Approved :: Apache Software License", "Topic :: Communications :: Chat", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], - python_requires=">=3.6", + python_requires=">=3.7", url="https://www.zulip.org/", project_urls={ "Source": "https://github.com/zulip/python-zulip-api/", diff --git a/zulip_bots/zulip_bots/bots/chessbot/requirements.txt b/zulip_bots/zulip_bots/bots/chessbot/requirements.txt index a74127a..e879b1b 100644 --- a/zulip_bots/zulip_bots/bots/chessbot/requirements.txt +++ b/zulip_bots/zulip_bots/bots/chessbot/requirements.txt @@ -1,2 +1 @@ -python-chess==0.31.* ; python_version < '3.7' -chess==1.* ; python_version >= '3.7' +chess==1.* diff --git a/zulip_botserver/setup.py b/zulip_botserver/setup.py index ff421ad..0ead13a 100644 --- a/zulip_botserver/setup.py +++ b/zulip_botserver/setup.py @@ -22,12 +22,12 @@ setup( "License :: OSI Approved :: Apache Software License", "Topic :: Communications :: Chat", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], - python_requires=">=3.6", + python_requires=">=3.7", url="https://www.zulip.org/", project_urls={ "Source": "https://github.com/zulip/python-zulip-api/",