writers: add writeGuile[Bin] (#364531)
[NixPkgs.git] / pkgs / development / python-modules / passlib / default.nix
blob396afc45dfbef3e40fcc7df9551bda1b5b0dfad6
2   lib,
3   buildPythonPackage,
4   fetchFromGitLab,
5   argon2-cffi,
6   bcrypt,
7   cryptography,
8   pytestCheckHook,
9   pythonOlder,
10   pytest-xdist,
11   setuptools,
14 buildPythonPackage rec {
15   pname = "passlib";
16   version = "1.7.4";
17   pyproject = true;
19   disabled = pythonOlder "3.7";
21   src = fetchFromGitLab {
22     domain = "foss.heptapod.net";
23     owner = "python-libs";
24     repo = "passlib";
25     rev = "refs/tags/${version}";
26     hash = "sha256-Mx2Xg/KAEfvfep2B/gWATTiAPJc+f22MTcsEdRpt3n8=";
27   };
29   build-system = [ setuptools ];
31   dependencies = [ setuptools ];
33   optional-dependencies = {
34     argon2 = [ argon2-cffi ];
35     bcrypt = [ bcrypt ];
36     totp = [ cryptography ];
37   };
39   # Fix for https://foss.heptapod.net/python-libs/passlib/-/issues/190
40   postPatch = ''
41     substituteInPlace passlib/handlers/bcrypt.py \
42       --replace-fail "version = _bcrypt.__about__.__version__" \
43       "version = getattr(getattr(_bcrypt, '__about__', _bcrypt), '__version__', '<unknown>')"
44   '';
46   nativeCheckInputs =
47     [
48       pytestCheckHook
49       pytest-xdist
50     ]
51     ++ optional-dependencies.argon2
52     ++ optional-dependencies.bcrypt
53     ++ optional-dependencies.totp;
55   pythonImportsCheck = [ "passlib" ];
57   disabledTests = [
58     # timming sensitive
59     "test_dummy_verify"
60     "test_encrypt_cost_timing"
61     # These tests fail because they don't expect support for algorithms provided through libxcrypt
62     "test_82_crypt_support"
63   ];
65   pytestFlagsArray = [
66     # hashing algorithms we don't support anymore
67     "--deselect=passlib/tests/test_handlers.py::des_crypt_os_crypt_test::test_82_crypt_support"
68     "--deselect=passlib/tests/test_handlers.py::md5_crypt_os_crypt_test::test_82_crypt_support"
69     "--deselect=passlib/tests/test_handlers.py::sha256_crypt_os_crypt_test::test_82_crypt_support"
70   ];
72   meta = {
73     changelog = "https://foss.heptapod.net/python-libs/passlib/-/blob/${version}/docs/history/${lib.versions.majorMinor version}.rst";
74     description = "Password hashing library for Python";
75     homepage = "https://foss.heptapod.net/python-libs/passlib";
76     license = lib.licenses.bsdOriginal;
77     maintainers = with lib.maintainers; [ dotlambda ];
78   };