2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
requests,
|
2024-09-19 14:19:46 +00:00
|
|
|
requests-oauthlib,
|
|
|
|
setuptools,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ovh";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "1.2.0";
|
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-0xHwjsF7YsxhIWs9rPA+6J+VodqQNqWV2sKfydeYuCc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
requests
|
|
|
|
requests-oauthlib
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "ovh" ];
|
2023-04-29 16:46:19 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests require network access
|
|
|
|
"test_config_from_files"
|
|
|
|
"test_config_from_given_config_file"
|
|
|
|
"test_config_from_invalid_ini_file"
|
|
|
|
"test_config_from_only_one_file"
|
|
|
|
"test_endpoints"
|
2024-09-19 14:19:46 +00:00
|
|
|
# Tests require API key
|
|
|
|
"test_config_oauth2"
|
|
|
|
"test_config_invalid_both"
|
|
|
|
"test_config_invalid_oauth2"
|
|
|
|
"test_config_incompatible_oauth2"
|
2023-04-29 16:46:19 +00:00
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Thin wrapper around OVH's APIs";
|
|
|
|
homepage = "https://github.com/ovh/python-ovh";
|
2023-04-29 16:46:19 +00:00
|
|
|
changelog = "https://github.com/ovh/python-ovh/blob/v${version}/CHANGELOG.md";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ makefu ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|