From 493a33e75434c09d143ce5578ab17f7bd0286353 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 27 Jan 2021 22:25:42 +0200 Subject: [PATCH] Drop support for Python 2 --- .github/workflows/examples.yml | 2 +- platformio/maintenance.py | 18 ++---------------- setup.py | 4 ---- tox.ini | 4 ++-- 4 files changed, 5 insertions(+), 23 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 5825fd81..34d261d4 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -8,7 +8,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-16.04, windows-latest, macos-latest] - python-version: [2.7, 3.7] + python-version: [3.7] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 diff --git a/platformio/maintenance.py b/platformio/maintenance.py index 472a82a5..0e101339 100644 --- a/platformio/maintenance.py +++ b/platformio/maintenance.py @@ -40,6 +40,8 @@ from platformio.proc import is_container def on_platformio_start(ctx, force, caller): + ensure_python3(raise_exception=True) + app.set_session_var("command_ctx", ctx) app.set_session_var("force_option", force) set_caller(caller) @@ -47,24 +49,8 @@ def on_platformio_start(ctx, force, caller): if PlatformioCLI.in_silence(): return - after_upgrade(ctx) - if not ensure_python3(raise_exception=False): - click.secho( - """ -Python 2 and Python 3.5 are not compatible with PlatformIO Core 5.0. -Please check a migration guide on how to fix this warning message: -""", - fg="yellow", - ) - click.secho( - "https://docs.platformio.org/en/latest/core/migration.html" - "#drop-support-for-python-2-and-3-5", - fg="blue", - ) - click.echo("") - def on_platformio_end(ctx, result): # pylint: disable=unused-argument if PlatformioCLI.in_silence(): diff --git a/setup.py b/setup.py index 2aab992a..ad251a89 100644 --- a/setup.py +++ b/setup.py @@ -58,9 +58,6 @@ setup( author_email=__email__, url=__url__, license=__license__, - python_requires=", ".join( - [">=2.7", "!=3.0.*", "!=3.1.*", "!=3.2.*", "!=3.3.*", "!=3.4.*"] - ), install_requires=minimal_requirements + ([] if PY2 else home_requirements), packages=find_packages(exclude=["tests.*", "tests"]) + ["scripts"], package_data={ @@ -87,7 +84,6 @@ setup( "Operating System :: OS Independent", "Programming Language :: C", "Programming Language :: Python", - "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development", "Topic :: Software Development :: Build Tools", diff --git a/tox.ini b/tox.ini index ecaab77d..8a1f0b04 100644 --- a/tox.ini +++ b/tox.ini @@ -13,13 +13,13 @@ # limitations under the License. [tox] -envlist = py27,py37,py38,py39 +envlist = py36,py37,py38,py39 [testenv] passenv = * usedevelop = True deps = - py36,py37,py38,py39: black + black isort pylint pytest