Skip to content

Commit 04af502

Browse files
authored
Drop Python 2 support (#2548)
1 parent cdd7eb1 commit 04af502

File tree

150 files changed

+415
-1017
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+415
-1017
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- pypy-3.8
2828
- pypy-3.7
2929
os:
30-
- ubuntu-20.04
30+
- ubuntu-22.04
3131
- macos-12
3232
- windows-2022
3333
include:
@@ -60,10 +60,6 @@ jobs:
6060
fetch-depth: 0
6161
- name: Use local virtualenv for tox
6262
run: python -m pip install .
63-
- name: Install Python 2 for cross test
64-
uses: actions/setup-python@v4
65-
with:
66-
python-version: "2.7"
6763
- name: Setup brew python for test ${{ matrix.py }}
6864
if: startsWith(matrix.py,'brew@')
6965
run: |

.pre-commit-config.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ repos:
2121
hooks:
2222
- id: pyupgrade
2323
args: ["--py37-plus"]
24-
exclude: "^(src/virtualenv/create/via_global_ref/_virtualenv.py|src/virtualenv/create/via_global_ref/builtin/python2/site.py|src/virtualenv/discovery/py_info.py|tasks/__main__zipapp.py)$"
25-
- repo: https://github.com/asottile/pyupgrade
26-
rev: v2.38.4
27-
hooks:
28-
- id: pyupgrade
29-
files: "^(src/virtualenv/create/via_global_ref/_virtualenv.py|src/virtualenv/create/via_global_ref/builtin/python2/site.py|src/virtualenv/discovery/py_info.py|tasks/__main__zipapp.py)$"
3024
- repo: https://github.com/PyCQA/isort
3125
rev: 5.12.0
3226
hooks:

docs/changelog/2496.docs.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/changelog/2548.feature.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Drop support for creating Python <3.6 (including 2) interpreters. Removed pip of ``20.3.4``, ``21.3.1``; wheel of
2+
``0.37.1``; setuptools of ``59.6.0``, ``44.1.1``, ``50.3.2``- by :user:`gaborbernat`.

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import subprocess
24
import sys
35
from datetime import date, datetime

docs/render_cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from argparse import SUPPRESS
24
from collections import namedtuple
35
from contextlib import contextmanager

pyproject.toml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ dynamic = [
3737
]
3838
dependencies = [
3939
"distlib<1,>=0.3.6",
40-
"filelock<4,>=3.4.1",
41-
'importlib-metadata>=4.8.3; python_version < "3.8"',
42-
"platformdirs<4,>=2.4",
40+
"filelock<4,>=3.11",
41+
'importlib-metadata>=6.4.1; python_version < "3.8"',
42+
"platformdirs<4,>=3.2",
4343
]
4444
optional-dependencies.docs = [
4545
"furo>=2023.3.27",
@@ -76,15 +76,9 @@ nushell = "virtualenv.activation.nushell:NushellActivator"
7676
powershell = "virtualenv.activation.powershell:PowerShellActivator"
7777
python = "virtualenv.activation.python:PythonActivator"
7878
[project.entry-points."virtualenv.create"]
79-
cpython2-mac-arm-framework = "virtualenv.create.via_global_ref.builtin.cpython.mac_os:CPython2macOsArmFramework"
80-
cpython2-mac-framework = "virtualenv.create.via_global_ref.builtin.cpython.mac_os:CPython2macOsFramework"
81-
cpython2-posix = "virtualenv.create.via_global_ref.builtin.cpython.cpython2:CPython2Posix"
82-
cpython2-win = "virtualenv.create.via_global_ref.builtin.cpython.cpython2:CPython2Windows"
8379
cpython3-mac-framework = "virtualenv.create.via_global_ref.builtin.cpython.mac_os:CPython3macOsFramework"
8480
cpython3-posix = "virtualenv.create.via_global_ref.builtin.cpython.cpython3:CPython3Posix"
8581
cpython3-win = "virtualenv.create.via_global_ref.builtin.cpython.cpython3:CPython3Windows"
86-
pypy2-posix = "virtualenv.create.via_global_ref.builtin.pypy.pypy2:PyPy2Posix"
87-
pypy2-win = "virtualenv.create.via_global_ref.builtin.pypy.pypy2:Pypy2Windows"
8882
pypy3-posix = "virtualenv.create.via_global_ref.builtin.pypy.pypy3:PyPy3Posix"
8983
pypy3-win = "virtualenv.create.via_global_ref.builtin.pypy.pypy3:Pypy3Windows"
9084
venv = "virtualenv.create.via_global_ref.venv:Venv"
@@ -105,6 +99,7 @@ line-length = 120
10599
[tool.isort]
106100
profile = "black"
107101
known_first_party = ["virtualenv"]
102+
add_imports = ["from __future__ import annotations"]
108103

109104
[tool.flake8]
110105
max-complexity = 22

src/virtualenv/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from .run import cli_run, session_via_cli
24
from .version import __version__
35

src/virtualenv/__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import logging
24
import os
35
import sys

src/virtualenv/activation/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from .bash import BashActivator
24
from .batch import BatchActivator
35
from .cshell import CShellActivator

0 commit comments

Comments
 (0)