diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af8061f7..f1f9e6cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: push: branches: - master - - ?.?* # matches to backport branches, e.g. 3.6 + - ?.?* # matches to backport branches, e.g. 3.9 tags: [ 'v*' ] pull_request: branches: @@ -65,10 +65,9 @@ jobs: test: name: Test - needs: lint strategy: matrix: - pyver: ['3.6', '3.7', '3.8', '3.9', '3.10'] + pyver: ['3.7', '3.8', '3.9', '3.10'] no-extensions: ['', 'Y'] os: [ubuntu, macos, windows] exclude: @@ -77,7 +76,7 @@ jobs: - os: windows no-extensions: 'Y' include: - - pyver: pypy3 + - pyver: pypy-3.8 no-extensions: 'Y' os: ubuntu fail-fast: false @@ -131,10 +130,21 @@ jobs: flags: unit fail_ci_if_error: false + test-summary: + name: Tests status + if: always() + runs-on: ubuntu-latest + needs: [lint, test] + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} + pre-deploy: name: Pre-Deploy runs-on: ubuntu-latest - needs: test + needs: test-summary # Run only on pushing a tag if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') steps: diff --git a/CHANGES/672.removal b/CHANGES/672.removal new file mode 100644 index 00000000..825500d6 --- /dev/null +++ b/CHANGES/672.removal @@ -0,0 +1 @@ +Dropped Python 3.6 support. diff --git a/setup.py b/setup.py index c53d3395..6a376613 100644 --- a/setup.py +++ b/setup.py @@ -5,10 +5,6 @@ from setuptools import Extension, setup -if sys.version_info < (3, 5): - raise RuntimeError("yarl 1.4+ requires Python 3.5+") - - NO_EXTENSIONS = bool(os.environ.get("YARL_NO_EXTENSIONS")) # type: bool if sys.implementation.name != "cpython": @@ -53,7 +49,6 @@ def read(name): "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -66,7 +61,7 @@ def read(name): license="Apache 2", packages=["yarl"], install_requires=install_requires, - python_requires=">=3.6", + python_requires=">=3.7", include_package_data=True, exclude_package_data={"": ["*.c"]}, ) diff --git a/yarl/_url.py b/yarl/_url.py index c913676e..5985c3ae 100644 --- a/yarl/_url.py +++ b/yarl/_url.py @@ -1,6 +1,5 @@ import functools import math -import sys import warnings from collections.abc import Mapping, Sequence from ipaddress import ip_address @@ -706,55 +705,27 @@ def _normalize_path(cls, path): return "/".join(resolved_path) - if sys.version_info >= (3, 7): - - @classmethod - def _encode_host(cls, host, human=False): - try: - ip, sep, zone = host.partition("%") - ip = ip_address(ip) - except ValueError: - host = host.lower() - # IDNA encoding is slow, - # skip it for ASCII-only strings - # Don't move the check into _idna_encode() helper - # to reduce the cache size - if human or host.isascii(): - return host - host = _idna_encode(host) - else: - host = ip.compressed - if sep: - host += "%" + zone - if ip.version == 6: - host = "[" + host + "]" - return host - - else: - # work around for missing str.isascii() in Python <= 3.6 - @classmethod - def _encode_host(cls, host, human=False): - try: - ip, sep, zone = host.partition("%") - ip = ip_address(ip) - except ValueError: - host = host.lower() - if human: - return host - - for char in host: - if char > "\x7f": - break - else: - return host - host = _idna_encode(host) - else: - host = ip.compressed - if sep: - host += "%" + zone - if ip.version == 6: - host = "[" + host + "]" - return host + @classmethod + def _encode_host(cls, host, human=False): + try: + ip, sep, zone = host.partition("%") + ip = ip_address(ip) + except ValueError: + host = host.lower() + # IDNA encoding is slow, + # skip it for ASCII-only strings + # Don't move the check into _idna_encode() helper + # to reduce the cache size + if human or host.isascii(): + return host + host = _idna_encode(host) + else: + host = ip.compressed + if sep: + host += "%" + zone + if ip.version == 6: + host = "[" + host + "]" + return host @classmethod def _make_netloc(