Drop support for Python 2

This commit is contained in:
Ivan Kravets
2021-01-27 22:25:42 +02:00
parent bd75c3e559
commit 493a33e754
4 changed files with 5 additions and 23 deletions

View File

@ -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

View File

@ -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():

View File

@ -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",

View File

@ -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