Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/cachecontrol/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ buildPythonPackage rec {
owner = "ionrock";
repo = pname;
rev = "v${version}";
sha256 = "sha256-mgvL0q10UbPHY1H3tJprke5p8qNl3HNYoeLAERZTcTs=";
hash = "sha256-mgvL0q10UbPHY1H3tJprke5p8qNl3HNYoeLAERZTcTs=";
};

propagatedBuildInputs = [
lockfile
msgpack
requests
];

checkInputs = [
cherrypy
mock
lockfile
pytestCheckHook
];

Expand Down
52 changes: 52 additions & 0 deletions pkgs/development/python-modules/pip-api/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{ lib
, buildPythonPackage
, fetchPypi
, pip
, pretend
, pytestCheckHook
, pythonOlder
, virtualenv
}:

buildPythonPackage rec {
pname = "pip-api";
version = "0.0.29";
format = "setuptools";

disabled = pythonOlder "3.7";

src = fetchPypi {
inherit pname version;
hash = "sha256-9wFYTrHD4BAhyEb4nWKauTc7ZiTwYmdXd0rVT8TClXE=";
};

propagatedBuildInputs = [
pip
];

checkInputs = [
pretend
pytestCheckHook
virtualenv
];

pythonImportsCheck = [
"pip_api"
];

disabledTests = [
"test_hash"
"test_hash_default_algorithm_is_256"
"test_installed_distributions"
"test_invoke_install"
"test_invoke_uninstall"
"test_isolation"
];

meta = with lib; {
description = "Importable pip API";
homepage = "https://github.com/di/pip-api";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}
29 changes: 23 additions & 6 deletions pkgs/development/python-modules/pretend/default.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
{ lib, buildPythonPackage, fetchPypi }:
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, pythonOlder
}:

buildPythonPackage rec {
pname = "pretend";
version = "1.0.9";
format = "setuptools";

src = fetchPypi {
inherit pname version;
sha256 = "c90eb810cde8ebb06dafcb8796f9a95228ce796531bc806e794c2f4649aa1b10";
disabled = pythonOlder "3.7";

src = fetchFromGitHub {
owner = "alex";
repo = pname;
rev = "v${version}";
hash = "sha256-OqMfeIMFNBBLq6ejR3uOCIHZ9aA4zew7iefVlAsy1JQ=";
};

# No tests in archive
doCheck = false;
checkInputs = [
pytestCheckHook
];

pythonImportsCheck = [
"pretend"
];

meta = with lib; {
description = "Module for stubbing";
homepage = "https://github.com/alex/pretend";
license = licenses.bsd3;
maintainers = with maintainers; [ ];
};
}
83 changes: 83 additions & 0 deletions pkgs/development/tools/pip-audit/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{ lib
, fetchFromGitHub
, fetchpatch
, python3
}:

let
py = python3.override {
packageOverrides = self: super: {

# ansible doesn't support resolvelib > 0.6.0 and can't have an override
resolvelib = super.resolvelib.overridePythonAttrs (oldAttrs: rec {
version = "0.8.1";
src = fetchFromGitHub {
owner = "sarugaku";
repo = "resolvelib";
rev = version;
sha256 = "1qpd0gg9yl0kbamlgjs9pkxd39kx511kbc92civ77v0ka5sw8ca0";
};
});
};
};
in
with py.pkgs;

buildPythonApplication rec {
pname = "pip-audit";
version = "2.2.1";
format = "setuptools";

src = fetchFromGitHub {
owner = "trailofbits";
repo = pname;
rev = "v${version}";
hash = "sha256-ji61783imVlvoBaDMTxQwbf1L1G4lJbOFZ1FjcNOT/8=";
};

propagatedBuildInputs = [
cachecontrol
cyclonedx-python-lib
html5lib
packaging
pip-api
progress
resolvelib
];

checkInputs = [
pretend
pytestCheckHook
];

pythonImportsCheck = [
"pip_audit"
];

preCheck = ''
export HOME=$(mktemp -d);
'';

disabledTestPaths = [
# Tests require network access
"test/dependency_source/test_requirement.py"
"test/dependency_source/test_resolvelib.py"
"test/service/test_pypi.py"
"test/service/test_osv.py"
];

disabledTests = [
# Tests requrire network access
"test_get_pip_cache"
"test_virtual_env"
"test_pyproject_source"
"test_pyproject_source_duplicate_deps"
];

meta = with lib; {
description = "Tool for scanning Python environments for known vulnerabilities";
homepage = "https://github.com/trailofbits/pip-audit";
license = with licenses; [ asl20 ];
maintainers = with maintainers; [ fab ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14433,6 +14433,8 @@ with pkgs;

poetry2conda = python3Packages.callPackage ../development/python-modules/poetry2conda { };

pip-audit = callPackage ../development/tools/pip-audit {};

pipenv = callPackage ../development/tools/pipenv {};

pipewire = callPackage ../development/libraries/pipewire {
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6313,6 +6313,8 @@ in {

pipenv-poetry-migrate = callPackage ../development/python-modules/pipenv-poetry-migrate { };

pip-api = callPackage ../development/python-modules/pip-api { };

pip-tools = callPackage ../development/python-modules/pip-tools { };

pipx = callPackage ../development/python-modules/pipx { };
Expand Down