Skip to content

Commit

Permalink
Drop python 3.6 support (#5055)
Browse files Browse the repository at this point in the history
Drop python 3.6 support

Co-authored-by: Branch Vincent <[email protected]>
  • Loading branch information
tony and branchvincent authored Jan 23, 2022
1 parent 1c0c935 commit a0f3d5a
Show file tree
Hide file tree
Showing 19 changed files with 27 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/skip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -80,7 +80,6 @@ repos:
- id: mypy
pass_filenames: false
additional_dependencies:
- types-dataclasses
- types-requests

- repo: https://github.com/pre-commit/pre-commit
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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`

Expand Down
4 changes: 2 additions & 2 deletions docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 %}}
Expand Down
2 changes: 1 addition & 1 deletion docs/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ readme = "README.md"
packages = [{include = "poetry_demo"}]

[tool.poetry.dependencies]
python = "^3.6"
python = "^3.7"


[build-system]
Expand Down
6 changes: 3 additions & 3 deletions docs/dependency-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
]
```

Expand All @@ -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
Expand All @@ -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'"
```

Expand Down
2 changes: 1 addition & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/pyproject.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ is compatible is mandatory:

```toml
[tool.poetry.dependencies]
python = "^3.6"
python = "^3.7"
```
{{% /note %}}

Expand Down
38 changes: 2 additions & 36 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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" }
Expand All @@ -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
Expand All @@ -88,7 +87,7 @@ extend_skip = ["setup.py"]


[tool.black]
target-version = ['py36']
target-version = ['py37']
experimental_string_processing = true
force-exclude = '''
.*/setup\.py$
Expand Down
4 changes: 2 additions & 2 deletions src/poetry/config/source.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import dataclasses

from typing import Dict
from typing import Union

import dataclasses


@dataclasses.dataclass(order=True, eq=True)
class Source:
Expand Down
15 changes: 0 additions & 15 deletions src/poetry/console/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
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
Expand Down Expand Up @@ -138,20 +137,6 @@ def create_io(
) -> "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"))
Expand Down
16 changes: 0 additions & 16 deletions src/poetry/utils/pip.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import os
import sys

from typing import TYPE_CHECKING
from typing import Union

Expand All @@ -9,7 +6,6 @@

from poetry.exceptions import PoetryException
from poetry.utils.env import EnvCommandError
from poetry.utils.env import ephemeral_environment


if TYPE_CHECKING:
Expand Down Expand Up @@ -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


Expand Down
3 changes: 2 additions & 1 deletion tests/console/commands/source/test_add.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import dataclasses

from typing import TYPE_CHECKING

import dataclasses
import pytest


Expand Down
3 changes: 1 addition & 2 deletions tests/installation/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
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
Expand Down Expand Up @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/test_authenticator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import re
import uuid

from dataclasses import dataclass
from typing import TYPE_CHECKING
from typing import Any
from typing import Dict
Expand All @@ -13,7 +14,6 @@
import requests

from cleo.io.null_io import NullIO
from dataclasses import dataclass

from poetry.utils.authenticator import Authenticator

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
minversion = 3.18.0
isolated_build = True
envlist = py36, py37, py38, py39
envlist = py37, py38, py39

[testenv]
allowlist_externals = poetry
Expand Down

0 comments on commit a0f3d5a

Please sign in to comment.