diff --git a/.cirrus.yml b/.cirrus.yml index 2ce67499911..c4722b3ba3e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -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 diff --git a/.flake8 b/.flake8 index 2780c9c145e..b49510aad91 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ [flake8] -min_python_version = 3.7.0 +min_python_version = 3.8.0 max-line-length = 88 ban-relative-imports = true # flake8-use-fstring: https://github.com/MichaelKim0407/flake8-use-fstring#--percent-greedy-and---format-greedy diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a7d2ee447ba..8e98013e101 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/.github/workflows/skip.yml b/.github/workflows/skip.yml index be69a320bbb..599009dc3ef 100644 --- a/.github/workflows/skip.yml +++ b/.github/workflows/skip.yml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c0d132dd9a5..dfb9506ae1d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,7 +49,7 @@ repos: rev: v3.3.1 hooks: - id: pyupgrade - args: [--py37-plus] + args: [--py38-plus] exclude: ^(install|get)-poetry.py$ - repo: https://github.com/hadialqattan/pycln diff --git a/docs/_index.md b/docs/_index.md index ebe15c88b62..329dfdbe99f 100644 --- a/docs/_index.md +++ b/docs/_index.md @@ -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 diff --git a/poetry.lock b/poetry.lock index dff3d459c4c..228ba72a9af 100644 --- a/poetry.lock +++ b/poetry.lock @@ -19,18 +19,6 @@ docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib- tests = ["attrs[tests-no-zope]", "zope.interface"] tests-no-zope = ["cloudpickle", "cloudpickle", "hypothesis", "hypothesis", "mypy (>=0.971,<0.990)", "mypy (>=0.971,<0.990)", "pympler", "pympler", "pytest (>=4.3.0)", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-mypy-plugins", "pytest-xdist[psutil]", "pytest-xdist[psutil]"] -[[package]] -name = "backports-cached-property" -version = "1.0.2" -description = "cached_property() - computed once per instance, cached as attribute" -category = "main" -optional = false -python-versions = ">=3.6.0" -files = [ - {file = "backports.cached-property-1.0.2.tar.gz", hash = "sha256:9306f9eed6ec55fd156ace6bc1094e2c86fae5fb2bf07b6a9c00745c656e75dd"}, - {file = "backports.cached_property-1.0.2-py3-none-any.whl", hash = "sha256:baeb28e1cd619a3c9ab8941431fe34e8490861fb998c6c4590693d50171db0cc"}, -] - [[package]] name = "build" version = "0.10.0" @@ -45,7 +33,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "os_name == \"nt\""} -importlib-metadata = {version = ">=0.22", markers = "python_version < \"3.8\""} packaging = ">=19.0" pyproject_hooks = "*" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} @@ -562,7 +549,6 @@ files = [ ] [package.dependencies] -typing-extensions = {version = "*", markers = "python_version <= \"3.7\""} urllib3 = ">=1.25" [package.extras] @@ -690,7 +676,6 @@ files = [ ] [package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} zipp = ">=0.5" [package.extras] @@ -790,11 +775,9 @@ files = [ [package.dependencies] attrs = ">=17.4.0" -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} importlib-resources = {version = ">=1.4.0", markers = "python_version < \"3.9\""} pkgutil-resolve-name = {version = ">=1.3.10", markers = "python_version < \"3.9\""} pyrsistent = ">=0.14.0,<0.17.0 || >0.17.0,<0.17.1 || >0.17.1,<0.17.2 || >0.17.2" -typing-extensions = {version = "*", markers = "python_version < \"3.8\""} [package.extras] format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"] @@ -950,7 +933,6 @@ files = [ [package.dependencies] mypy-extensions = ">=0.4.3" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typed-ast = {version = ">=1.4.0,<2", markers = "python_version < \"3.8\""} typing-extensions = ">=3.10" [package.extras] @@ -1121,9 +1103,6 @@ files = [ {file = "platformdirs-2.6.2.tar.gz", hash = "sha256:e1fea1fe471b9ff8332e229df3cb7de4f53eeea4998d3b6bfff542115e998bd2"}, ] -[package.dependencies] -typing-extensions = {version = ">=4.4", markers = "python_version < \"3.8\""} - [package.extras] docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=5.3)", "sphinx-autodoc-typehints (>=1.19.5)"] test = ["appdirs (==1.4.4)", "covdefaults (>=2.2.2)", "pytest (>=7.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] @@ -1140,9 +1119,6 @@ files = [ {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, ] -[package.dependencies] -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} - [package.extras] dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] @@ -1159,9 +1135,6 @@ files = [ {file = "poetry_core-1.5.1.tar.gz", hash = "sha256:41887261358863f25831fa0ad1fe7e451fc32d1c81fcf7710ba5174cc0047c6d"}, ] -[package.dependencies] -importlib-metadata = {version = ">=1.7.0", markers = "python_version < \"3.8\""} - [[package]] name = "poetry-plugin-export" version = "1.3.0" @@ -1193,7 +1166,6 @@ files = [ [package.dependencies] cfgv = ">=2.0.0" identify = ">=1.0.0" -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} nodeenv = ">=0.11.1" pyyaml = ">=5.1" virtualenv = ">=20.10.0" @@ -1317,7 +1289,6 @@ files = [ attrs = ">=19.2.0" colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" @@ -1710,40 +1681,6 @@ files = [ {file = "trove_classifiers-2023.2.8-py3-none-any.whl", hash = "sha256:3aff899dd9792c4d095740980a5967eb98094ff881faf0b29afc775b75aaaac6"}, ] -[[package]] -name = "typed-ast" -version = "1.5.4" -description = "a fork of Python 2 and 3 ast modules with type comment support" -category = "dev" -optional = false -python-versions = ">=3.6" -files = [ - {file = "typed_ast-1.5.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:669dd0c4167f6f2cd9f57041e03c3c2ebf9063d0757dc89f79ba1daa2bfca9d4"}, - {file = "typed_ast-1.5.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:211260621ab1cd7324e0798d6be953d00b74e0428382991adfddb352252f1d62"}, - {file = "typed_ast-1.5.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:267e3f78697a6c00c689c03db4876dd1efdfea2f251a5ad6555e82a26847b4ac"}, - {file = "typed_ast-1.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c542eeda69212fa10a7ada75e668876fdec5f856cd3d06829e6aa64ad17c8dfe"}, - {file = "typed_ast-1.5.4-cp310-cp310-win_amd64.whl", hash = "sha256:a9916d2bb8865f973824fb47436fa45e1ebf2efd920f2b9f99342cb7fab93f72"}, - {file = "typed_ast-1.5.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:79b1e0869db7c830ba6a981d58711c88b6677506e648496b1f64ac7d15633aec"}, - {file = "typed_ast-1.5.4-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a94d55d142c9265f4ea46fab70977a1944ecae359ae867397757d836ea5a3f47"}, - {file = "typed_ast-1.5.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:183afdf0ec5b1b211724dfef3d2cad2d767cbefac291f24d69b00546c1837fb6"}, - {file = "typed_ast-1.5.4-cp36-cp36m-win_amd64.whl", hash = "sha256:639c5f0b21776605dd6c9dbe592d5228f021404dafd377e2b7ac046b0349b1a1"}, - {file = "typed_ast-1.5.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:cf4afcfac006ece570e32d6fa90ab74a17245b83dfd6655a6f68568098345ff6"}, - {file = "typed_ast-1.5.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed855bbe3eb3715fca349c80174cfcfd699c2f9de574d40527b8429acae23a66"}, - {file = "typed_ast-1.5.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6778e1b2f81dfc7bc58e4b259363b83d2e509a65198e85d5700dfae4c6c8ff1c"}, - {file = "typed_ast-1.5.4-cp37-cp37m-win_amd64.whl", hash = "sha256:0261195c2062caf107831e92a76764c81227dae162c4f75192c0d489faf751a2"}, - {file = "typed_ast-1.5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2efae9db7a8c05ad5547d522e7dbe62c83d838d3906a3716d1478b6c1d61388d"}, - {file = "typed_ast-1.5.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7d5d014b7daa8b0bf2eaef684295acae12b036d79f54178b92a2b6a56f92278f"}, - {file = "typed_ast-1.5.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:370788a63915e82fd6f212865a596a0fefcbb7d408bbbb13dea723d971ed8bdc"}, - {file = "typed_ast-1.5.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4e964b4ff86550a7a7d56345c7864b18f403f5bd7380edf44a3c1fb4ee7ac6c6"}, - {file = "typed_ast-1.5.4-cp38-cp38-win_amd64.whl", hash = "sha256:683407d92dc953c8a7347119596f0b0e6c55eb98ebebd9b23437501b28dcbb8e"}, - {file = "typed_ast-1.5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4879da6c9b73443f97e731b617184a596ac1235fe91f98d279a7af36c796da35"}, - {file = "typed_ast-1.5.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3e123d878ba170397916557d31c8f589951e353cc95fb7f24f6bb69adc1a8a97"}, - {file = "typed_ast-1.5.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ebd9d7f80ccf7a82ac5f88c521115cc55d84e35bf8b446fcd7836eb6b98929a3"}, - {file = "typed_ast-1.5.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:98f80dee3c03455e92796b58b98ff6ca0b2a6f652120c263efdba4d6c5e58f72"}, - {file = "typed_ast-1.5.4-cp39-cp39-win_amd64.whl", hash = "sha256:0fdbcf2fef0ca421a3f5912555804296f0b0960f0418c440f5d6d3abb549f3e1"}, - {file = "typed_ast-1.5.4.tar.gz", hash = "sha256:39e21ceb7388e4bb37f4c679d72707ed46c2fbf2a5609b8b8ebc4b067d977df2"}, -] - [[package]] name = "types-html5lib" version = "1.1.11.11" @@ -1799,7 +1736,7 @@ files = [ name = "typing-extensions" version = "4.5.0" description = "Backported and Experimental Type Hints for Python 3.7+" -category = "main" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1860,7 +1797,6 @@ files = [ [package.dependencies] distlib = ">=0.3.6,<1" filelock = ">=3.4.1,<4" -importlib-metadata = {version = ">=4.8.3", markers = "python_version < \"3.8\""} platformdirs = ">=2.4,<4" [package.extras] @@ -1982,5 +1918,5 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools" [metadata] lock-version = "2.0" -python-versions = "^3.7" -content-hash = "1b804b8be7ae9a7e94c4959d138908d8647410750fc9de0a5b524870a4238bdd" +python-versions = "^3.8" +content-hash = "ee5056f4bcde0ca3c307cfec89a27e1fe1d9ed17864b317ac4a6fc14f13398a4" diff --git a/pyproject.toml b/pyproject.toml index 27a02f2a2a4..f51ad5fa257 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,11 +45,10 @@ generate-setup-file = false # Requirements [tool.poetry.dependencies] -python = "^3.7" +python = "^3.8" poetry-core = "1.5.1" poetry-plugin-export = "^1.3.0" -"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" @@ -103,14 +102,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] @@ -129,7 +126,7 @@ build-backend = "poetry.core.masonry.api" [tool.isort] -py_version = 37 +py_version = 38 profile = "black" force_single_line = true combine_as_imports = true @@ -141,7 +138,7 @@ known_third_party = ["poetry.core"] [tool.black] -target-version = ['py37'] +target-version = ['py38'] preview = true force-exclude = ''' .*/setup\.py$ @@ -161,9 +158,9 @@ enable_error_code = [ "truthy-bool", ] -# use of importlib-metadata backport at python3.7 makes it impossible to -# satisfy mypy without some ignores: but we get a different set of ignores at -# different python versions. +# use of importlib-metadata backport makes it impossible to satisfy mypy +# without some ignores: but we get a different set of ignores at different +# python versions. # # , meanwhile suppress that # warning. diff --git a/src/poetry/repositories/link_sources/base.py b/src/poetry/repositories/link_sources/base.py index 975553eec40..b2bd455d42a 100644 --- a/src/poetry/repositories/link_sources/base.py +++ b/src/poetry/repositories/link_sources/base.py @@ -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 @@ -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 diff --git a/src/poetry/repositories/link_sources/html.py b/src/poetry/repositories/link_sources/html.py index 5ea4eff78d0..54ade20a664 100644 --- a/src/poetry/repositories/link_sources/html.py +++ b/src/poetry/repositories/link_sources/html.py @@ -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: diff --git a/src/poetry/repositories/link_sources/json.py b/src/poetry/repositories/link_sources/json.py index 0acadd81fb3..12b9c43ade1 100644 --- a/src/poetry/repositories/link_sources/json.py +++ b/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: diff --git a/src/poetry/utils/_compat.py b/src/poetry/utils/_compat.py index 5887436e530..c46cc234fb8 100644 --- a/src/poetry/utils/_compat.py +++ b/src/poetry/utils/_compat.py @@ -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" @@ -62,7 +56,6 @@ def to_str(string: str) -> str: __all__ = [ "WINDOWS", - "cached_property", "decode", "encode", "metadata", diff --git a/tests/compat.py b/tests/compat.py deleted file mode 100644 index bacac6652c3..00000000000 --- a/tests/compat.py +++ /dev/null @@ -1,13 +0,0 @@ -from __future__ import annotations - -import sys - - -if sys.version_info < (3, 8): - import zipp as zipfile # nopycln: import - - from typing_extensions import Protocol # nopycln: import -else: - import zipfile # noqa: F401 - - from typing import Protocol # noqa: F401 diff --git a/tests/plugins/test_plugin_manager.py b/tests/plugins/test_plugin_manager.py index 868d61f26f0..72914858d46 100644 --- a/tests/plugins/test_plugin_manager.py +++ b/tests/plugins/test_plugin_manager.py @@ -2,6 +2,7 @@ from pathlib import Path from typing import TYPE_CHECKING +from typing import Protocol import pytest @@ -13,7 +14,6 @@ from poetry.plugins import Plugin from poetry.plugins.plugin_manager import PluginManager from poetry.poetry import Poetry -from tests.compat import Protocol from tests.helpers import mock_metadata_entry_points diff --git a/tests/repositories/test_installed_repository.py b/tests/repositories/test_installed_repository.py index 5d71bcd7497..9cd5ddb5d1a 100644 --- a/tests/repositories/test_installed_repository.py +++ b/tests/repositories/test_installed_repository.py @@ -1,5 +1,7 @@ from __future__ import annotations +import zipfile + from collections import namedtuple from pathlib import Path from typing import TYPE_CHECKING @@ -9,7 +11,6 @@ from poetry.repositories.installed_repository import InstalledRepository from poetry.utils._compat import metadata from poetry.utils.env import MockEnv as BaseMockEnv -from tests.compat import zipfile if TYPE_CHECKING: diff --git a/tests/types.py b/tests/types.py index 95ce4cbc940..1db9a6cf412 100644 --- a/tests/types.py +++ b/tests/types.py @@ -1,8 +1,7 @@ from __future__ import annotations from typing import TYPE_CHECKING - -from tests.compat import Protocol +from typing import Protocol if TYPE_CHECKING: