Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate Python 3.6 #263

Merged
merged 18 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[flake8]
min_python_version = 3.7.0
max-line-length = 88
ignore = E501, E203, W503, ANN101, ANN102, SIM106
ban-relative-imports = True
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
experimental: [false]
include:
- os: Ubuntu
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
experimental: [false]
bootstrap-args: [""]
include:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ repos:
hooks:
- id: pyupgrade
args:
- --py36-plus
- --py37-plus

- repo: https://github.com/pycqa/isort
rev: 5.10.1
Expand Down
45 changes: 28 additions & 17 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 @@ -33,23 +33,22 @@ exclude = [
"Bug Tracker" = "https://github.com/python-poetry/poetry/issues"

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

# required for compatibility
importlib-metadata = {version = ">=1.7.0", python = "<3.8"}
dataclasses = {version = ">=0.8", python = "~3.6"}

[tool.poetry.dev-dependencies]
pre-commit = {version = "^2.15.0", python = "^3.6.1"}
pre-commit = "^2.15.0"
pyrsistent = "^0.18.0"
pytest = "^6.2"
pytest-cov = "^2.8"
pytest-mock = "^3.5"
tox = "^3.0"
vendoring = {version = "^0.3", python = "^3.8"}
pep517 = "^0.11.0"
black = {version = "^21.9b0", markers = "python_version >= '3.6.2' and python_version < '4.0' and implementation_name != 'pypy'"}
isort = {version = "^5.9.3", python = "^3.6.1"}
black = {version = "^21.9b0", markers = "python_version >= '3.7.0' and python_version < '4.0' and implementation_name != 'pypy'"}
isort = "^5.9.3"

[tool.black]
line-length = 88
Expand Down
9 changes: 0 additions & 9 deletions src/poetry/core/utils/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,9 @@
from typing import List


PY36 = sys.version_info >= (3, 6)
PY37 = sys.version_info >= (3, 7)

WINDOWS = sys.platform == "win32"


tony marked this conversation as resolved.
Show resolved Hide resolved
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError


def list_to_shell_command(cmd: List[str]) -> str:
executable = cmd[0]

Expand Down
5 changes: 2 additions & 3 deletions tests/masonry/builders/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

from poetry.core.factory import Factory
from poetry.core.masonry.builders.builder import Builder
from poetry.core.utils._compat import PY37


if TYPE_CHECKING:
Expand All @@ -29,7 +28,7 @@ def test_builder_find_excluded_files(mocker: "MockerFixture"):


@pytest.mark.xfail(
sys.platform == "win32" and not PY37,
sys.platform == "win32",
reason="Windows is case insensitive for the most part",
)
def test_builder_find_case_sensitive_excluded_files(mocker: "MockerFixture"):
Expand All @@ -54,7 +53,7 @@ def test_builder_find_case_sensitive_excluded_files(mocker: "MockerFixture"):


@pytest.mark.xfail(
sys.platform == "win32" and not PY37,
sys.platform == "win32",
reason="Windows is case insensitive for the most part",
)
def test_builder_find_invalid_case_sensitive_excluded_files(mocker: "MockerFixture"):
Expand Down
10 changes: 3 additions & 7 deletions tests/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
from contextlib import contextmanager
from pathlib import Path
from typing import Any
from typing import ContextManager
from typing import Dict
from typing import Generator
from typing import List
from typing import Optional

from poetry.core.toml import TOMLFile
from poetry.core.utils._compat import PY37


__toml_build_backend_patch__ = {
Expand All @@ -27,7 +26,7 @@
@contextmanager
def temporary_project_directory(
path: Path, toml_patch: Optional[Dict[str, Any]] = None
) -> ContextManager[str]:
) -> Generator[str, None, None]:
"""
Context manager that takes a project source directory, copies content to a temporary
directory, patches the `pyproject.toml` using the provided patch, or using the default
Expand Down Expand Up @@ -56,10 +55,7 @@ def subprocess_run(*args: str, **kwargs: Any) -> subprocess.CompletedProcess:
"""
Helper method to run a subprocess. Asserts for success.
"""
compat_kwargs = {"text" if PY37 else "universal_newlines": True}
result = subprocess.run(
args, **compat_kwargs, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs
)
result = subprocess.run(args, text=True, capture_output=True, **kwargs)
assert result.returncode == 0
return result

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.3.0
isolated_build = True
envlist = py36, py37, py38, py39, pypy3, integration
envlist = py37, py38, py39, pypy3, integration

[testenv]
whitelist_externals = poetry
Expand Down
4 changes: 2 additions & 2 deletions vendors/poetry.lock

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

2 changes: 1 addition & 1 deletion vendors/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers = [
]

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

jsonschema = "^3.2.0"
lark-parser = "^0.9.0"
Expand Down