From 1b3d11d899b84c5899354d7846e93974d70325de Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Mon, 10 May 2021 08:25:59 +0200 Subject: [PATCH 1/7] Use string type annotations for Python 3.11 not 3.10 PEP 563 has been postponed to Python 3.11 https://mail.python.org/archives/list/python-dev@python.org/thread/CLVXXPQ2T2LQ5MP2Y53VVQFCXYWQJHKZ/ --- tests/cloudpickle_test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/cloudpickle_test.py b/tests/cloudpickle_test.py index 845f27962..f63d5168c 100644 --- a/tests/cloudpickle_test.py +++ b/tests/cloudpickle_test.py @@ -2207,10 +2207,13 @@ def method(self, arg: type_) -> type_: def check_annotations(obj, expected_type, expected_type_str): assert obj.__annotations__["attribute"] == expected_type - if sys.version_info >= (3, 10): - # In Python 3.10, type annotations are stored as strings. + if sys.version_info >= (3, 11): + # In Python 3.11, type annotations are stored as strings. # See PEP 563 for more details: # https://www.python.org/dev/peps/pep-0563/ + # Originaly scheduled for 3.10, then postponed. + # See this for more details: + # https://mail.python.org/archives/list/python-dev@python.org/thread/CLVXXPQ2T2LQ5MP2Y53VVQFCXYWQJHKZ/ assert ( obj.method.__annotations__["arg"] == expected_type_str From 4d8d55d403d980a1ab30798704dfe7dde1348d06 Mon Sep 17 00:00:00 2001 From: Pierre Glaser Date: Tue, 15 Jun 2021 19:00:02 +0100 Subject: [PATCH 2/7] CI test Python 3.10 and Python nightly separately --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 8dbf357f9..54e12a738 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -29,7 +29,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python_version: [3.5, 3.6, 3.7, 3.8, 3.9, "pypy3"] + python_version: [3.5, 3.6, 3.7, 3.8, 3.9, "3.10-dev", "pypy3"] exclude: # Do not test all minor versions on all platforms, especially if they # are not the oldest/newest supported versions From e20bbf09eae867265f834dceb7d944d7f5ed3fa5 Mon Sep 17 00:00:00 2001 From: Pierre Glaser Date: Tue, 15 Jun 2021 19:02:29 +0100 Subject: [PATCH 3/7] CI try new version of setup-python action --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 54e12a738..7e01f5c33 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -58,7 +58,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Set up Python ${{ matrix.python_version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python_version }} - name: Install project and dependencies From 9d84d5459c8a56d0088204abd170463d6978add1 Mon Sep 17 00:00:00 2001 From: Pierre Glaser Date: Tue, 15 Jun 2021 19:09:50 +0100 Subject: [PATCH 4/7] CI use python 3.11 in the python nightly entry --- .github/workflows/testing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 7e01f5c33..211d9523b 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -102,8 +102,8 @@ jobs: run: | sudo add-apt-repository ppa:deadsnakes/nightly sudo apt update - sudo apt install python3.10 python3.10-venv python3.10-dev - python3.10 -m venv nightly-venv + sudo apt install python3.11 python3.11-venv python3.11-dev + python3.11 -m venv nightly-venv echo "$PWD/nightly-venv/bin" >> $GITHUB_PATH - name: Display Python version run: python -c "import sys; print(sys.version)" From 60917b894d4b093526a06f33436875a3ea62b0a0 Mon Sep 17 00:00:00 2001 From: Pierre Glaser Date: Sat, 19 Jun 2021 20:56:29 +0100 Subject: [PATCH 5/7] CI make the python-nightly CI entry optional --- .github/workflows/testing.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 211d9523b..f954879ac 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -96,6 +96,7 @@ jobs: python-nightly: runs-on: ubuntu-18.04 + if: "contains(github.event.pull_request.labels.*.name, 'ci python-nightly')" steps: - uses: actions/checkout@v1 - name: Install Python from ppa:deadsnakes/nightly From 6b0daf6620b99cd11bb6f3846a75bd37e9bc2a5d Mon Sep 17 00:00:00 2001 From: Pierre Glaser Date: Sat, 19 Jun 2021 21:03:23 +0100 Subject: [PATCH 6/7] DOC explain why python nightly entry is optional --- .github/workflows/testing.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index f954879ac..be034ae9a 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -96,6 +96,7 @@ jobs: python-nightly: runs-on: ubuntu-18.04 + # This entry is made optional for now, see https://github.com/cloudpipe/cloudpickle/pull/420 if: "contains(github.event.pull_request.labels.*.name, 'ci python-nightly')" steps: - uses: actions/checkout@v1 From ebac5f521480e1d3a7c86db61278c299742ace7a Mon Sep 17 00:00:00 2001 From: Pierre Glaser Date: Sat, 19 Jun 2021 21:06:00 +0100 Subject: [PATCH 7/7] CI trigger