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

drop support for python 3.7 #7674

Merged
merged 2 commits into from May 19, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .cirrus.yml
Expand Up @@ -12,7 +12,6 @@ test_task:
# avoid failures on tests that depend on it.
SHELL: sh
matrix:
- PYTHON: python3.7
- PYTHON: python3.8
- PYTHON: python3.9
- PYTHON: python3.10
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
matrix:
os: [Ubuntu, macOS, Windows]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
include:
- os: Ubuntu
image: ubuntu-22.04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/skip.yml
Expand Up @@ -28,6 +28,6 @@ jobs:
strategy:
matrix:
os: [Ubuntu, macOS, Windows]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- run: exit 0
2 changes: 1 addition & 1 deletion docs/_index.md
Expand Up @@ -18,7 +18,7 @@ Poetry offers a lockfile to ensure repeatable installs, and can build your proje

## System requirements

Poetry requires **Python 3.7+**. It is multi-platform and the goal is to make it work equally well
Poetry requires **Python 3.8+**. It is multi-platform and the goal is to make it work equally well
on Linux, macOS and Windows.

## Installation
Expand Down
70 changes: 3 additions & 67 deletions poetry.lock

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

10 changes: 3 additions & 7 deletions pyproject.toml
Expand Up @@ -30,11 +30,10 @@ Changelog = "https://python-poetry.org/history/"

# Requirements
[tool.poetry.dependencies]
python = "^3.7"
python = "^3.8"

poetry-core = "1.6.0"
poetry-plugin-export = "^1.3.1"
"backports.cached-property" = { version = "^1.0.2", python = "<3.8" }
build = "^0.10.0"
cachecontrol = { version = "^0.12.9", extras = ["filecache"] }
cleo = "^2.0.0"
Expand Down Expand Up @@ -77,14 +76,12 @@ pytest-cov = "^4.0"
pytest-mock = "^3.9"
pytest-randomly = "^3.12"
pytest-xdist = { version = "^3.1", extras = ["psutil"] }
zipp = { version = "^3.4", python = "<3.8" }

[tool.poetry.group.typing.dependencies]
mypy = ">=1.0"
types-html5lib = ">=1.1.9"
types-jsonschema = ">=4.9.0"
types-requests = ">=2.28.8"
typing-extensions = { version = "^4.0.0", python = "<3.8" }

# only used in github actions
[tool.poetry.group.github-actions]
Expand All @@ -106,7 +103,7 @@ fix = true
unfixable = [
"ERA", # do not autoremove commented out code
]
target-version = "py37"
target-version = "py38"
line-length = 88
extend-select = [
"B", # flake8-bugbear
Expand Down Expand Up @@ -146,9 +143,8 @@ known-first-party = ["poetry"]
known-third-party = ["poetry.core"]
required-imports = ["from __future__ import annotations"]


[tool.black]
target-version = ['py37']
target-version = ['py38']
preview = true
force-exclude = '''
.*/setup\.py$
Expand Down
9 changes: 2 additions & 7 deletions src/poetry/installation/executor.py
Expand Up @@ -766,10 +766,7 @@ def _download_link(self, operation: Install | Update, link: Link) -> Path:
link
)
cached_file = cache_directory.joinpath(link.filename)
# We can't use unlink(missing_ok=True) because it's not available
# prior to Python 3.8
if cached_file.exists():
cached_file.unlink()
cached_file.unlink(missing_ok=True)

raise

Expand Down Expand Up @@ -897,9 +894,7 @@ def _save_url_reference(self, operation: Operation) -> None:
) in self._env.site_packages.find_distribution_direct_url_json_files(
distribution_name=package.name, writable_only=True
):
# We can't use unlink(missing_ok=True) because it's not always available
if direct_url_json.exists():
direct_url_json.unlink()
direct_url_json.unlink(missing_ok=True)
return

url_reference: dict[str, Any] | None = None
Expand Down
4 changes: 1 addition & 3 deletions src/poetry/masonry/builders/editable.py
Expand Up @@ -132,9 +132,7 @@ def _add_pth(self) -> list[Path]:
f" - Removing existing <c2>{file.name}</c2> from <b>{file.parent}</b>"
f" for {self._poetry.file.path.parent}"
)
# We can't use unlink(missing_ok=True) because it's not always available
if file.exists():
file.unlink()
file.unlink(missing_ok=True)

try:
pth_file = self._env.site_packages.write_text(
Expand Down
2 changes: 1 addition & 1 deletion src/poetry/repositories/link_sources/base.py
Expand Up @@ -3,6 +3,7 @@
import logging
import re

from functools import cached_property
from typing import TYPE_CHECKING
from typing import DefaultDict
from typing import List
Expand All @@ -11,7 +12,6 @@
from poetry.core.packages.package import Package
from poetry.core.version.exceptions import InvalidVersion

from poetry.utils._compat import cached_property
from poetry.utils.patterns import sdist_file_re
from poetry.utils.patterns import wheel_file_re

Expand Down
2 changes: 1 addition & 1 deletion src/poetry/repositories/link_sources/html.py
Expand Up @@ -4,13 +4,13 @@
import warnings

from collections import defaultdict
from functools import cached_property
from html import unescape
from typing import TYPE_CHECKING

from poetry.core.packages.utils.link import Link

from poetry.repositories.link_sources.base import LinkSource
from poetry.utils._compat import cached_property


if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion src/poetry/repositories/link_sources/json.py
@@ -1,13 +1,13 @@
from __future__ import annotations

from collections import defaultdict
from functools import cached_property
from typing import TYPE_CHECKING
from typing import Any

from poetry.core.packages.utils.link import Link

from poetry.repositories.link_sources.base import LinkSource
from poetry.utils._compat import cached_property


if TYPE_CHECKING:
Expand Down
7 changes: 0 additions & 7 deletions src/poetry/utils/_compat.py
Expand Up @@ -21,12 +21,6 @@
else:
from importlib import metadata

if sys.version_info < (3, 8):
# compatibility for python <3.8
from backports.cached_property import cached_property
else:
from functools import cached_property

WINDOWS = sys.platform == "win32"


Expand Down Expand Up @@ -58,7 +52,6 @@ def encode(string: str, encodings: list[str] | None = None) -> bytes:

__all__ = [
"WINDOWS",
"cached_property",
"decode",
"encode",
"metadata",
Expand Down