Commit fca3d5d0 by Riccardo Albertazzi Committed by GitHub

feat: update cachecontrol to 0.13.0 (#8055)

parent 50e61e69
# This file is automatically @generated by Poetry 1.5.0 and should not be changed by hand. # This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand.
[[package]] [[package]]
name = "attrs" name = "attrs"
...@@ -43,22 +43,22 @@ virtualenv = ["virtualenv (>=20.0.35)"] ...@@ -43,22 +43,22 @@ virtualenv = ["virtualenv (>=20.0.35)"]
[[package]] [[package]]
name = "cachecontrol" name = "cachecontrol"
version = "0.12.11" version = "0.13.0"
description = "httplib2 caching for requests" description = "httplib2 caching for requests"
optional = false optional = false
python-versions = ">=3.6" python-versions = ">=3.6"
files = [ files = [
{file = "CacheControl-0.12.11-py2.py3-none-any.whl", hash = "sha256:2c75d6a8938cb1933c75c50184549ad42728a27e9f6b92fd677c3151aa72555b"}, {file = "CacheControl-0.13.0-py3-none-any.whl", hash = "sha256:4544a012a25cf0a73c53cd986f68b4f9c9f6b1df01d741c2923c3d56c66c7bda"},
{file = "CacheControl-0.12.11.tar.gz", hash = "sha256:a5b9fcc986b184db101aa280b42ecdcdfc524892596f606858e0b7a8b4d9e144"}, {file = "CacheControl-0.13.0.tar.gz", hash = "sha256:fd3fd2cb0ca66b9a6c1d56cc9709e7e49c63dbd19b1b1bcbd8d3f94cedfe8ce5"},
] ]
[package.dependencies] [package.dependencies]
lockfile = {version = ">=0.9", optional = true, markers = "extra == \"filecache\""} filelock = {version = ">=3.8.0", optional = true, markers = "extra == \"filecache\""}
msgpack = ">=0.5.2" msgpack = ">=0.5.2"
requests = "*" requests = ">=2.16.0"
[package.extras] [package.extras]
filecache = ["lockfile (>=0.9)"] filecache = ["filelock (>=3.8.0)"]
redis = ["redis (>=2.10.5)"] redis = ["redis (>=2.10.5)"]
[[package]] [[package]]
...@@ -706,17 +706,6 @@ docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker ...@@ -706,17 +706,6 @@ docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker
testing = ["flake8 (<5)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] testing = ["flake8 (<5)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"]
[[package]] [[package]]
name = "lockfile"
version = "0.12.2"
description = "Platform-independent file locking module"
optional = false
python-versions = "*"
files = [
{file = "lockfile-0.12.2-py2.py3-none-any.whl", hash = "sha256:6c3cb24f344923d30b2785d5ad75182c8ea7ac1b6171b08657258ec7429d50fa"},
{file = "lockfile-0.12.2.tar.gz", hash = "sha256:6aed02de03cba24efabcd600b30540140634fc06cfa603822d508d5361e9f799"},
]
[[package]]
name = "more-itertools" name = "more-itertools"
version = "9.1.0" version = "9.1.0"
description = "More routines for operating on iterables, beyond itertools" description = "More routines for operating on iterables, beyond itertools"
...@@ -1536,19 +1525,20 @@ files = [ ...@@ -1536,19 +1525,20 @@ files = [
[[package]] [[package]]
name = "urllib3" name = "urllib3"
version = "1.26.15" version = "2.0.2"
description = "HTTP library with thread-safe connection pooling, file post, and more." description = "HTTP library with thread-safe connection pooling, file post, and more."
optional = false optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" python-versions = ">=3.7"
files = [ files = [
{file = "urllib3-1.26.15-py2.py3-none-any.whl", hash = "sha256:aa751d169e23c7479ce47a0cb0da579e3ede798f994f5816a74e4f4500dcea42"}, {file = "urllib3-2.0.2-py3-none-any.whl", hash = "sha256:d055c2f9d38dc53c808f6fdc8eab7360b6fdbbde02340ed25cfbcd817c62469e"},
{file = "urllib3-1.26.15.tar.gz", hash = "sha256:8a388717b9476f934a21484e8c8e61875ab60644d29b9b39e11e4b9dc1c6b305"}, {file = "urllib3-2.0.2.tar.gz", hash = "sha256:61717a1095d7e155cdb737ac7bb2f4324a858a1e2e6466f6d03ff630ca68d3cc"},
] ]
[package.extras] [package.extras]
brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"]
secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] secure = ["certifi", "cryptography (>=1.9)", "idna (>=2.0.0)", "pyopenssl (>=17.1.0)", "urllib3-secure-extra"]
socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]
zstd = ["zstandard (>=0.18.0)"]
[[package]] [[package]]
name = "virtualenv" name = "virtualenv"
...@@ -1672,4 +1662,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more ...@@ -1672,4 +1662,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = "^3.8" python-versions = "^3.8"
content-hash = "fe768f57a3dc555bdf533470ea58eb135622af3231dbc154e9b19d2c39e3e85a" content-hash = "92d6cd808867382b92c7e760437501ed12f1ba5857bfcdd5f23693c6d2ee6411"
...@@ -35,16 +35,14 @@ python = "^3.8" ...@@ -35,16 +35,14 @@ python = "^3.8"
poetry-core = "1.6.1" poetry-core = "1.6.1"
poetry-plugin-export = "^1.4.0" poetry-plugin-export = "^1.4.0"
build = "^0.10.0" build = "^0.10.0"
cachecontrol = { version = "^0.12.9", extras = ["filecache"] } cachecontrol = { version = "^0.13.0", extras = ["filecache"] }
cleo = "^2.0.0" cleo = "^2.0.0"
crashtest = "^0.4.1" crashtest = "^0.4.1"
dulwich = "^0.21.2" dulwich = "^0.21.2"
filelock = "^3.8.0"
importlib-metadata = { version = ">=4.4", python = "<3.10" } importlib-metadata = { version = ">=4.4", python = "<3.10" }
installer = "^0.7.0" installer = "^0.7.0"
jsonschema = "^4.10.0" jsonschema = "^4.10.0"
keyring = "^23.9.0" keyring = "^23.9.0"
lockfile = "^0.12.2"
# packaging uses calver, so version is unclamped # packaging uses calver, so version is unclamped
packaging = ">=20.4" packaging = ">=20.4"
pexpect = "^4.7.0" pexpect = "^4.7.0"
...@@ -60,7 +58,6 @@ tomlkit = ">=0.11.4,<1.0.0" ...@@ -60,7 +58,6 @@ tomlkit = ">=0.11.4,<1.0.0"
trove-classifiers = ">=2022.5.19" trove-classifiers = ">=2022.5.19"
virtualenv = "^20.22.0" virtualenv = "^20.22.0"
xattr = { version = "^0.10.0", markers = "sys_platform == 'darwin'" } xattr = { version = "^0.10.0", markers = "sys_platform == 'darwin'" }
urllib3 = "^1.26.0"
[tool.poetry.group.dev.dependencies] [tool.poetry.group.dev.dependencies]
pre-commit = "^2.6" pre-commit = "^2.6"
...@@ -181,17 +178,14 @@ warn_unused_ignores = false ...@@ -181,17 +178,14 @@ warn_unused_ignores = false
[[tool.mypy.overrides]] [[tool.mypy.overrides]]
module = [ module = [
'cachecontrol.*',
'deepdiff.*', 'deepdiff.*',
'httpretty.*', 'httpretty.*',
'keyring.*', 'keyring.*',
'lockfile.*',
'pexpect.*', 'pexpect.*',
'requests_toolbelt.*', 'requests_toolbelt.*',
'shellingham.*', 'shellingham.*',
'virtualenv.*', 'virtualenv.*',
'xattr.*', 'xattr.*',
'zipp.*',
] ]
ignore_missing_imports = true ignore_missing_imports = true
......
...@@ -11,17 +11,14 @@ import requests ...@@ -11,17 +11,14 @@ import requests
from poetry.core.masonry.metadata import Metadata from poetry.core.masonry.metadata import Metadata
from poetry.core.masonry.utils.helpers import distribution_name from poetry.core.masonry.utils.helpers import distribution_name
from requests import adapters
from requests.exceptions import ConnectionError from requests.exceptions import ConnectionError
from requests.exceptions import HTTPError from requests.exceptions import HTTPError
from requests_toolbelt import user_agent from requests_toolbelt import user_agent
from requests_toolbelt.multipart import MultipartEncoder from requests_toolbelt.multipart import MultipartEncoder
from requests_toolbelt.multipart import MultipartEncoderMonitor from requests_toolbelt.multipart import MultipartEncoderMonitor
from urllib3 import util
from poetry.__version__ import __version__ from poetry.__version__ import __version__
from poetry.utils.constants import REQUESTS_TIMEOUT from poetry.utils.constants import REQUESTS_TIMEOUT
from poetry.utils.constants import STATUS_FORCELIST
from poetry.utils.patterns import wheel_file_re from poetry.utils.patterns import wheel_file_re
...@@ -64,18 +61,6 @@ class Uploader: ...@@ -64,18 +61,6 @@ class Uploader:
return agent return agent
@property @property
def adapter(self) -> adapters.HTTPAdapter:
retry = util.Retry(
connect=5,
total=10,
allowed_methods=["GET"],
respect_retry_after_header=True,
status_forcelist=STATUS_FORCELIST,
)
return adapters.HTTPAdapter(max_retries=retry)
@property
def files(self) -> list[Path]: def files(self) -> list[Path]:
dist = self._poetry.file.path.parent / "dist" dist = self._poetry.file.path.parent / "dist"
version = self._package.version.to_string() version = self._package.version.to_string()
...@@ -97,9 +82,6 @@ class Uploader: ...@@ -97,9 +82,6 @@ class Uploader:
session.auth = auth session.auth = auth
session.headers["User-Agent"] = self.user_agent session.headers["User-Agent"] = self.user_agent
for scheme in ("http://", "https://"):
session.mount(scheme, self.adapter)
return session return session
def get_auth(self) -> tuple[str, str] | None: def get_auth(self) -> tuple[str, str] | None:
......
...@@ -12,14 +12,12 @@ from pathlib import Path ...@@ -12,14 +12,12 @@ from pathlib import Path
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from typing import Any from typing import Any
import lockfile
import requests import requests
import requests.auth import requests.auth
import requests.exceptions import requests.exceptions
from cachecontrol import CacheControlAdapter from cachecontrol import CacheControlAdapter
from cachecontrol.caches import FileCache from cachecontrol.caches import FileCache
from filelock import FileLock
from poetry.config.config import Config from poetry.config.config import Config
from poetry.exceptions import PoetryException from poetry.exceptions import PoetryException
...@@ -37,26 +35,6 @@ if TYPE_CHECKING: ...@@ -37,26 +35,6 @@ if TYPE_CHECKING:
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class FileLockLockFile(lockfile.LockBase): # type: ignore[misc]
# The default LockFile from the lockfile package as used by cachecontrol can remain
# locked if a process exits ungracefully. See eg
# <https://github.com/python-poetry/poetry/issues/6030#issuecomment-1189383875>.
#
# FileLock from the filelock package does not have this problem, so we use that to
# construct something compatible with cachecontrol.
def __init__(
self, path: str, threaded: bool = True, timeout: float | None = None
) -> None:
super().__init__(path, threaded, timeout)
self.file_lock = FileLock(self.lock_file)
def acquire(self, timeout: float | None = None) -> None:
self.file_lock.acquire(timeout=timeout)
def release(self) -> None:
self.file_lock.release()
@dataclasses.dataclass(frozen=True) @dataclasses.dataclass(frozen=True)
class RepositoryCertificateConfig: class RepositoryCertificateConfig:
cert: Path | None = dataclasses.field(default=None) cert: Path | None = dataclasses.field(default=None)
...@@ -148,7 +126,6 @@ class Authenticator: ...@@ -148,7 +126,6 @@ class Authenticator:
/ (cache_id or "_default_cache") / (cache_id or "_default_cache")
/ "_http" / "_http"
), ),
lock_class=FileLockLockFile,
) )
if not disable_cache if not disable_cache
else None else None
......
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