From da7569a4404342b03e96b0e7ac31391ae58aecdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Thu, 8 Oct 2020 22:31:41 +0700 Subject: [PATCH 1/3] Document and start testing Python 3.9 support At first use it for GitHub Action for linting. --- .github/workflows/linting.yml | 6 +++--- news/8971.feature.rst | 1 + noxfile.py | 2 +- setup.py | 1 + tox.ini | 8 ++++---- 5 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 news/8971.feature.rst diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 512969b0d..0ff16be64 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -23,10 +23,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 # Setup Caching - name: pip cache diff --git a/news/8971.feature.rst b/news/8971.feature.rst new file mode 100644 index 000000000..e0b7b19cf --- /dev/null +++ b/news/8971.feature.rst @@ -0,0 +1 @@ +Support Python 3.9. diff --git a/noxfile.py b/noxfile.py index 1746bb699..93a3b24d8 100644 --- a/noxfile.py +++ b/noxfile.py @@ -69,7 +69,7 @@ def should_update_common_wheels(): # completely to nox for all our automation. Contributors should prefer using # `tox -e ...` until this note is removed. # ----------------------------------------------------------------------------- -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8", "pypy", "pypy3"]) +@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "pypy", "pypy3"]) def test(session): # Get the common wheels. if should_update_common_wheels(): diff --git a/setup.py b/setup.py index 0557690de..2601d8bd9 100644 --- a/setup.py +++ b/setup.py @@ -47,6 +47,7 @@ setup( "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ], diff --git a/tox.ini b/tox.ini index 82e9abc68..30a908cd3 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ minversion = 3.4.0 envlist = docs, packaging, lint, vendoring, - py27, py35, py36, py37, py38, pypy, pypy3 + py27, py35, py36, py37, py38, py39, pypy, pypy3 [helpers] # Wrapper for calls to pip that make sure the version being used is the @@ -49,7 +49,7 @@ setenv = [testenv:docs] # Don't skip install here since pip_sphinxext uses pip's internals. deps = -r{toxinidir}/tools/requirements/docs.txt -basepython = python3.8 +basepython = python3 commands = sphinx-build -W -d {envtmpdir}/doctrees/html -b html docs/html docs/build/html # Having the conf.py in the docs/html is weird but needed because we @@ -66,11 +66,11 @@ commands = pre-commit run [] --all-files --show-diff-on-failure [testenv:vendoring] -basepython = python3.8 +basepython = python3 skip_install = True commands_pre = deps = - vendoring==0.2.2 + vendoring>=0.3.3 # Required, otherwise we interpret --no-binary :all: as # "do not build wheels", which fails for PEP 517 requirements pip>=19.3.1 From cf6ecab62729cd361e5913bfa0132d104ec11ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Mon, 12 Oct 2020 17:36:51 +0700 Subject: [PATCH 2/3] Bump mypy to 0.790 for Python 3.9 compat HashError.order is now annotated as an int to allow HashErrors.errors.sort(key=lambda e: e.order). Alternatively we can define a function which assert e is not None but I prefer the more concise version, since we never raise HashError directly anyway. --- .pre-commit-config.yaml | 2 +- src/pip/_internal/exceptions.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 13b3abc62..838b1f24e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -69,7 +69,7 @@ repos: files: \.py$ - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.770 + rev: v0.790 hooks: - id: mypy exclude: docs|tests diff --git a/src/pip/_internal/exceptions.py b/src/pip/_internal/exceptions.py index 62bde1eed..56482caf7 100644 --- a/src/pip/_internal/exceptions.py +++ b/src/pip/_internal/exceptions.py @@ -200,7 +200,7 @@ class HashError(InstallationError): """ req = None # type: Optional[InstallRequirement] head = '' - order = None # type: Optional[int] + order = -1 # type: int def body(self): # type: () -> str From c69644257ec690787779ea5d96cbf6e016519de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Sat, 17 Oct 2020 19:47:55 +0700 Subject: [PATCH 3/3] Pin vendoring to ~=0.3.3 in test suite Co-authored-by: Pradyun Gedam <3275593+pradyunsg@users.noreply.github.com> --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 30a908cd3..9c20759af 100644 --- a/tox.ini +++ b/tox.ini @@ -70,7 +70,7 @@ basepython = python3 skip_install = True commands_pre = deps = - vendoring>=0.3.3 + vendoring~=0.3.3 # Required, otherwise we interpret --no-binary :all: as # "do not build wheels", which fails for PEP 517 requirements pip>=19.3.1