diff options
author | Thomas Grainger <tagrain@gmail.com> | 2023-04-21 13:39:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-21 14:39:17 +0200 |
commit | 2c02fc98c0e2c67be5b79a50f8bc8c7f5cfe6c07 (patch) | |
tree | 8be53b29245d2e8500f82a0bf95c550651f1fbf8 | |
parent | 8a45447e8a1014109097bbd11c84f2738d1c1700 (diff) | |
download | urllib3-2c02fc98c0e2c67be5b79a50f8bc8c7f5cfe6c07.tar.gz |
Remove dummy setup.py file (#2976)
GitHub Actions is dropping support for Python 2.7, making this difficult to test. Thankfully, Python 2.7 only accounts for 4% of our total downloads. The share of users using an ancient pip is probably even smaller.
-rw-r--r-- | .github/CODEOWNERS | 1 | ||||
-rw-r--r-- | .github/workflows/ci.yml | 22 | ||||
-rw-r--r-- | changelog/2975.removal.rst | 1 | ||||
-rw-r--r-- | noxfile.py | 24 | ||||
-rw-r--r-- | pyproject.toml | 1 | ||||
-rwxr-xr-x | setup.py | 18 |
6 files changed, 3 insertions, 64 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8b8dab92..64afa535 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,6 +4,5 @@ .github/workflows/ @sethmlarson @pquentin @shazow .github/CODEOWNERS @sethmlarson @pquentin @shazow src/urllib3/_version.py @sethmlarson @pquentin @shazow -setup.py @sethmlarson @pquentin @shazow pyproject.toml @sethmlarson @pquentin @shazow ci/ @sethmlarson @pquentin @shazow diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b8d1369..bca0332f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,10 +51,6 @@ jobs: os: ubuntu-latest experimental: false nox-session: test-pypy - - python-version: "2.7" - os: ubuntu-20.04 # CPython 2.7 is not available for ubuntu-22.04 - experimental: false - nox-session: unsupported_setup_py - python-version: "3.x" os: ubuntu-latest experimental: false @@ -90,20 +86,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - # Setup Python 3.x to run nox on behalf of Python 2.7 - - if: matrix.python-version == '2.7' - name: "Setup Python 3.x" - uses: "actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435" - with: - python-version: "3.x" - cache: "pip" - - - if: matrix.python-version == '2.7' - name: "Install dependencies" - run: python -m pip install --upgrade pip setuptools nox 'virtualenv<20.22.0' - - - if: matrix.python-version != '2.7' - name: "Install dependencies" + - name: "Install dependencies" run: python -m pip install --upgrade pip setuptools nox - name: "Run tests" @@ -112,8 +95,7 @@ jobs: PYTHON_VERSION: ${{ matrix.python-version }} NOX_SESSION: ${{ matrix.nox-session }} - - if: ${{ matrix.nox-session != 'unsupported_setup_py' }} - name: "Upload artifact" + - name: "Upload artifact" uses: "actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce" with: name: coverage-data diff --git a/changelog/2975.removal.rst b/changelog/2975.removal.rst new file mode 100644 index 00000000..f538ed1a --- /dev/null +++ b/changelog/2975.removal.rst @@ -0,0 +1 @@ +Remove the ``setup.py`` shim, ``python setup.py install`` will print ``[Errno 2] No such file or directory`` instead of a warning to use pip @@ -2,20 +2,10 @@ from __future__ import annotations import os import shutil -import subprocess import sys import nox -SOURCE_FILES = [ - "docs/", - "dummyserver/", - "src/", - "test/", - "noxfile.py", - "setup.py", -] - def tests_impl( session: nox.Session, @@ -73,20 +63,6 @@ def test(session: nox.Session) -> None: tests_impl(session) -@nox.session(python=["2.7"]) -def unsupported_setup_py(session: nox.Session) -> None: - # Can't check both returncode and output with session.run - process = subprocess.run( - ["python", "setup.py", "install"], - env={**session.env}, - text=True, - capture_output=True, - ) - assert process.returncode == 1 - print(process.stderr) - assert "Please use `python -m pip install .` instead." in process.stderr - - @nox.session(python=["3"]) def test_brotlipy(session: nox.Session) -> None: """Check that if 'brotlipy' is installed instead of 'brotli' or diff --git a/pyproject.toml b/pyproject.toml index 4efb930e..804ffd9f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,7 +103,6 @@ filterwarnings = [ [tool.isort] profile = "black" add_imports = "from __future__ import annotations" -skip = ["setup.py"] [tool.mypy] mypy_path = "src" diff --git a/setup.py b/setup.py deleted file mode 100755 index 6ba64c0d..00000000 --- a/setup.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python -# This file is protected via CODEOWNERS - -import sys - -sys.stderr.write( - """ -=============================== -Unsupported installation method -=============================== - -This version of urllib3 has dropped support for Python 2.7 and no longer supports -installation with `python setup.py install`. - -Please use `python -m pip install .` instead. -""" -) -sys.exit(1) |