Files
nixpkgs/pkgs/development/python-modules/python-jose/default.nix
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

69 lines
1.5 KiB
Nix

{
lib,
buildPythonPackage,
cryptography,
fetchFromGitHub,
fetchpatch,
pycrypto,
pycryptodome,
pytestCheckHook,
setuptools,
}:
buildPythonPackage rec {
pname = "python-jose";
version = "3.5.0";
pyproject = true;
src = fetchFromGitHub {
owner = "mpdavis";
repo = "python-jose";
tag = version;
hash = "sha256-8DQ0RBQ4ZgEIwcosgX3dzr928cYIQoH0obIOgk0+Ozs=";
};
patches = [
# https://github.com/mpdavis/python-jose/pull/393
(fetchpatch {
name = "fix-test_incorrect_public_key_hmac_signing.patch";
url = "https://github.com/mpdavis/python-jose/commit/7c0e4c6640bdc9cd60ac66d96d5d90f4377873db.patch";
hash = "sha256-bCzxZEWKYD20TLqzVv6neZlpU41otbVqaXc7C0Ky9BQ=";
})
];
pythonRemoveDeps = [
# These aren't needed if the cryptography backend is used:
# https://github.com/mpdavis/python-jose/blob/3.5.0/README.rst#cryptographic-backends
"ecdsa"
"pyasn1"
"rsa"
];
build-system = [ setuptools ];
dependencies = [
cryptography
];
optional-dependencies = {
cryptography = [ cryptography ];
pycrypto = [ pycrypto ];
pycryptodome = [ pycryptodome ];
};
nativeCheckInputs = [
pytestCheckHook
]
++ lib.concatAttrValues optional-dependencies;
pythonImportsCheck = [ "jose" ];
meta = {
description = "JOSE implementation in Python";
homepage = "https://github.com/mpdavis/python-jose";
changelog = "https://github.com/mpdavis/python-jose/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = [ ];
};
}