Skip to content

Commit

Permalink
devel/py-poetry: Fix build after fa2d4aa
Browse files Browse the repository at this point in the history
- Bump PORTREVISION for dependency and package change

Obtained from:	python-poetry/poetry@fca3d5d
  • Loading branch information
sunpoet committed Jul 9, 2023
1 parent f4410cd commit 98ded7c
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 4 deletions.
6 changes: 2 additions & 4 deletions devel/py-poetry/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PORTNAME= poetry
PORTVERSION= 1.5.0
PORTREVISION= 1
CATEGORIES= devel python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
Expand All @@ -14,16 +15,14 @@ LICENSE_FILE= ${WRKSRC}/LICENSE

BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}poetry-core>=1.1.0:devel/py-poetry-core@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}build>=0.10.0<0.11:devel/py-build@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}cachecontrol>=0.12.9<0.13:www/py-cachecontrol@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}cachecontrol>=0.13.0<0.14:www/py-cachecontrol@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}cleo>=2.0.0<3:devel/py-cleo@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}crashtest>=0.4.1<0.5:devel/py-crashtest@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}dulwich>=0.21.2<0.22:devel/py-dulwich@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}filelock>=3.8.0<4:sysutils/py-filelock@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}html5lib>=1.0<2:www/py-html5lib@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}installer>=0.7.0<0.8:devel/py-installer@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}jsonschema>=4.10.0<5:devel/py-jsonschema@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}keyring>=23.9.0,1<24,1:security/py-keyring@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}lockfile>=0.12.2<0.13:devel/py-lockfile@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}packaging>=20.4:devel/py-packaging@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pexpect>=4.7.0<5:misc/py-pexpect@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pkginfo>=1.9.4<2:sysutils/py-pkginfo@${PY_FLAVOR} \
Expand All @@ -36,7 +35,6 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}build>=0.10.0<0.11:devel/py-build@${PY_FLAVO
${PYTHON_PKGNAMEPREFIX}shellingham>=1.5<2:devel/py-shellingham@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}tomlkit>=0.11.4<1.0.0:textproc/py-tomlkit@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}trove-classifiers>=2022.5.19:devel/py-trove-classifiers@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}urllib3>=1.26.0,1<2,1:net/py-urllib3@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}virtualenv>=20.22.0<21:devel/py-virtualenv@${PY_FLAVOR}

USES= python
Expand Down
152 changes: 152 additions & 0 deletions devel/py-poetry/files/patch-cachecontrol
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
Obtained from: https://github.com/python-poetry/poetry/commit/fca3d5d04fb01bbb3c77e810094a99732b7d024c

--- pyproject.toml.orig 2023-05-19 12:27:02 UTC
+++ pyproject.toml
@@ -36,17 +36,15 @@ 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"] }
+cachecontrol = { version = "^0.13.0", extras = ["filecache"] }
cleo = "^2.0.0"
crashtest = "^0.4.1"
dulwich = "^0.21.2"
-filelock = "^3.8.0"
html5lib = "^1.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"
@@ -62,7 +60,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"
@@ -189,18 +186,15 @@ warn_unused_ignores = false

[[tool.mypy.overrides]]
module = [
- 'cachecontrol.*',
'cachy.*',
'deepdiff.*',
'httpretty.*',
'keyring.*',
- 'lockfile.*',
'pexpect.*',
'requests_toolbelt.*',
'shellingham.*',
'virtualenv.*',
'xattr.*',
- 'zipp.*',
]
ignore_missing_imports = true

--- src/poetry/publishing/uploader.py.orig 2023-05-19 12:27:02 UTC
+++ src/poetry/publishing/uploader.py
@@ -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:
--- src/poetry/utils/authenticator.py.orig 2023-05-19 12:27:02 UTC
+++ src/poetry/utils/authenticator.py
@@ -12,7 +12,6 @@ from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any

-import lockfile
import requests
import requests.auth
import requests.exceptions
@@ -20,7 +19,6 @@ import requests.exceptions
from cachecontrol import CacheControlAdapter
from cachecontrol.caches import FileCache
from cachecontrol.caches.file_cache import url_to_file_path
-from filelock import FileLock

from poetry.config.config import Config
from poetry.exceptions import PoetryException
@@ -38,26 +36,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)
@@ -149,7 +127,6 @@ class Authenticator:
/ (cache_id or "_default_cache")
/ "_http"
),
- lock_class=FileLockLockFile,
)
if not disable_cache
else None

0 comments on commit 98ded7c

Please sign in to comment.