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]]
name = "attrs"
......@@ -43,22 +43,22 @@ virtualenv = ["virtualenv (>=20.0.35)"]
[[package]]
name = "cachecontrol"
version = "0.12.11"
version = "0.13.0"
description = "httplib2 caching for requests"
optional = false
python-versions = ">=3.6"
files = [
{file = "CacheControl-0.12.11-py2.py3-none-any.whl", hash = "sha256:2c75d6a8938cb1933c75c50184549ad42728a27e9f6b92fd677c3151aa72555b"},
{file = "CacheControl-0.12.11.tar.gz", hash = "sha256:a5b9fcc986b184db101aa280b42ecdcdfc524892596f606858e0b7a8b4d9e144"},
{file = "CacheControl-0.13.0-py3-none-any.whl", hash = "sha256:4544a012a25cf0a73c53cd986f68b4f9c9f6b1df01d741c2923c3d56c66c7bda"},
{file = "CacheControl-0.13.0.tar.gz", hash = "sha256:fd3fd2cb0ca66b9a6c1d56cc9709e7e49c63dbd19b1b1bcbd8d3f94cedfe8ce5"},
]
[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"
requests = "*"
requests = ">=2.16.0"
[package.extras]
filecache = ["lockfile (>=0.9)"]
filecache = ["filelock (>=3.8.0)"]
redis = ["redis (>=2.10.5)"]
[[package]]
......@@ -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)"]
[[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"
version = "9.1.0"
description = "More routines for operating on iterables, beyond itertools"
......@@ -1536,19 +1525,20 @@ files = [
[[package]]
name = "urllib3"
version = "1.26.15"
version = "2.0.2"
description = "HTTP library with thread-safe connection pooling, file post, and more."
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*"
python-versions = ">=3.7"
files = [
{file = "urllib3-1.26.15-py2.py3-none-any.whl", hash = "sha256:aa751d169e23c7479ce47a0cb0da579e3ede798f994f5816a74e4f4500dcea42"},
{file = "urllib3-1.26.15.tar.gz", hash = "sha256:8a388717b9476f934a21484e8c8e61875ab60644d29b9b39e11e4b9dc1c6b305"},
{file = "urllib3-2.0.2-py3-none-any.whl", hash = "sha256:d055c2f9d38dc53c808f6fdc8eab7360b6fdbbde02340ed25cfbcd817c62469e"},
{file = "urllib3-2.0.2.tar.gz", hash = "sha256:61717a1095d7e155cdb737ac7bb2f4324a858a1e2e6466f6d03ff630ca68d3cc"},
]
[package.extras]
brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"]
secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"]
socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"]
brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"]
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)"]
zstd = ["zstandard (>=0.18.0)"]
[[package]]
name = "virtualenv"
......@@ -1672,4 +1662,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more
[metadata]
lock-version = "2.0"
python-versions = "^3.8"
content-hash = "fe768f57a3dc555bdf533470ea58eb135622af3231dbc154e9b19d2c39e3e85a"
content-hash = "92d6cd808867382b92c7e760437501ed12f1ba5857bfcdd5f23693c6d2ee6411"
......@@ -35,16 +35,14 @@ python = "^3.8"
poetry-core = "1.6.1"
poetry-plugin-export = "^1.4.0"
build = "^0.10.0"
cachecontrol = { version = "^0.12.9", extras = ["filecache"] }
cachecontrol = { version = "^0.13.0", extras = ["filecache"] }
cleo = "^2.0.0"
crashtest = "^0.4.1"
dulwich = "^0.21.2"
filelock = "^3.8.0"
importlib-metadata = { version = ">=4.4", python = "<3.10" }
installer = "^0.7.0"
jsonschema = "^4.10.0"
keyring = "^23.9.0"
lockfile = "^0.12.2"
# packaging uses calver, so version is unclamped
packaging = ">=20.4"
pexpect = "^4.7.0"
......@@ -60,7 +58,6 @@ tomlkit = ">=0.11.4,<1.0.0"
trove-classifiers = ">=2022.5.19"
virtualenv = "^20.22.0"
xattr = { version = "^0.10.0", markers = "sys_platform == 'darwin'" }
urllib3 = "^1.26.0"
[tool.poetry.group.dev.dependencies]
pre-commit = "^2.6"
......@@ -181,17 +178,14 @@ warn_unused_ignores = false
[[tool.mypy.overrides]]
module = [
'cachecontrol.*',
'deepdiff.*',
'httpretty.*',
'keyring.*',
'lockfile.*',
'pexpect.*',
'requests_toolbelt.*',
'shellingham.*',
'virtualenv.*',
'xattr.*',
'zipp.*',
]
ignore_missing_imports = true
......
......@@ -11,17 +11,14 @@ import requests
from poetry.core.masonry.metadata import Metadata
from poetry.core.masonry.utils.helpers import distribution_name
from requests import adapters
from requests.exceptions import ConnectionError
from requests.exceptions import HTTPError
from requests_toolbelt import user_agent
from requests_toolbelt.multipart import MultipartEncoder
from requests_toolbelt.multipart import MultipartEncoderMonitor
from urllib3 import util
from poetry.__version__ import __version__
from poetry.utils.constants import REQUESTS_TIMEOUT
from poetry.utils.constants import STATUS_FORCELIST
from poetry.utils.patterns import wheel_file_re
......@@ -64,18 +61,6 @@ class Uploader:
return agent
@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]:
dist = self._poetry.file.path.parent / "dist"
version = self._package.version.to_string()
......@@ -97,9 +82,6 @@ class Uploader:
session.auth = auth
session.headers["User-Agent"] = self.user_agent
for scheme in ("http://", "https://"):
session.mount(scheme, self.adapter)
return session
def get_auth(self) -> tuple[str, str] | None:
......
......@@ -12,14 +12,12 @@ from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
import lockfile
import requests
import requests.auth
import requests.exceptions
from cachecontrol import CacheControlAdapter
from cachecontrol.caches import FileCache
from filelock import FileLock
from poetry.config.config import Config
from poetry.exceptions import PoetryException
......@@ -37,26 +35,6 @@ if TYPE_CHECKING:
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)
class RepositoryCertificateConfig:
cert: Path | None = dataclasses.field(default=None)
......@@ -148,7 +126,6 @@ class Authenticator:
/ (cache_id or "_default_cache")
/ "_http"
),
lock_class=FileLockLockFile,
)
if not disable_cache
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