Repository: cherrypy/cheroot (language: python)

Issue:
Drop support for Python 3.5 and 2.7
- Add a py2-drop banner to the docs
- Remove declared support for Python < 3.6
- Remove compatibility code from wsgi
- Remove compatibility code from cheroot
- Remove compatibility code from cli
- Remove compatibility code from connections
- Remove compatibility code from errors
- Remove compatibility code from makefile
- Remove compatibility code from test__compat
- Remove compatibility code from server
- Remove compatibility code from testing
- Remove compatibility code from threadpool
- Remove compatibility code from ssl package
- Remove compatibility code from test package
- Remove Python 3.5 compatibility from _compat module
- Add a changelog entry for v9.0.0

❓ **What kind of change does this PR introduce?**

* [ ] 🐞 bug fix
* [ ] 🐣 feature
* [ ] 📋 docs update
* [ ] 📋 tests/coverage improvement
* [ ] 📋 refactoring
* [x] 💥 other

📋 **What is the related issue number (starting with `#`)**

<!-- Are there any issues opened that will be resolved by merging this change? -->
Resolves #252 <!-- issue number here -->

❓ **What is the current behavior?** (You can also link to an open issue here)



❓ **What is the new behavior (if this is a feature change)?**



📋 **Other information**:



📋 **Contribution checklist:**

(If you're a first-timer, check out
[this guide on making great pull requests][making a lovely PR])

* [ ] I wrote descriptive pull request text above
* [ ] I think the code is well written
* [ ] I wrote [good commit messages]
* [ ] I have [squashed related commits together][related squash] after
      the changes have been approved
* [ ] Unit tests for the changes exist
* [ ] Integration tests for the changes exist (if applicable)
* [ ] I used the same coding conventions as the rest of the project
* [ ] The new code doesn't generate linter offenses
* [ ] Documentation reflects the changes
* [ ] The PR relates to *only* one subject with a clear title
      and description in grammatically correct, complete sentences

[good commit messages]: http://chris.beams.io/posts/git-commit/
[making a lovely PR]: https://mtlynch.io/code-review-love/
[related squash]:
https://github.com/todotxt/todo.txt-android/wiki/Squash-All-Commits-Related-to-a-Single-Issue-into-a-Single-Commit

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/cherrypy/cheroot/510)
<!-- Reviewable:end -->



