Skip to content

Commit 1e9bf68

Browse files
arunabh98jsoo1
andcommitted
add the pymisp package to the list of python packages.
Co-Authored-By: John Soo <[email protected]>
1 parent c398b0b commit 1e9bf68

File tree

3 files changed

+86
-0
lines changed

3 files changed

+86
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder, pytestCheckHook, pytest-mock, poetry-core
2+
, requests, python-dateutil, jsonschema, deprecated
3+
}:
4+
5+
let version = "2.4.174"; in
6+
7+
buildPythonPackage {
8+
pname = "pymisp";
9+
inherit version;
10+
format = "pyproject";
11+
disabled = pythonOlder "3.8";
12+
13+
src = fetchFromGitHub {
14+
owner = "MISP";
15+
repo = "PyMISP";
16+
rev = "v${version}";
17+
hash = "sha256-OBchUEz+ZK6XNbnFFL6nsCuXniZ0vAfdJLj6LaFC2i0=";
18+
};
19+
20+
patches = [ ./pymisp-remove-poetry-group.patch ];
21+
22+
postPatch = ''
23+
substituteInPlace pyproject.toml \
24+
--replace 'jsonschema = "^4.18.4"' 'jsonschema = "*"' \
25+
--replace 'requests = "^2.31.0"' 'requests = "*"' \
26+
--replace 'deprecated = "^1.2.14"' 'deprecated = "*"' \
27+
--replace 'publicsuffixlist = {version = "^0.10.0.20230730", optional = true}' ""
28+
'';
29+
30+
nativeBuildInputs = [ poetry-core ];
31+
32+
checkInputs = [ pytestCheckHook pytest-mock ];
33+
34+
propagatedBuildInputs = [
35+
requests python-dateutil jsonschema deprecated
36+
];
37+
38+
# testing optional email feature
39+
pytestFlagsArray = [ "--ignore tests/test_emailobject.py" ];
40+
41+
disabledTests = [
42+
"test_mime"
43+
"test_default_attributes"
44+
"test_feed"
45+
"test_git_vuln_finder"
46+
"test_obj_default_values"
47+
"test_object_galaxy"
48+
"test_object_tag"
49+
"test_to_dict_json_format"
50+
];
51+
52+
meta = with lib; {
53+
description = "Python API for MISP";
54+
homepage = "https://github.com/MISP/PyMISP";
55+
maintainers = [ maintainers.jsoo1 ];
56+
platforms = platforms.unix;
57+
license = licenses.bsd2;
58+
};
59+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff --git a/pyproject.toml b/pyproject.toml
2+
index 7fc1a65..15548d8 100644
3+
--- a/pyproject.toml
4+
+++ b/pyproject.toml
5+
@@ -71,20 +71,6 @@ url = ['pyfaup']
6+
email = ['extract_msg', "RTFDE", "oletools"]
7+
brotli = ['urllib3']
8+
9+
-[tool.poetry.group.dev.dependencies]
10+
-requests-mock = "^1.11.0"
11+
-mypy = "^1.4.1"
12+
-ipython = [
13+
- {version = "<8.13.0", python = "<3.9"},
14+
- {version = "^8.13.0", python = ">=3.9"}
15+
-]
16+
-jupyterlab = "^4.0.3"
17+
-types-requests = "^2.31.0.2"
18+
-types-python-dateutil = "^2.8.19.14"
19+
-types-redis = "^4.6.0.3"
20+
-types-Flask = "^1.1.6"
21+
-pytest-cov = "^4.1.0"
22+
-
23+
[build-system]
24+
requires = ["poetry_core>=1.1", "setuptools"]
25+
build-backend = "poetry.core.masonry.api"

pkgs/top-level/python-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7381,6 +7381,8 @@ in {
73817381

73827382
pymfy = callPackage ../development/python-modules/pymfy { };
73837383

7384+
pymisp = callPackage ../development/python-modules/pymisp { };
7385+
73847386
pymodbus = callPackage ../development/python-modules/pymodbus { };
73857387

73867388
pymongo = callPackage ../development/python-modules/pymongo { };

0 commit comments

Comments
 (0)