python3Packages.zipfile2: init at 0.0.12

This commit is contained in:
GenericNerdyUsername 2023-01-27 00:50:04 +00:00 committed by Sandro Jäckel
parent a83a3597cd
commit 82a7b2717f
No known key found for this signature in database
GPG key ID: 3AF5A43A3EECC2E5
3 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,27 @@
{ buildPythonPackage
, fetchFromGitHub
, lib
}:
buildPythonPackage rec {
pname = "zipfile2";
version = "0.0.12";
src = fetchFromGitHub {
owner = "cournape";
repo = pname;
rev = "v${version}";
hash = "sha256-BwcEgW4XrQqz0Jmtbyxf8q0mWTJXv2dL3Tk7N/IYuMI=";
};
patches = [ ./no-setuid.patch ];
pythonImportsCheck = [ "zipfile2" ];
meta = with lib; {
homepage = "https://github.com/cournape/zipfile2";
description = "A backwards-compatible improved zipfile class";
maintainers = with maintainers; [ genericnerdyusername ];
license = licenses.psfl;
};
}

View file

@ -0,0 +1,15 @@
diff --git a/zipfile2/tests/test__zipfile.py b/zipfile2/tests/test__zipfile.py
index 60f2ed2..db6e5bc 100644
--- a/zipfile2/tests/test__zipfile.py
+++ b/zipfile2/tests/test__zipfile.py
@@ -585,8 +585,8 @@ class TestsPermissionExtraction(unittest.TestCase):
if index & 1 << order:
mode |= permissions[permgroup][order]
for order in range(3):
- if specialindex & 1 << order:
- mode |= permissions['special'][order]
+ if specialindex & 1 << order and order == 0:
+ raise unittest.SkipTest("The nix build process doesn't allow you to use the setuid bit")
os.chmod(path, mode)
real_permission = os.stat(path).st_mode & 0xFFF
self.files.append((path, real_permission))

View file

@ -13244,6 +13244,8 @@ self: super: with self; {
zimports = callPackage ../development/python-modules/zimports { };
zipfile2 = callPackage ../development/python-modules/zipfile2 { };
zipp = callPackage ../development/python-modules/zipp { };
zipstream = callPackage ../development/python-modules/zipstream { };