gnu: python-execnet: Update to 1.9.0-1.d6aa1a5.
* gnu/packages/patches/python-execnet-read-only-fix.patch: Delete file. * gnu/local.mk (dist_patch_DATA): De-register it. * gnu/packages/python-xyz.scm (python-execnet): Update to 1.9.0-1.d6aa1a5. [source]: Remove patch. Fetch from git. [build-system]: Use pyproject-build-system. [arguments]: Remove check phase override. Add adjust-for-pytest-7.2+, pretend-version and prepare-for-tests phases. [native-inputs]: Add python-hatchling, python-hatchling-vcs, python-py and python-pytest-timeout.master
parent
2bf851e4b8
commit
ff85597812
|
@ -1753,7 +1753,6 @@ dist_patch_DATA = \
|
||||||
%D%/packages/patches/python-dateutil-pytest-compat.patch \
|
%D%/packages/patches/python-dateutil-pytest-compat.patch \
|
||||||
%D%/packages/patches/python-debugpy-unbundle-pydevd.patch \
|
%D%/packages/patches/python-debugpy-unbundle-pydevd.patch \
|
||||||
%D%/packages/patches/python-docopt-pytest6-compat.patch \
|
%D%/packages/patches/python-docopt-pytest6-compat.patch \
|
||||||
%D%/packages/patches/python-execnet-read-only-fix.patch \
|
|
||||||
%D%/packages/patches/python-fixtures-remove-monkeypatch-test.patch \
|
%D%/packages/patches/python-fixtures-remove-monkeypatch-test.patch \
|
||||||
%D%/packages/patches/python-hiredis-fix-header.patch \
|
%D%/packages/patches/python-hiredis-fix-header.patch \
|
||||||
%D%/packages/patches/python-hiredis-use-system-hiredis.patch \
|
%D%/packages/patches/python-hiredis-use-system-hiredis.patch \
|
||||||
|
|
|
@ -1,77 +0,0 @@
|
||||||
From 0d6562a20b0610c5a83d1c66ac879223b84a2746 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
|
||||||
Date: Thu, 26 Aug 2021 00:43:26 -0400
|
|
||||||
Subject: [PATCH] rsync_remote: Fix a problem when receiving read-only
|
|
||||||
directories.
|
|
||||||
|
|
||||||
Before this change, when the source directories hierarchy was
|
|
||||||
read-only, the read-only mode would be preserved at the destination,
|
|
||||||
preventing child directories to be recreated by a normal user (a
|
|
||||||
permission denied error, EACCES would be raised).
|
|
||||||
|
|
||||||
* execnet/rsync_remote.py (serve_rsync.receive_directory_structure):
|
|
||||||
Bitwise OR to ensure the write bit is set on received directories.
|
|
||||||
* testing/test_rsync.py (TestRSync)
|
|
||||||
<test_read_only_directories>: New test.
|
|
||||||
---
|
|
||||||
execnet/rsync_remote.py | 8 ++++++--
|
|
||||||
testing/test_rsync.py | 17 +++++++++++++++++
|
|
||||||
2 files changed, 23 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/execnet/rsync_remote.py b/execnet/rsync_remote.py
|
|
||||||
index cd5e765..55d154c 100644
|
|
||||||
--- a/execnet/rsync_remote.py
|
|
||||||
+++ b/execnet/rsync_remote.py
|
|
||||||
@@ -35,7 +35,11 @@ def serve_rsync(channel):
|
|
||||||
os.makedirs(path)
|
|
||||||
mode = msg.pop(0)
|
|
||||||
if mode:
|
|
||||||
- os.chmod(path, mode)
|
|
||||||
+ # Ensure directories are writable, otherwise a
|
|
||||||
+ # permission denied error (EACCES) would be raised
|
|
||||||
+ # when attempting to receive read-only directory
|
|
||||||
+ # structures.
|
|
||||||
+ os.chmod(path, mode | 0o700)
|
|
||||||
entrynames = {}
|
|
||||||
for entryname in msg:
|
|
||||||
destpath = os.path.join(path, entryname)
|
|
||||||
@@ -59,7 +63,7 @@ def serve_rsync(channel):
|
|
||||||
checksum = md5(f.read()).digest()
|
|
||||||
f.close()
|
|
||||||
elif msg_mode and msg_mode != st.st_mode:
|
|
||||||
- os.chmod(path, msg_mode)
|
|
||||||
+ os.chmod(path, msg_mode | 0o700)
|
|
||||||
return
|
|
||||||
else:
|
|
||||||
return # already fine
|
|
||||||
diff --git a/testing/test_rsync.py b/testing/test_rsync.py
|
|
||||||
index 995f229..1d6c30c 100644
|
|
||||||
--- a/testing/test_rsync.py
|
|
||||||
+++ b/testing/test_rsync.py
|
|
||||||
@@ -157,6 +157,23 @@ class TestRSync:
|
|
||||||
mode = destdir.stat().mode
|
|
||||||
assert mode & 511 == 504
|
|
||||||
|
|
||||||
+ @py.test.mark.skipif("sys.platform == 'win32' or getattr(os, '_name', '') == 'nt'")
|
|
||||||
+ def test_read_only_directories(self, dirs, gw1):
|
|
||||||
+ source = dirs.source
|
|
||||||
+ dest = dirs.dest1
|
|
||||||
+ source.ensure("sub", "subsub", dir=True)
|
|
||||||
+ source.join("sub").chmod(0o500)
|
|
||||||
+ source.join("sub", "subsub").chmod(0o500)
|
|
||||||
+
|
|
||||||
+ # The destination directories should be created with the write
|
|
||||||
+ # permission forced, to avoid raising an EACCES error.
|
|
||||||
+ rsync = RSync(source)
|
|
||||||
+ rsync.add_target(gw1, dest)
|
|
||||||
+ rsync.send()
|
|
||||||
+
|
|
||||||
+ assert dest.join("sub").stat().mode & 0o700
|
|
||||||
+ assert dest.join("sub").join("subsub").stat().mode & 0o700
|
|
||||||
+
|
|
||||||
@needssymlink
|
|
||||||
def test_symlink_rsync(self, dirs, gw1):
|
|
||||||
source = dirs.source
|
|
||||||
--
|
|
||||||
2.32.0
|
|
||||||
|
|
|
@ -15082,34 +15082,59 @@ pure Python module that works on virtually all Python versions.")
|
||||||
(license license:expat)))
|
(license license:expat)))
|
||||||
|
|
||||||
(define-public python-execnet
|
(define-public python-execnet
|
||||||
(package
|
;; The latest release (1.9.0) is old and lacks support for Pytest 7.2.
|
||||||
(name "python-execnet")
|
(let ((commit "d6aa1a56773c2e887515d63e50b1d08338cb78a7")
|
||||||
(version "1.9.0")
|
(revision "1"))
|
||||||
(source (origin
|
(package
|
||||||
(method url-fetch)
|
(name "python-execnet")
|
||||||
(uri (pypi-uri "execnet" version))
|
(version (git-version "1.9.0" revision commit))
|
||||||
(sha256
|
(source (origin
|
||||||
(base32
|
(method git-fetch)
|
||||||
"1ia7dvrh0gvzzpi758mx55f9flr16bzdqlmi12swm4ncm4xlyscg"))
|
(uri (git-reference
|
||||||
(patches (search-patches "python-execnet-read-only-fix.patch"))))
|
(url "https://github.com/pytest-dev/execnet")
|
||||||
(build-system python-build-system)
|
(commit commit)))
|
||||||
(arguments
|
(file-name (git-file-name name version))
|
||||||
`(#:phases
|
(sha256
|
||||||
(modify-phases %standard-phases
|
(base32
|
||||||
(replace 'check
|
"0s60jggcjiw38b7xsh1q2lnnr4c4kaki7c5zsv7xyj7df8ngbbsm"))))
|
||||||
(lambda* (#:key inputs outputs tests? #:allow-other-keys)
|
(build-system pyproject-build-system)
|
||||||
(when tests?
|
(arguments
|
||||||
;; Unset PYTHONDONTWRITEBYTECODE to match the
|
(list
|
||||||
;; expectations of a test in
|
;; ;; This test hasn't been updated for the latest Pytest yet:
|
||||||
;; 'testing/test_gateway.py'.
|
;; #:test-flags #~(list "--ignore" "testing/test_rsync.py")
|
||||||
(unsetenv "PYTHONDONTWRITEBYTECODE")
|
#:phases
|
||||||
|
#~(modify-phases %standard-phases
|
||||||
(add-installed-pythonpath inputs outputs)
|
(add-after 'unpack 'adjust-for-pytest-7.2+
|
||||||
(invoke "pytest" "-vv")))))))
|
(lambda _
|
||||||
(native-inputs
|
;; This test fails with an error because @py.test has been
|
||||||
(list python-pytest python-setuptools-scm))
|
;; deprecated for @pytest in recent Pytest.
|
||||||
(synopsis "Rapid multi-Python deployment")
|
(substitute* "testing/test_rsync.py"
|
||||||
(description "Execnet provides a share-nothing model with
|
(("@py.test")
|
||||||
|
"@pytest"))))
|
||||||
|
(add-before 'build 'pretend-version
|
||||||
|
;; The version string is usually derived via setuptools-scm, but
|
||||||
|
;; without the git metadata available this fails.
|
||||||
|
(lambda _
|
||||||
|
;; hatch-vcs uses setuptools under the hood.
|
||||||
|
(setenv "SETUPTOOLS_SCM_PRETEND_VERSION"
|
||||||
|
;; Massage the version string to a PEP-0440 compatible
|
||||||
|
;; one.
|
||||||
|
#$(car (string-split version #\-)))))
|
||||||
|
(add-before 'check 'prepare-for-tests
|
||||||
|
(lambda _
|
||||||
|
;; Unset PYTHONDONTWRITEBYTECODE to match the
|
||||||
|
;; expectations of a test in
|
||||||
|
;; 'testing/test_gateway.py'.
|
||||||
|
(unsetenv "PYTHONDONTWRITEBYTECODE"))))))
|
||||||
|
(native-inputs
|
||||||
|
(list python-hatchling
|
||||||
|
python-hatch-vcs
|
||||||
|
python-py
|
||||||
|
python-pytest
|
||||||
|
python-pytest-timeout
|
||||||
|
python-setuptools-scm))
|
||||||
|
(synopsis "Rapid multi-Python deployment")
|
||||||
|
(description "Execnet provides a share-nothing model with
|
||||||
channel-send/receive communication for distributing execution across many
|
channel-send/receive communication for distributing execution across many
|
||||||
Python interpreters across version, platform and network barriers. It has a
|
Python interpreters across version, platform and network barriers. It has a
|
||||||
minimal and fast API targeting the following uses:
|
minimal and fast API targeting the following uses:
|
||||||
|
@ -15118,8 +15143,8 @@ minimal and fast API targeting the following uses:
|
||||||
@item write and deploy hybrid multi-process applications
|
@item write and deploy hybrid multi-process applications
|
||||||
@item write scripts to administer multiple environments
|
@item write scripts to administer multiple environments
|
||||||
@end enumerate")
|
@end enumerate")
|
||||||
(home-page "https://codespeak.net/execnet/")
|
(home-page "https://codespeak.net/execnet/")
|
||||||
(license license:expat)))
|
(license license:expat))))
|
||||||
|
|
||||||
(define-public python-icalendar
|
(define-public python-icalendar
|
||||||
(package
|
(package
|
||||||
|
|
Reference in New Issue