Commit a0f3d5a7 by Tony Narlock Committed by GitHub

Drop python 3.6 support (#5055)

Drop python 3.6 support

Co-authored-by: Branch Vincent <branchevincent@gmail.com>
parent 1c0c9359
[flake8]
min_python_version = 3.6.0
min_python_version = 3.7.0
max-line-length = 88
ban-relative-imports = true
# flake8-use-fstring: https://github.com/MichaelKim0407/flake8-use-fstring#--percent-greedy-and---format-greedy
......
......@@ -26,7 +26,7 @@ jobs:
strategy:
matrix:
os: [Ubuntu, macOS, Windows]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
include:
- os: Ubuntu
image: ubuntu-latest
......
......@@ -26,6 +26,6 @@ jobs:
strategy:
matrix:
os: [Ubuntu, macOS, Windows]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- run: exit 0
......@@ -49,7 +49,7 @@ repos:
rev: v2.31.0
hooks:
- id: pyupgrade
args: [--py36-plus]
args: [--py37-plus]
exclude: '^(install|get)-poetry.py$'
- repo: https://github.com/pycqa/isort
......@@ -80,7 +80,6 @@ repos:
- id: mypy
pass_filenames: false
additional_dependencies:
- types-dataclasses
- types-requests
- repo: https://github.com/pre-commit/pre-commit
......
......@@ -5,7 +5,7 @@ ensuring you have the right stack everywhere.
![Poetry Install](https://raw.githubusercontent.com/python-poetry/poetry/master/assets/install.gif)
It supports Python 3.6+.
It supports Python 3.7+.
[![Tests Status](https://github.com/python-poetry/poetry/workflows/Tests/badge.svg?branch=master&event=push)](https://github.com/python-poetry/poetry/actions?query=workflow%3ATests+branch%3Amaster+event%3Apush)
......@@ -88,7 +88,7 @@ You can also install Poetry for a `git` repository by using the `--git` option:
curl -sSL https://install.python-poetry.org | python3 - --git https://github.com/python-poetry/poetry.git@master
````
_Note that the installer does not support Python < 3.6._
_Note that the installer does not support Python < 3.7._
## Updating `poetry`
......
......@@ -17,7 +17,7 @@ It allows you to declare the libraries your project depends on and it will manag
## System requirements
Poetry requires **Python 3.6+**. It is multi-platform and the goal is to make it work equally well
Poetry requires **Python 3.7+**. It is multi-platform and the goal is to make it work equally well
on Windows, Linux and OSX.
## Installation
......@@ -47,7 +47,7 @@ curl -sSL https://install.python-poetry.org | python3 -
```
{{% note %}}
Note that the installer does not support Python < 3.6.
Note that the installer does not support Python < 3.7.
{{% /note %}}
{{% warning %}}
......
......@@ -47,7 +47,7 @@ readme = "README.md"
packages = [{include = "poetry_demo"}]
[tool.poetry.dependencies]
python = "^3.6"
python = "^3.7"
[build-system]
......
......@@ -215,7 +215,7 @@ you would declare it like so:
[tool.poetry.dependencies]
foo = [
{version = "<=1.9", python = "^2.7"},
{version = "^2.0", python = "^3.4"}
{version = "^2.0", python = "^3.8"}
]
```
......@@ -234,7 +234,7 @@ An example where this might be useful is the following:
```toml
[tool.poetry.group.dev.dependencies]
black = {version = "19.10b0", allow-prereleases = true, python = "^3.6", markers = "platform_python_implementation == 'CPython'"}
black = {version = "19.10b0", allow-prereleases = true, python = "^3.7", markers = "platform_python_implementation == 'CPython'"}
```
As a single line, this is a lot to digest. To make this a bit easier to
......@@ -244,7 +244,7 @@ work with, you can do the following:
[tool.poetry.group.dev.dependencies.black]
version = "19.10b0"
allow-prereleases = true
python = "^3.6"
python = "^3.7"
markers = "platform_python_implementation == 'CPython'"
```
......
......@@ -62,7 +62,7 @@ And use a `tox.ini` configuration file similar to this:
```INI
[tox]
isolated_build = true
envlist = py27, py36
envlist = py27, py37
[testenv]
allowlist_externals = poetry
......
......@@ -233,7 +233,7 @@ is compatible is mandatory:
```toml
[tool.poetry.dependencies]
python = "^3.6"
python = "^3.7"
```
{{% /note %}}
......
......@@ -147,14 +147,6 @@ ssh = ["bcrypt (>=3.1.5)"]
test = ["pytest (>=6.2.0)", "pytest-cov", "pytest-subtests", "pytest-xdist", "pretend", "iso8601", "pytz", "hypothesis (>=1.11.4,!=3.79.2)"]
[[package]]
name = "dataclasses"
version = "0.8"
description = "A backport of the dataclasses module for Python 3.6"
category = "main"
optional = false
python-versions = ">=3.6, <3.7"
[[package]]
name = "deepdiff"
version = "5.7.0"
description = "Deep Difference and Search of any Python object/data."
......@@ -265,21 +257,6 @@ docs = ["sphinx", "rst.linker"]
testing = ["packaging", "pep517", "importlib-resources (>=1.3)"]
[[package]]
name = "importlib-resources"
version = "5.2.3"
description = "Read resources from Python packages"
category = "main"
optional = false
python-versions = ">=3.6"
[package.dependencies]
zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""}
[package.extras]
docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"]
testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "pytest-black (>=0.3.7)", "pytest-mypy"]
[[package]]
name = "iniconfig"
version = "1.1.1"
description = "iniconfig: brain-dead simple config-ini parsing"
......@@ -418,7 +395,6 @@ optional = false
python-versions = ">=3.6,<4.0"
[package.dependencies]
dataclasses = {version = ">=0.8", markers = "python_version >= \"3.6\" and python_version < \"3.7\""}
importlib-metadata = {version = ">=1.7.0", markers = "python_version < \"3.8\""}
[[package]]
......@@ -433,7 +409,6 @@ python-versions = ">=3.6.1"
cfgv = ">=2.0.0"
identify = ">=1.0.0"
importlib-metadata = {version = "*", markers = "python_version < \"3.8\""}
importlib-resources = {version = "<5.3", markers = "python_version < \"3.7\""}
nodeenv = ">=0.11.1"
pyyaml = ">=5.1"
toml = "*"
......@@ -700,7 +675,6 @@ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7"
distlib = ">=0.3.1,<1"
filelock = ">=3.2,<4"
importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""}
importlib-resources = {version = ">=1.0", markers = "python_version < \"3.7\""}
platformdirs = ">=2,<3"
six = ">=1.9.0,<2"
......@@ -730,8 +704,8 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes
[metadata]
lock-version = "1.1"
python-versions = "^3.6"
content-hash = "9d2e32899df46f2c63018e9a3f5e95dbbeb1ec41291c31289cff40f6f2d935a4"
python-versions = "^3.7"
content-hash = "a9b760bb9c29d1bd8835504dde250fae18549ecb21127219d6daf4e6cd26c2e9"
[metadata.files]
atomicwrites = [
......@@ -897,10 +871,6 @@ cryptography = [
{file = "cryptography-36.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:39bdf8e70eee6b1c7b289ec6e5d84d49a6bfa11f8b8646b5b3dfe41219153316"},
{file = "cryptography-36.0.1.tar.gz", hash = "sha256:53e5c1dc3d7a953de055d77bef2ff607ceef7a2aac0353b5d630ab67f7423638"},
]
dataclasses = [
{file = "dataclasses-0.8-py3-none-any.whl", hash = "sha256:0201d89fa866f68c8ebd9d08ee6ff50c0b255f8ec63a71c16fda7af82bb887bf"},
{file = "dataclasses-0.8.tar.gz", hash = "sha256:8479067f342acf957dc82ec415d355ab5edb7e7646b90dc6e2fd1d96ad084c97"},
]
deepdiff = [
{file = "deepdiff-5.7.0-py3-none-any.whl", hash = "sha256:1ffb38c3b5d9174eb2df95850c93aee55ec00e19396925036a2e680f725079e0"},
{file = "deepdiff-5.7.0.tar.gz", hash = "sha256:838766484e323dcd9dec6955926a893a83767dc3f3f94542773e6aa096efe5d4"},
......@@ -939,10 +909,6 @@ importlib-metadata = [
{file = "importlib_metadata-1.7.0-py2.py3-none-any.whl", hash = "sha256:dc15b2969b4ce36305c51eebe62d418ac7791e9a157911d58bfb1f9ccd8e2070"},
{file = "importlib_metadata-1.7.0.tar.gz", hash = "sha256:90bb658cdbbf6d1735b6341ce708fc7024a3e14e99ffdc5783edea9f9b077f83"},
]
importlib-resources = [
{file = "importlib_resources-5.2.3-py3-none-any.whl", hash = "sha256:ae35ed1cfe8c0d6c1a53ecd168167f01fa93b893d51a62cdf23aea044c67211b"},
{file = "importlib_resources-5.2.3.tar.gz", hash = "sha256:203d70dda34cfbfbb42324a8d4211196e7d3e858de21a5eb68c6d1cdd99e4e98"},
]
iniconfig = [
{file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"},
{file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"},
......
......@@ -32,14 +32,13 @@ generate-setup-file = false
# Requirements
[tool.poetry.dependencies]
python = "^3.6"
python = "^3.7"
poetry-core = "^1.1.0a6"
cachecontrol = { version = "^0.12.9", extras = ["filecache"] }
cachy = "^0.3.0"
cleo = "^1.0.0a4"
crashtest = "^0.3.0"
dataclasses = { version = "^0.8", python = "<3.7" }
entrypoints = "^0.3"
html5lib = "^1.0"
importlib-metadata = { version = "^1.6.0", python = "<3.8" }
......@@ -60,7 +59,7 @@ pytest = "^6.2"
pytest-cov = "^2.8"
pytest-mock = "^3.5"
pytest-sugar = "^0.9"
pre-commit = { version = "^2.6", python = "^3.6.1" }
pre-commit = "^2.6"
deepdiff = "^5.0"
httpretty = "^1.0"
typing-extensions = { version = "^4.0.0", python = "<3.8" }
......@@ -77,7 +76,7 @@ build-backend = "poetry.core.masonry.api"
[tool.isort]
py_version = 36
py_version = 37
profile = "black"
force_single_line = true
combine_as_imports = true
......@@ -88,7 +87,7 @@ extend_skip = ["setup.py"]
[tool.black]
target-version = ['py36']
target-version = ['py37']
experimental_string_processing = true
force-exclude = '''
.*/setup\.py$
......
import dataclasses
from typing import Dict
from typing import Union
import dataclasses
@dataclasses.dataclass(order=True, eq=True)
class Source:
......
......@@ -16,7 +16,6 @@ from cleo.events.event_dispatcher import EventDispatcher
from cleo.exceptions import CleoException
from cleo.formatters.style import Style
from cleo.io.inputs.argv_input import ArgvInput
from poetry.core.utils._compat import PY37
from poetry.__version__ import __version__
from poetry.console.command_loader import CommandLoader
......@@ -138,20 +137,6 @@ class Application(BaseApplication):
) -> "IO":
io = super().create_io(input, output, error_output)
# Remove when support for Python 3.6 is removed
# https://github.com/python-poetry/poetry/issues/3412
if (
not PY37
and hasattr(io.output, "_stream")
and hasattr(io.output._stream, "buffer")
and io.output._stream.encoding != "utf-8"
):
import io as io_
io.output._stream = io_.TextIOWrapper(
io.output._stream.buffer, encoding="utf-8"
)
# Set our own CLI styles
formatter = io.output.formatter
formatter.set_style("c1", Style("cyan"))
......
import os
import sys
from typing import TYPE_CHECKING
from typing import Union
......@@ -9,7 +6,6 @@ from poetry.core.packages.utils.utils import url_to_path
from poetry.exceptions import PoetryException
from poetry.utils.env import EnvCommandError
from poetry.utils.env import ephemeral_environment
if TYPE_CHECKING:
......@@ -55,18 +51,6 @@ def pip_install(
try:
return environment.run_pip(*args)
except EnvCommandError as e:
if sys.version_info < (3, 7) and not is_wheel:
# Under certain Python3.6 installs vendored pip wheel does not contain
# zip-safe pep517 lib. In this cases we create an isolated ephemeral virtual
# environment.
with ephemeral_environment(
executable=environment.python, with_pip=True, with_setuptools=True
) as env:
return environment.run(
*env.get_pip_command(),
*args,
env={**os.environ, "PYTHONPATH": str(env.purelib)},
)
raise PoetryException(f"Failed to install {path.as_posix()}") from e
......
import dataclasses
from typing import TYPE_CHECKING
import dataclasses
import pytest
......
......@@ -17,7 +17,6 @@ from cleo.formatters.style import Style
from cleo.io.buffered_io import BufferedIO
from poetry.core.packages.package import Package
from poetry.core.packages.utils.link import Link
from poetry.core.utils._compat import PY36
from poetry.installation.executor import Executor
from poetry.installation.operations import Install
......@@ -111,7 +110,7 @@ def test_execute_executes_a_batch_of_operations(
env: MockEnv,
):
pip_editable_install = mocker.patch(
"poetry.installation.executor.pip_editable_install", unsafe=not PY36
"poetry.installation.executor.pip_editable_install"
)
config.merge({"cache-dir": tmp_dir})
......
import re
import uuid
from dataclasses import dataclass
from typing import TYPE_CHECKING
from typing import Any
from typing import Dict
......@@ -13,7 +14,6 @@ import pytest
import requests
from cleo.io.null_io import NullIO
from dataclasses import dataclass
from poetry.utils.authenticator import Authenticator
......
[tox]
minversion = 3.18.0
isolated_build = True
envlist = py36, py37, py38, py39
envlist = py37, py38, py39
[testenv]
allowlist_externals = poetry
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment