From bc17f103f199366cfe2669b440e0ca4b01695362 Mon Sep 17 00:00:00 2001 From: mayeut Date: Thu, 14 Jul 2022 12:47:01 +0200 Subject: [PATCH] chore: drop python 3.6 for cibuildwheel driver This drops python 3.6 for cibuildwheel. Building python 3.6 packages is still supported. --- .circleci/config.yml | 10 +++++----- .pre-commit-config.yaml | 17 +++-------------- .travis.yml | 22 +++++++++++----------- CI.md | 12 ++++++------ azure-pipelines.yml | 11 ----------- bin/update_dependencies.py | 1 - cibuildwheel/bashlex_eval.py | 4 +--- docs/contributing.md | 2 -- examples/circleci-minimal.yml | 2 +- examples/travis-ci-test-and-deploy.yml | 1 - pyproject.toml | 4 ++-- setup.cfg | 4 +--- test/test_macos_archs.py | 2 +- test/utils.py | 2 +- unit_test/oci_container_test.py | 4 ++-- 15 files changed, 34 insertions(+), 64 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 62cefcab..3a657f7e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 jobs: - osx-python3.6: + osx-python3.9: macos: xcode: 12.5.1 environment: @@ -17,9 +17,9 @@ jobs: command: venv/bin/python ./bin/run_tests.py no_output_timeout: 30m - linux-python3.6: + linux-python3.9: docker: - - image: circleci/python:3.6 + - image: circleci/python:3.9 environment: PYTHON: python3 # Temporarily restrict the tests that are run on CircleCI to prevent @@ -41,5 +41,5 @@ workflows: version: 2 all-tests: jobs: - - osx-python3.6 - - linux-python3.6 + - osx-python3.9 + - linux-python3.9 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fdd22536..38864019 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,12 +17,6 @@ repos: rev: v2.37.1 hooks: - id: pyupgrade - name: PyUpgrade 3.6+ - args: ["--py36-plus"] - exclude: ^bin/ - - id: pyupgrade - name: PyUpgrade 3.7+ on bin - exclude: ^(cibuildwheel|unit_test|test)/ args: ["--py37-plus"] # Autoremoves unused imports @@ -52,9 +46,9 @@ repos: rev: v0.961 hooks: - id: mypy - name: mypy 3.6 on cibuildwheel/ - exclude: ^(bin|cibuildwheel/resources|docs)/.*py$ - args: ["--python-version=3.6"] + name: mypy 3.7 on cibuildwheel/ + exclude: ^cibuildwheel/resources/.*py$ + args: ["--python-version=3.7"] additional_dependencies: &mypy-dependencies - nox - packaging>=21.0 @@ -70,11 +64,6 @@ repos: - types-requests - bracex - dataclasses - - id: mypy - name: mypy 3.7+ on bin/ - files: ^((bin|docs)/.*py)$ - args: ["--python-version=3.7"] - additional_dependencies: *mypy-dependencies - id: mypy name: mypy 3.10 args: ["--python-version=3.10"] diff --git a/.travis.yml b/.travis.yml index aad9e5a5..4256a69b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,21 +8,21 @@ branches: jobs: include: - - name: Linux | x86_64 + i686 | Python 3.6 - python: 3.6 + - name: Linux | x86_64 + i686 | Python 3.7 + python: 3.7 services: docker env: PYTHON=python - - name: Linux | arm64 | Python 3.6 - python: 3.6 + - name: Linux | arm64 | Python 3.7 + python: 3.7 services: docker arch: arm64-graviton2 group: edge virt: vm env: PYTHON=python - - name: Linux | ppc64le | Python 3.6 - python: 3.6 + - name: Linux | ppc64le | Python 3.7 + python: 3.7 services: docker arch: ppc64le allow_failure: True @@ -32,18 +32,18 @@ jobs: # c.f. https://travis-ci.community/t/running-out-of-disk-space-quota-when-using-docker-on-ppc64le/11634 - PYTEST_ADDOPTS='-k "not test_manylinuxXXXX_only"' - - name: Windows | x86_64 | Python 3.6 + - name: Windows | x86_64 | Python 3.7 os: windows language: shell before_install: - - choco upgrade python3 -y --version 3.6.8 --limit-output + - choco upgrade python3 -y --version 3.7.9 --limit-output # Update root certificates to fix SSL error; see http://www.chawn.com/RootCerts.htm - powershell "md C:\temp\certs; CertUtil -generateSSTFromWU C:\temp\certs\RootStore.sst; Get-ChildItem -Path C:\\temp\certs\Rootstore.sst | Import-Certificate -CertStoreLocation Cert:\\LocalMachine\\Root\\ | out-null" env: - - PYTHON=C:\\Python36\\python + - PYTHON=C:\\Python37\\python - - name: Linux | s390x | Python 3.6 - python: 3.6 + - name: Linux | s390x | Python 3.7 + python: 3.7 services: docker arch: s390x env: PYTHON=python diff --git a/CI.md b/CI.md index 8ac4ada5..76167c35 100644 --- a/CI.md +++ b/CI.md @@ -1,11 +1,11 @@ This is a summary of the Python versions and platforms covered by the different CI platforms: -| | 3.6 | 3.7 | 3.8 | -|----------|------------------------------|-----------------------------|------------------| -| Linux | Travis CI / CircleCI | AppVeyor¹ / GitHub Actions | Azure Pipelines | -| macOS | CircleCI | AppVeyor¹ / GitHub Actions | Azure Pipelines | -| Windows | Travis CI / Azure Pipelines | AppVeyor¹ / GitHub Actions | Azure Pipelines | +| | 3.7 | 3.8 | 3.9 | 3.10 | +|----------|-----------------------|---------------------------|----------|----------------| +| Linux | AppVeyor¹ / Travis CI | Azure Pipelines / GitLab | CircleCI | GitHub Actions | +| macOS | AppVeyor¹ / Travis CI | Azure Pipelines | CircleCI | GitHub Actions | +| Windows | AppVeyor¹ / Travis CI | Azure Pipelines | | GitHub Actions | > ¹ AppVeyor only runs the "basic" test to reduce load. -Non-x86 architectures are covered on Travis CI using Python 3.6. +Non-x86 architectures are covered on Travis CI using Python 3.7. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 56131899..f8142ce8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,17 +20,6 @@ jobs: python -m pip install -e ".[dev]" pytest-azurepipelines python ./bin/run_tests.py -- job: windows_36 - pool: {vmImage: 'windows-2019'} - timeoutInMinutes: 180 - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.6' - - bash: | - python -m pip install -e ".[dev]" pytest-azurepipelines - python ./bin/run_tests.py - - job: windows_38 pool: {vmImage: 'windows-2019'} timeoutInMinutes: 180 diff --git a/bin/update_dependencies.py b/bin/update_dependencies.py index 69e62cfa..9dc9f536 100755 --- a/bin/update_dependencies.py +++ b/bin/update_dependencies.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# This file supports 3.6+ import os import shutil diff --git a/cibuildwheel/bashlex_eval.py b/cibuildwheel/bashlex_eval.py index a8b4691c..cd1fa563 100644 --- a/cibuildwheel/bashlex_eval.py +++ b/cibuildwheel/bashlex_eval.py @@ -9,9 +9,7 @@ EnvironmentExecutor = Callable[[List[str], Dict[str, str]], str] def local_environment_executor(command: List[str], env: Dict[str, str]) -> str: - return subprocess.run( - command, env=env, universal_newlines=True, stdout=subprocess.PIPE, check=True - ).stdout + return subprocess.run(command, env=env, text=True, stdout=subprocess.PIPE, check=True).stdout @dataclass(frozen=True) diff --git a/docs/contributing.md b/docs/contributing.md index c6a5b930..24566e4e 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -94,7 +94,6 @@ This has been moved to using docker, so you only need the following instructions The dependency update script in the next section requires multiple python versions installed. One way to do this is to use `pyenv`: ```bash -pyenv install 3.6.11 pyenv install 3.7.8 # Optionally add 3.8 and make it the local version; # otherwise assuming 3.8+ already is your current python version @@ -103,7 +102,6 @@ pyenv install 3.7.8 Then, you need to make the required virtual environments: ```bash -$(pyenv prefix 3.6.11)/bin/python -m venv env36 $(pyenv prefix 3.7.8)/bin/python -m venv env37 ``` diff --git a/examples/circleci-minimal.yml b/examples/circleci-minimal.yml index d8ebea72..3162ceb5 100644 --- a/examples/circleci-minimal.yml +++ b/examples/circleci-minimal.yml @@ -4,7 +4,7 @@ jobs: linux-wheels: working_directory: ~/linux-wheels docker: - - image: circleci/python:3.6 + - image: circleci/python:3.9 steps: - checkout - setup_remote_docker diff --git a/examples/travis-ci-test-and-deploy.yml b/examples/travis-ci-test-and-deploy.yml index 837db2eb..42a27954 100644 --- a/examples/travis-ci-test-and-deploy.yml +++ b/examples/travis-ci-test-and-deploy.yml @@ -9,7 +9,6 @@ os: linux dist: focal language: python python: - - 3.6 - 3.7 - 3.8 diff --git a/pyproject.toml b/pyproject.toml index 40f8dc5a..6c78cdb0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta" [tool.black] line-length = 100 -target-version = ['py36', 'py37', 'py38', 'py39', 'py310'] +target-version = ['py37', 'py38', 'py39', 'py310'] [tool.isort] @@ -88,7 +88,7 @@ ignore = [ ] [tool.pylint] -master.py-version = "3.6" +master.py-version = "3.7" master.jobs = "0" master.fail-on = ["E", "F"] master.fail-under = "9.8" diff --git a/setup.cfg b/setup.cfg index 2efc7c51..51718be9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,7 +16,6 @@ classifiers = Natural Language :: English Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -37,10 +36,9 @@ install_requires = filelock packaging>=20.9 platformdirs - dataclasses;python_version < '3.7' tomli;python_version < '3.11' typing-extensions>=3.10.0.0;python_version < '3.8' -python_requires = >=3.6 +python_requires = >=3.7 include_package_data = True zip_safe = False diff --git a/test/test_macos_archs.py b/test/test_macos_archs.py index a5db09f8..a85a6b24 100644 --- a/test/test_macos_archs.py +++ b/test/test_macos_archs.py @@ -17,7 +17,7 @@ ALL_MACOS_WHEELS = { def get_xcode_version() -> Tuple[int, int]: output = subprocess.run( ["xcodebuild", "-version"], - universal_newlines=True, + text=True, check=True, stdout=subprocess.PIPE, ).stdout diff --git a/test/utils.py b/test/utils.py index 22fe4c1a..ebe682e3 100644 --- a/test/utils.py +++ b/test/utils.py @@ -35,7 +35,7 @@ def cibuildwheel_get_build_identifiers(project_path, env=None, *, prerelease_pyt cmd_output = subprocess.run( cmd, - universal_newlines=True, + text=True, env=env, check=True, stdout=subprocess.PIPE, diff --git a/unit_test/oci_container_test.py b/unit_test/oci_container_test.py index 2f425daf..05ef24fd 100644 --- a/unit_test/oci_container_test.py +++ b/unit_test/oci_container_test.py @@ -83,7 +83,7 @@ def test_container_removed(container_engine): shell=True, check=True, stdout=subprocess.PIPE, - universal_newlines=True, + text=True, ).stdout assert container.name is not None assert container.name in docker_containers_listing @@ -94,7 +94,7 @@ def test_container_removed(container_engine): shell=True, check=True, stdout=subprocess.PIPE, - universal_newlines=True, + text=True, ).stdout assert old_container_name not in docker_containers_listing