Discussion / hints:
# [Codecov](https://codecov.io/gh/cherrypy/cheroot/pull/510?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cherrypy) Report
> Merging [#510](https://codecov.io/gh/cherrypy/cheroot/pull/510?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cherrypy) (1396980) into [main](https://codecov.io/gh/cherrypy/cheroot/commit/f0f97645bd527d765e79cbd205249d31b0fed949?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cherrypy) (f0f9764) will **increase** coverage by `1.45%`.
> The diff coverage is `82.69%`.

> :exclamation: Current head 1396980 differs from pull request most recent head 06f2107. Consider uploading reports for the commit 06f2107 to get more accurate results

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main     #510      +/-   ##
==========================================
+ Coverage   80.80%   82.26%   +1.45%     
==========================================
  Files          27       28       +1     
  Lines        4413     3991     -422     
==========================================
- Hits         3566     3283     -283     
+ Misses        847      708     -139     
```

</details>
This pull request **fixes 4 alerts** when merging 1396980c4a1abaab1758a6eb0077a7099a4107c9 into b7be66df6d08562e563fcf5ed9dd176b7130827d - [view on LGTM.com](https://lgtm.com/projects/g/cherrypy/cheroot/rev/pr-dc5881d6953878d1ec9ac80b5655e58653a9caed)

**fixed alerts:**

* 3 for Unused import
* 1 for Unused local variable
This pull request **fixes 4 alerts** when merging ea92dc015d7595fed1069eaf209df5fa4e661841 into f0f97645bd527d765e79cbd205249d31b0fed949 - [view on LGTM.com](https://lgtm.com/projects/g/cherrypy/cheroot/rev/pr-9e4beb5e39b38391966ab6408b823fde947656a1)

**fixed alerts:**

* 3 for Unused import
* 1 for Unused local variable
---

**Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December**, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine :gear: that powers LGTM.com. For more information, please check out [our post on the GitHub blog](https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/).
This pull request **fixes 4 alerts** when merging 06f210784fded6b6bef405497eefee97a89c3215 into f0f97645bd527d765e79cbd205249d31b0fed949 - [view on LGTM.com](https://lgtm.com/projects/g/cherrypy/cheroot/rev/pr-d0af1996f54141eaa3dbf6bd69e330f57f514f35)

**fixed alerts:**

* 3 for Unused import
* 1 for Unused local variable
---

**Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December**, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine :gear: that powers LGTM.com. For more information, please check out [our post on the GitHub blog](https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/).

Fix patch:
diff --git a/.github/workflows/pip-tools.yml b/.github/workflows/pip-tools.yml
index c71136a0a8..f7f06662ca 100644
--- a/.github/workflows/pip-tools.yml
+++ b/.github/workflows/pip-tools.yml
@@ -55,17 +55,14 @@ jobs:
         # NOTE: The latest and the lowest supported Pythons are prioritized
         # NOTE: to improve the responsiveness. It's nice to see the most
         # NOTE: important results first.
+        - 3.11
         - >-
           3.10
-        - pypy2.7
         - 3.9
         - 3.8
         - pypy3.7
         - 3.7
         - 3.6
-        - 3.5
-        - 2.7
-        - 3.11.0-alpha - 3.11.0
         - pypy3.6
         os:
         - ubuntu-18.04
@@ -79,11 +76,6 @@ jobs:
         # NOTE: found in library <None>`
         - os: macOS-11.0
           python-version: pypy3.6
-        include:
-        # NOTE: The only GNU/Linux CPython 3.4 available is built for Ubuntu 18
-        # https://github.com/actions/python-versions/blob/c483657/versions-manifest.json#L1228
-        - os: ubuntu-18.04
-          python-version: 3.4
 
     env:
       PIP_DISABLE_PIP_VERSION_CHECK: 1
@@ -98,7 +90,7 @@ jobs:
     - name: Set up Python ${{ matrix.python-version }}
       uses: actions/setup-python@v4
       with:
-        cache: ${{ matrix.python-version != '3.4' && 'pip' || '' }}
+        cache: pip
         cache-dependency-path: requirements/**
         python-version: ${{ matrix.python-version }}
 
@@ -110,18 +102,6 @@ jobs:
         --upgrade
         --force-reinstall
         pip-with-requires-python
-    - name: Upgrade setuptools
-      # ...to compensate the `PYTHONPATH` leak in the Python
-      # 3.4-compatible `pip` that seems to attempt to import a
-      # non-isolated `setuptools` version
-      if: matrix.python-version == '3.4'
-      run: >-
-        python -m
-        pip install
-        --user
-        --upgrade
-        --force-reinstall
-        setuptools
     - name: Install pip-tools
       run: >-
         python -m
@@ -154,18 +134,6 @@ jobs:
         )
 
 
-        ${{
-        (
-        matrix.python-version == '2.7'
-        || matrix.python-version == '3.4'
-        || matrix.python-version == '3.5'
-        || matrix.python-version == 'pypy2.7'
-        )
-        && 'echo ".  # runtime deps of the project" >> requirements/tests.in'
-        || ''
-        }}
-
-
         (cd requirements/;
         ${{
         runner.os != 'Windows'
@@ -205,82 +173,16 @@ jobs:
         }}
         ${{
         (
-        matrix.python-version != '2.7'
-        && matrix.python-version != '3.4'
-        && matrix.python-version != '3.5'
-        && matrix.python-version != '3.6'
-        && matrix.python-version != 'pypy2.7'
+        matrix.python-version != '3.6'
         && matrix.python-version != 'pypy3.6'
         )
         && '--resolver backtracking'
         || ''
         }}
         --output-file="requirements/${BASE_NAME}.txt"
-        ${{
-        (
-        matrix.python-version != '2.7'
-        && matrix.python-version != '3.4'
-        && matrix.python-version != '3.5'
-        && matrix.python-version != 'pypy2.7'
-        )
-        && '--strip-extras'
-        || ''
-        }}
+        --strip-extras
         "requirements/${BASE_NAME}.in"
-        ${{
-        (
-        matrix.python-version != '2.7'
-        && matrix.python-version != '3.4'
-        && matrix.python-version != '3.5'
-        && matrix.python-version != 'pypy2.7'
-        )
-        && 'setup.cfg'
-        || ''
-        }}
-
-
-        ${{
-        (
-        matrix.python-version == '2.7'
-        || matrix.python-version == '3.4'
-        || matrix.python-version == '3.5'
-        || matrix.python-version == 'pypy2.7'
-        )
-        && 'git checkout -- requirements/tests.in'
-        || ''
-        }}
-
-
-        ${{
-        (
-        runner.os != 'macOS' &&
-        (
-        matrix.python-version == '2.7'
-        || matrix.python-version == '3.4'
-        || matrix.python-version == '3.5'
-        || matrix.python-version == 'pypy2.7'
-        )
-        )
-        && 'sed -i
-        "s/\\[.*\\]//g;/^file:.*$/{N;N; s/^file:[^\"$\"]*\\n//;}"
-        "requirements/${BASE_NAME}.txt"'
-        || ''
-        }}
-        ${{
-        (
-        runner.os == 'macOS' &&
-        (
-        matrix.python-version == '2.7'
-        || matrix.python-version == '3.4'
-        || matrix.python-version == '3.5'
-        || matrix.python-version == 'pypy2.7'
-        )
-        )
-        && 'sed -i ""
-        "s/\\[.*\\]//g;/^file:.*$/{N;N; s/^file:[^\"$\"]*\\n//;}"
-        "requirements/${BASE_NAME}.txt"'
-        || ''
-        }}
+        setup.cfg
 
 
         git add "requirements/${BASE_NAME}.txt"


Test patch:
diff --git a/requirements/tests.in b/requirements/tests.in
index 3997be97ef..e0e06bfa49 100644
--- a/requirements/tests.in
+++ b/requirements/tests.in
@@ -1,10 +1,3 @@
-
-# NOTE: `apipkg` has broken the support of Python 3.4, seemingly
-# NOTE: accidentally. It's a transitive dependency for us, through
-# NOTE: `pytest-xdist` -> `execnet`.
-# Ref: https://github.com/pytest-dev/apipkg/issues/29
-apipkg != 2.1.0; python_version == "3.4"
-
 # chardet is a dependency of requests. It is optional under
 # Python 3 but is used if present. Starting with requests v2.26.0,
 # requests depends on charset_normalizer that emits a warning in
@@ -18,21 +11,8 @@ apipkg != 2.1.0; python_version == "3.4"
 # here so that it's use is adjusted across Python 2 and Python 3:
 requests[use_chardet_on_py3]
 
-# Updating `charset-normalizer` on Python 3.5 under Ubuntu 18.04 causes
-# some weird issues with `cryptography` — it starts wanting `libffi7`
-# but only `libffi6` is available in that environment.
-# Note that there's no `charset-normalizer` for Python 2
-charset-normalizer < 2.1.0; python_version >= "3.0" and python_version <= "3.5"
-
-# Address https://github.com/tartley/colorama/issues/240.
-# It's a transitive dependency of pytest-watch plugin.
-colorama!=0.4.2; python_version == "3.4"
-
 # measure test coverage
-coverage >= 6.2; python_version >= "3.6"
-coverage < 5; python_version == "3.4"
-coverage < 6; python_version < "3.6" and python_version != "3.4"
-futures; python_version == "2.7"
+coverage >= 6.2
 jaraco.context
 
 jaraco.text>=3.1
@@ -52,19 +32,18 @@ pyopenssl < 22.0.0; implementation_name == "pypy" and python_version < "3.8"
 # of the control flow:
 pypytools
 
-pytest-cov==2.8.1; python_version == "3.4"  # pyup: < 2.9
-pytest-cov==2.12.0; python_version != "3.4"
-pytest-forked>=1.1.3; sys_platform != "win32" and python_version >= '3.0' and python_version <= '3.4'
-pytest-forked>=1.2.0; sys_platform != "win32" and (python_version < '3.0' or python_version > '3.4')
+pytest-cov==2.12.0
+pytest-forked>=1.2.0; sys_platform != "win32"
 pytest-mock>=1.11.0
-pytest-rerunfailures < 9; python_version <= "2.7" or python_version == "3.4"
-pytest-rerunfailures < 10; python_version == "3.5"
-pytest-rerunfailures; python_version >= "3.6"
+pytest-rerunfailures
 pytest-sugar>=0.9.3
 pytest-watch==4.2.0
 pytest-xdist>=1.28.0
 
 # pytest-forked is currently incompatible with pytest 7
+# Refs:
+# * https://github.com/cherrypy/cheroot/issues/511
+# * https://github.com/pytest-dev/pytest-forked/issues/67
 pytest >= 4.6.6, < 7
 
 # HTTP over UNIX socket
@@ -73,16 +52,6 @@ requests_toolbelt
 
 # TLS
 trustme>=0.4.0
-urllib3<1.25; python_version == "3.4"  # pyup: < 1.25
-
-# This addresses https://github.com/cherrypy/cheroot/issues/173.
-# It's a transitive dependency of requests library.
-# Also: requests>=2.22.0 doesn't support Python 3.4
-# yet requests==2.21.0 doesn't support urllib3>=1.25
-# Allowing requests with a lower urllib3 version
-# so that tests'd pass
-urllib3>=1.25; python_version != "3.4"
-watchdog<1.0.0; python_version < "3.6"
 
 # cryptography >= 3.4 started using Rust but it's unstable w/ old PyPy
 cryptography < 3.4; implementation_name == "pypy" and python_version < "3.8"