mirror of
https://git.freebsd.org/ports.git
synced 2025-04-28 09:36:41 -04:00
deskutils/py-vdirsyncer: Remove deprecated py-atomicwrites from RUN_DEPENDS
- Bump PORTREVISION for dependency and package change
Obtained from: 8b063c39cb
This commit is contained in:
parent
7b77d983e6
commit
63b71d27df
3 changed files with 115 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
||||||
PORTNAME= vdirsyncer
|
PORTNAME= vdirsyncer
|
||||||
PORTVERSION= 0.19.3
|
PORTVERSION= 0.19.3
|
||||||
|
PORTREVISION= 1
|
||||||
CATEGORIES= deskutils python
|
CATEGORIES= deskutils python
|
||||||
MASTER_SITES= PYPI
|
MASTER_SITES= PYPI
|
||||||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
||||||
|
@ -17,7 +18,6 @@ BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLA
|
||||||
${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
|
${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
|
||||||
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}aiohttp>=3.8.0<4.0.0:www/py-aiohttp@${PY_FLAVOR} \
|
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}aiohttp>=3.8.0<4.0.0:www/py-aiohttp@${PY_FLAVOR} \
|
||||||
${PYTHON_PKGNAMEPREFIX}aiostream>=0.4.3:www/py-aiostream@${PY_FLAVOR} \
|
${PYTHON_PKGNAMEPREFIX}aiostream>=0.4.3:www/py-aiostream@${PY_FLAVOR} \
|
||||||
${PYTHON_PKGNAMEPREFIX}atomicwrites>=0.1.7:devel/py-atomicwrites@${PY_FLAVOR} \
|
|
||||||
${PYTHON_PKGNAMEPREFIX}click>=5.0<9.0:devel/py-click@${PY_FLAVOR} \
|
${PYTHON_PKGNAMEPREFIX}click>=5.0<9.0:devel/py-click@${PY_FLAVOR} \
|
||||||
${PYTHON_PKGNAMEPREFIX}click-log>=0.3.0<0.5.0:devel/py-click-log@${PY_FLAVOR} \
|
${PYTHON_PKGNAMEPREFIX}click-log>=0.3.0<0.5.0:devel/py-click-log@${PY_FLAVOR} \
|
||||||
${PYTHON_PKGNAMEPREFIX}requests>=2.20.0:www/py-requests@${PY_FLAVOR} \
|
${PYTHON_PKGNAMEPREFIX}requests>=2.20.0:www/py-requests@${PY_FLAVOR} \
|
||||||
|
|
111
deskutils/py-vdirsyncer/files/patch-atomicwrites
Normal file
111
deskutils/py-vdirsyncer/files/patch-atomicwrites
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
Obtained from: https://github.com/pimutils/vdirsyncer/commit/8b063c39cb3e26a2beef5b6beed7e99c9e9641ac
|
||||||
|
|
||||||
|
--- setup.py.orig 2024-09-11 15:26:58 UTC
|
||||||
|
+++ setup.py
|
||||||
|
@@ -16,8 +16,6 @@ requirements = [
|
||||||
|
"click>=5.0,<9.0",
|
||||||
|
"click-log>=0.3.0, <0.5.0",
|
||||||
|
"requests >=2.20.0",
|
||||||
|
- # https://github.com/untitaker/python-atomicwrites/commit/4d12f23227b6a944ab1d99c507a69fdbc7c9ed6d # noqa
|
||||||
|
- "atomicwrites>=0.1.7",
|
||||||
|
"aiohttp>=3.8.0,<4.0.0",
|
||||||
|
"aiostream>=0.4.3,<0.5.0",
|
||||||
|
]
|
||||||
|
--- vdirsyncer/cli/utils.py.orig 2024-09-11 15:26:58 UTC
|
||||||
|
+++ vdirsyncer/cli/utils.py
|
||||||
|
@@ -10,7 +10,6 @@ import click
|
||||||
|
|
||||||
|
import aiohttp
|
||||||
|
import click
|
||||||
|
-from atomicwrites import atomic_write
|
||||||
|
|
||||||
|
from .. import BUGTRACKER_HOME
|
||||||
|
from .. import DOCS_HOME
|
||||||
|
@@ -21,6 +20,7 @@ from ..sync.status import SqliteStatus
|
||||||
|
from ..sync.exceptions import StorageEmpty
|
||||||
|
from ..sync.exceptions import SyncConflict
|
||||||
|
from ..sync.status import SqliteStatus
|
||||||
|
+from ..utils import atomic_write
|
||||||
|
from ..utils import expand_path
|
||||||
|
from ..utils import get_storage_init_args
|
||||||
|
from . import cli_logger
|
||||||
|
--- vdirsyncer/storage/filesystem.py.orig 2024-09-11 15:26:58 UTC
|
||||||
|
+++ vdirsyncer/storage/filesystem.py
|
||||||
|
@@ -5,9 +5,8 @@ import subprocess
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
-from atomicwrites import atomic_write
|
||||||
|
-
|
||||||
|
from .. import exceptions
|
||||||
|
+from ..utils import atomic_write
|
||||||
|
from ..utils import checkdir
|
||||||
|
from ..utils import expand_path
|
||||||
|
from ..utils import generate_href
|
||||||
|
--- vdirsyncer/storage/google.py.orig 2024-09-11 15:26:58 UTC
|
||||||
|
+++ vdirsyncer/storage/google.py
|
||||||
|
@@ -11,9 +11,9 @@ import click
|
||||||
|
|
||||||
|
import aiohttp
|
||||||
|
import click
|
||||||
|
-from atomicwrites import atomic_write
|
||||||
|
|
||||||
|
from .. import exceptions
|
||||||
|
+from ..utils import atomic_write
|
||||||
|
from ..utils import checkdir
|
||||||
|
from ..utils import expand_path
|
||||||
|
from ..utils import open_graphical_browser
|
||||||
|
--- vdirsyncer/storage/singlefile.py.orig 2024-09-11 15:26:58 UTC
|
||||||
|
+++ vdirsyncer/storage/singlefile.py
|
||||||
|
@@ -8,9 +8,8 @@ from typing import Iterable
|
||||||
|
import os
|
||||||
|
from typing import Iterable
|
||||||
|
|
||||||
|
-from atomicwrites import atomic_write
|
||||||
|
-
|
||||||
|
from .. import exceptions
|
||||||
|
+from ..utils import atomic_write
|
||||||
|
from ..utils import checkfile
|
||||||
|
from ..utils import expand_path
|
||||||
|
from ..utils import get_etag_from_file
|
||||||
|
--- vdirsyncer/utils.py.orig 2024-09-11 15:26:58 UTC
|
||||||
|
+++ vdirsyncer/utils.py
|
||||||
|
@@ -1,8 +1,10 @@ from __future__ import annotations
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
+import contextlib
|
||||||
|
import functools
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
+import tempfile
|
||||||
|
import uuid
|
||||||
|
from inspect import getfullargspec
|
||||||
|
from typing import Callable
|
||||||
|
@@ -220,3 +222,27 @@ def open_graphical_browser(url, new=0, autoraise=True)
|
||||||
|
return
|
||||||
|
|
||||||
|
raise RuntimeError("No graphical browser found. Please open the URL " "manually.")
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+@contextlib.contextmanager
|
||||||
|
+def atomic_write(dest, mode="wb", overwrite=False):
|
||||||
|
+ if "w" not in mode:
|
||||||
|
+ raise RuntimeError("`atomic_write` requires write access")
|
||||||
|
+
|
||||||
|
+ fd, src = tempfile.mkstemp(prefix=os.path.basename(dest), dir=os.path.dirname(dest))
|
||||||
|
+ file = os.fdopen(fd, mode=mode)
|
||||||
|
+
|
||||||
|
+ try:
|
||||||
|
+ yield file
|
||||||
|
+ except Exception:
|
||||||
|
+ os.unlink(src)
|
||||||
|
+ raise
|
||||||
|
+ else:
|
||||||
|
+ file.flush()
|
||||||
|
+ file.close()
|
||||||
|
+
|
||||||
|
+ if overwrite:
|
||||||
|
+ os.rename(src, dest)
|
||||||
|
+ else:
|
||||||
|
+ os.link(src, dest)
|
||||||
|
+ os.unlink(src)
|
|
@ -1,8 +1,8 @@
|
||||||
--- setup.py.orig 2024-09-11 15:26:58 UTC
|
--- setup.py.orig 2024-09-11 15:26:58 UTC
|
||||||
+++ setup.py
|
+++ setup.py
|
||||||
@@ -19,7 +19,7 @@ requirements = [
|
@@ -17,7 +17,7 @@ requirements = [
|
||||||
# https://github.com/untitaker/python-atomicwrites/commit/4d12f23227b6a944ab1d99c507a69fdbc7c9ed6d # noqa
|
"click-log>=0.3.0, <0.5.0",
|
||||||
"atomicwrites>=0.1.7",
|
"requests >=2.20.0",
|
||||||
"aiohttp>=3.8.0,<4.0.0",
|
"aiohttp>=3.8.0,<4.0.0",
|
||||||
- "aiostream>=0.4.3,<0.5.0",
|
- "aiostream>=0.4.3,<0.5.0",
|
||||||
+ "aiostream>=0.4.3",
|
+ "aiostream>=0.4.3",
|
||||||
|
|
Loading…
Add table
Reference in a new issue