From 4633cd4834bf87dbeb4da0aa9b91e194ea0c9255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 9 May 2022 11:25:11 -0500 Subject: [PATCH 01/11] =?UTF-8?q?=E2=9C=85=20Enable=20tests=20for=20Python?= =?UTF-8?q?=203.11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f0a82344e43ad..3d26ebe513f83 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11.0-beta.1"] fail-fast: false steps: From d99a4c02c4408175846ca4d25276cd92019504d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 11 Jul 2022 21:35:02 +0200 Subject: [PATCH 02/11] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20Python=203?= =?UTF-8?q?.11=20to=20beta=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d26ebe513f83..c7f7c1fbfa2f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11.0-beta.1"] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11.0-beta.3"] fail-fast: false steps: From 79249636c459d6dde2ca5ec99b289ad7d393c8ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 11 Jul 2022 21:35:28 +0200 Subject: [PATCH 03/11] =?UTF-8?q?=F0=9F=8D=BB=20Temporarily=20disable=20in?= =?UTF-8?q?stalling=20all=20the=20extras=20to=20try=20and=20run=20the=20te?= =?UTF-8?q?sts=20for=20Python=203.11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c7f7c1fbfa2f2..99174813e0e80 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,9 @@ jobs: run: pip install flit - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' - run: flit install --symlink + # TODO: remove --deps test, this is only to test running the tests in Python 3.11 + run: flit install --symlink --deps test + # run: flit install --symlink - name: Lint if: ${{ matrix.python-version != '3.6' }} run: bash scripts/lint.sh From 99ad4b1de4bbda63e2866c03632d10358580fa1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 11 Jul 2022 21:38:02 +0200 Subject: [PATCH 04/11] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Flit=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 99174813e0e80..f3ce9564e7860 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,7 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' # TODO: remove --deps test, this is only to test running the tests in Python 3.11 - run: flit install --symlink --deps test + run: flit install --symlink --extras test # run: flit install --symlink - name: Lint if: ${{ matrix.python-version != '3.6' }} From 7f78a41fc3eb84570cb38e040e89564709498c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 11 Jul 2022 23:36:59 +0200 Subject: [PATCH 05/11] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Update=20Flit=20inst?= =?UTF-8?q?all=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f3ce9564e7860..17004ced5f3eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,7 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' # TODO: remove --deps test, this is only to test running the tests in Python 3.11 - run: flit install --symlink --extras test + run: flit install --symlink --deps develop --extras test # run: flit install --symlink - name: Lint if: ${{ matrix.python-version != '3.6' }} From 8de60f755c879cb8a270f33d4988ef50a845177f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 11 Jul 2022 23:59:31 +0200 Subject: [PATCH 06/11] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Update=20Flit=20comm?= =?UTF-8?q?and=20to=20install?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 17004ced5f3eb..a3644ac558e7b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,7 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' # TODO: remove --deps test, this is only to test running the tests in Python 3.11 - run: flit install --symlink --deps develop --extras test + run: flit install --symlink --deps none --extras test # run: flit install --symlink - name: Lint if: ${{ matrix.python-version != '3.6' }} From 24f31dcefd3283e8d59a3767b26770957b32bc9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Tue, 12 Jul 2022 00:02:01 +0200 Subject: [PATCH 07/11] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Update=20Flit=20comm?= =?UTF-8?q?and?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a3644ac558e7b..169eda35891bb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,7 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' # TODO: remove --deps test, this is only to test running the tests in Python 3.11 - run: flit install --symlink --deps none --extras test + run: flit install --symlink --deps production --extras test # run: flit install --symlink - name: Lint if: ${{ matrix.python-version != '3.6' }} From 1407b34ece560e13329413855e19f97b06e10183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 15 Sep 2022 14:39:07 +0200 Subject: [PATCH 08/11] =?UTF-8?q?=F0=9F=94=A7=20Update=20warning=20ignore?= =?UTF-8?q?=20filters=20for=20pytest,=20for=20Python=203.11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 6400a942b3084..6e5bee81cdbb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -133,4 +133,9 @@ filterwarnings = [ # TODO: needed by asyncio in Python 3.9.7 https://bugs.python.org/issue45097, try to remove on 3.9.8 'ignore:The loop argument is deprecated since Python 3\.8, and scheduled for removal in Python 3\.10:DeprecationWarning:asyncio', 'ignore:starlette.middleware.wsgi is deprecated and will be removed in a future release\..*:DeprecationWarning:starlette', + # TODO: remove after upgrading HTTPX to a version newer than 0.23.0 + # Including PR: https://github.com/encode/httpx/pull/2309 + "ignore:'cgi' is deprecated:DeprecationWarning", + # For passlib + "ignore:'crypt' is deprecated and slated for removal in Python 3.13:DeprecationWarning", ] From 7109ea33d1a21b2d1ed67985c1fec886a93b55e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 15 Sep 2022 15:14:10 +0200 Subject: [PATCH 09/11] =?UTF-8?q?=F0=9F=92=A1=20Add=20TODO=20comment=20exp?= =?UTF-8?q?laining=20current=20segmentation=20fault=20errors=20with=20pyte?= =?UTF-8?q?st=20and=20Python=203.11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_custom_middleware_exception.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_custom_middleware_exception.py b/tests/test_custom_middleware_exception.py index d9b81e7c2e74f..da55eb6ca0364 100644 --- a/tests/test_custom_middleware_exception.py +++ b/tests/test_custom_middleware_exception.py @@ -56,6 +56,12 @@ async def __call__(self, scope, receive, send): @router.post("/middleware") def run_middleware(file: UploadFile = File(..., description="Big File")): + # TODO: without this, pytest raises an error, and it causes a segmentation fault on + # Python 3.11-rc.2, the app works normally when run with Uvicorn, not sure if it's + # a problem with Python 3.11, pytest, or FastAPI. + # But FastAPI (or Starlette) should probably try to close these + # SpooledTemporaryFiles automatically by default + file.file.close() return {"message": "OK"} From 953cb6037f0de3130cc313c34aec088815282e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 3 Nov 2022 13:11:38 +0100 Subject: [PATCH 10/11] =?UTF-8?q?=F0=9F=94=A7=20Update=20Python=203.11=20v?= =?UTF-8?q?ersion=20to=20use=20latest=20final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 75ad977109871..9e492c1adacf8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11.0-rc.2"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] fail-fast: false steps: From eb912e7aef442c922664b8df12fffbdcaba146b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 3 Nov 2022 13:21:50 +0100 Subject: [PATCH 11/11] =?UTF-8?q?=F0=9F=94=A5=20Remove=20temporary=20worka?= =?UTF-8?q?round=20for=20Python=203.11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_custom_middleware_exception.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/test_custom_middleware_exception.py b/tests/test_custom_middleware_exception.py index da55eb6ca0364..d9b81e7c2e74f 100644 --- a/tests/test_custom_middleware_exception.py +++ b/tests/test_custom_middleware_exception.py @@ -56,12 +56,6 @@ async def __call__(self, scope, receive, send): @router.post("/middleware") def run_middleware(file: UploadFile = File(..., description="Big File")): - # TODO: without this, pytest raises an error, and it causes a segmentation fault on - # Python 3.11-rc.2, the app works normally when run with Uvicorn, not sure if it's - # a problem with Python 3.11, pytest, or FastAPI. - # But FastAPI (or Starlette) should probably try to close these - # SpooledTemporaryFiles automatically by default - file.file.close() return {"message": "OK"}