diff --git a/pkgs/applications/misc/archivy/default.nix b/pkgs/applications/misc/archivy/default.nix index 70b3c71c0b39..6af4f67d8c65 100644 --- a/pkgs/applications/misc/archivy/default.nix +++ b/pkgs/applications/misc/archivy/default.nix @@ -1,15 +1,31 @@ -{ lib, buildPythonApplication, fetchPypi, appdirs, attrs -, beautifulsoup4, click-plugins, elasticsearch, flask-compress -, flask_login, flask_wtf, html2text, python-dotenv, python-frontmatter -, requests, tinydb, validators, werkzeug, wtforms }: +{ lib +, buildPythonApplication +, fetchPypi +, appdirs +, attrs +, beautifulsoup4 +, click-plugins +, elasticsearch +, flask-compress +, flask_login +, flask_wtf +, html2text +, python-dotenv +, python-frontmatter +, requests +, tinydb +, validators +, werkzeug +, wtforms +}: buildPythonApplication rec { pname = "archivy"; - version = "1.1.1"; + version = "1.1.4"; src = fetchPypi { inherit pname version; - sha256 = "sha256-yUXsTPb5oJYZA9MlHz7eLowRjD/ltq5VLTHeOMqcL/M="; + sha256 = "sha256-oSmwQcKvp9RABmc7aq6fdLOZapMauIi6+7azVTXVb30="; }; # Relax some dependencies @@ -22,6 +38,7 @@ buildPythonApplication rec { --replace 'python_frontmatter == 0.5.0' 'python_frontmatter' \ --replace 'requests ==' 'requests >=' \ --replace 'validators ==' 'validators >=' \ + --replace 'tinydb ==' 'tinydb >=' ''; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/karton-config-extractor/default.nix b/pkgs/development/python-modules/karton-config-extractor/default.nix new file mode 100644 index 000000000000..bb2b9d4903b9 --- /dev/null +++ b/pkgs/development/python-modules/karton-config-extractor/default.nix @@ -0,0 +1,39 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, karton-core +, malduck +}: + +buildPythonPackage rec { + pname = "karton-config-extractor"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "CERT-Polska"; + repo = pname; + rev = "v${version}"; + sha256 = "1v0zqa81yjz6hm17x9hp0iwkllymqzn84dd6r2yrhillbwnjg9bb"; + }; + + propagatedBuildInputs = [ + karton-core + malduck + ]; + + postPatch = '' + substituteInPlace requirements.txt \ + --replace "karton.core==4.0.5" "karton-core" + ''; + + # Project has no tests + doCheck = false; + pythonImportsCheck = [ "karton.config_extractor" ]; + + meta = with lib; { + description = "Static configuration extractor for the Karton framework"; + homepage = "https://github.com/CERT-Polska/karton-config-extractor"; + license = with licenses; [ bsd3 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/malduck/default.nix b/pkgs/development/python-modules/malduck/default.nix new file mode 100644 index 000000000000..a9a8419a04dc --- /dev/null +++ b/pkgs/development/python-modules/malduck/default.nix @@ -0,0 +1,48 @@ +{ lib +, buildPythonPackage +, capstone +, click +, cryptography +, fetchFromGitHub +, pefile +, pycryptodomex +, pyelftools +, pythonOlder +, typing-extensions +, yara-python +}: + +buildPythonPackage rec { + pname = "malduck"; + version = "4.1.0"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "CERT-Polska"; + repo = pname; + rev = "v${version}"; + sha256 = "04d8bhzax9ynbl83hif9i8gcs29zrvcay2r6n7mcxiixlxcqciak"; + }; + + propagatedBuildInputs = [ + capstone + click + cryptography + pefile + pycryptodomex + pyelftools + typing-extensions + yara-python + ]; + + # Project has no tests. They will come with the next release + doCheck = false; + pythonImportsCheck = [ "malduck" ]; + + meta = with lib; { + description = "Helper for malware analysis"; + homepage = "https://github.com/CERT-Polska/malduck"; + license = with licenses; [ bsd3 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/tinydb/default.nix b/pkgs/development/python-modules/tinydb/default.nix index 892b9a3f76fe..db162ecc2ac9 100644 --- a/pkgs/development/python-modules/tinydb/default.nix +++ b/pkgs/development/python-modules/tinydb/default.nix @@ -2,10 +2,9 @@ , buildPythonPackage , pythonOlder , fetchFromGitHub -, poetry +, poetry-core +, fetchpatch , pytestCheckHook -, pytestcov -, pytestrunner , pycodestyle , pyyaml }: @@ -20,20 +19,37 @@ buildPythonPackage rec { owner = "msiemens"; repo = pname; rev = "v${version}"; - sha256 = "1z5gnffizgbyhh20jy63bkkjh20ih8d62kcfhiaqa6rvnnffqmnw"; + sha256 = "sha256-3FbsnLU7G4VVhI5NYRqCEQgo51zDeAkEhH69H52zr/w="; }; - nativeBuildInputs = [ poetry ]; + nativeBuildInputs = [ + poetry-core + ]; + + patches = [ + # Switch to poetry-core, https://github.com/msiemens/tinydb/pull/391 + (fetchpatch { + name = "switch-to-peotry-core.patch"; + url = "https://github.com/msiemens/tinydb/commit/5b547c18e7ce9f5925d5943dfa47d408435a0da5.patch"; + sha256 = "19ma9ib020b82sn1mcr7sfysqbj8h6nbb365bih1x1wn3ym8xlbc"; + }) + ]; + + postPatch = '' + substituteInPlace pytest.ini \ + --replace "--cov-append --cov-report term --cov tinydb" "" + ''; checkInputs = [ pytestCheckHook - pytestcov pycodestyle pyyaml ]; + pythonImportsCheck = [ "tinydb" ]; + meta = with lib; { - description = "A lightweight document oriented database written in pure Python with no external dependencies"; + description = "Lightweight document oriented database written in Python"; homepage = "https://tinydb.readthedocs.org/"; changelog = "https://tinydb.readthedocs.io/en/latest/changelog.html"; license = licenses.mit; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c367eabc42e9..413421d2d8c8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3497,6 +3497,8 @@ in { karton-classifier = callPackage ../development/python-modules/karton-classifier { }; + karton-config-extractor = callPackage ../development/python-modules/karton-config-extractor { }; + karton-core = callPackage ../development/python-modules/karton-core { }; karton-mwdb-reporter = callPackage ../development/python-modules/karton-mwdb-reporter { }; @@ -3927,6 +3929,8 @@ in { Mako = callPackage ../development/python-modules/Mako { }; + malduck= callPackage ../development/python-modules/malduck { }; + managesieve = callPackage ../development/python-modules/managesieve { }; manhole = callPackage ../development/python-modules/manhole { };