From b5302ab52273d6ddfe946002b6625ae3cb39113d Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 26 Oct 2022 13:13:37 +0200 Subject: [PATCH] Upgrade to Python 3.11 (#5678) * upgrade to Python 3.11 * compatibility fixes --- .github/python-version.txt | 2 +- .github/workflows/main.yml | 8 +++++--- CHANGELOG.md | 2 ++ mitmproxy/master.py | 2 +- release/docker/Dockerfile | 4 ++-- setup.py | 7 ++++--- tox.ini | 4 ++-- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/python-version.txt b/.github/python-version.txt index c8cfe3959..2c0733315 100644 --- a/.github/python-version.txt +++ b/.github/python-version.txt @@ -1 +1 @@ -3.10 +3.11 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4ed8a1cc3..dc6144eaa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -70,13 +70,15 @@ jobs: matrix: include: - os: ubuntu-latest - py: "3.10" + py: "3.11" - os: windows-latest - py: "3.10" + py: "3.11" - os: macos-latest + py: "3.11" + - os: ubuntu-latest py: "3.10" - os: ubuntu-latest - py: 3.9 + py: "3.9" runs-on: ${{ matrix.os }} steps: - run: printenv diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a102d699..88a3df7e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ ([#5487](https://github.com/mitmproxy/mitmproxy/pull/5487), @mhils) * Fix `tls_version_server_min` and `tls_version_server_max` options. ([#5546](https://github.com/mitmproxy/mitmproxy/issues/5546), @mhils) +* Mitmproxy binaries now ship with Python 3.11. + ([#5678](https://github.com/mitmproxy/mitmproxy/issues/5678), @mhils) * DTLS support ([#5397](https://github.com/mitmproxy/mitmproxy/pull/5397), @kckeiks). * Added Magisk module generation for Android onboarding (@jorants). * Update Linux binary builder to Ubuntu 20.04, bumping the minimum glibc version to 2.31. (@jorants) diff --git a/mitmproxy/master.py b/mitmproxy/master.py index bfb457d34..3e5f248b6 100644 --- a/mitmproxy/master.py +++ b/mitmproxy/master.py @@ -38,7 +38,7 @@ class Master: try: self.should_exit = asyncio.Event() except RuntimeError: # python 3.9 and below - self.should_exit = asyncio.Event(loop=self.event_loop) + self.should_exit = asyncio.Event(loop=self.event_loop) # type: ignore mitmproxy_ctx.master = self mitmproxy_ctx.log = self.log # deprecated, do not use. mitmproxy_ctx.options = self.options diff --git a/release/docker/Dockerfile b/release/docker/Dockerfile index 0ebf71ec0..64f1dd56d 100644 --- a/release/docker/Dockerfile +++ b/release/docker/Dockerfile @@ -1,10 +1,10 @@ -FROM python:3.10-bullseye as wheelbuilder +FROM python:3.11-bullseye as wheelbuilder ARG MITMPROXY_WHEEL COPY $MITMPROXY_WHEEL /wheels/ RUN pip install wheel && pip wheel --wheel-dir /wheels /wheels/${MITMPROXY_WHEEL} -FROM python:3.10-slim-bullseye +FROM python:3.11-slim-bullseye RUN useradd -mU mitmproxy RUN apt-get update \ diff --git a/setup.py b/setup.py index cbf32566b..2fa2e5dc3 100644 --- a/setup.py +++ b/setup.py @@ -38,6 +38,7 @@ setup( "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Security", "Topic :: Internet :: WWW/HTTP", @@ -107,15 +108,15 @@ setup( "hypothesis>=5.8,<7", "parver>=0.1,<2.0", "pdoc>=4.0.0", - "pyinstaller==5.5", - "pytest-asyncio>=0.17,<0.20", + "pyinstaller==5.6", + "pytest-asyncio>=0.17,<0.21", "pytest-cov>=2.7.1,<4.1", "pytest-timeout>=1.3.3,<2.2", "pytest-xdist>=2.1.0,<3", "pytest>=6.1.0,<8", "requests>=2.9.1,<3", "tox>=3.5,<4", - "wheel>=0.36.2,<0.38", + "wheel>=0.36.2,<0.39", ], }, ) diff --git a/tox.ini b/tox.ini index 51e1dcb28..4d0d6ed23 100644 --- a/tox.ini +++ b/tox.ini @@ -34,8 +34,8 @@ deps = types-Flask==1.1.6 types-Werkzeug==1.0.9 types-requests==2.28.11.2 - types-cryptography==3.3.23 - types-pyOpenSSL==22.1.0.0 + types-cryptography==3.3.23.1 + types-pyOpenSSL==22.1.0.1 -e .[dev] commands =