Files
nixpkgs/pkgs/development/python-modules/osc-lib/default.nix
T
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

78 lines
1.7 KiB
Nix

{
lib,
buildPythonPackage,
cliff,
fetchFromGitHub,
keystoneauth1,
openstacksdk,
oslo-i18n,
oslo-utils,
pbr,
requests,
requests-mock,
setuptools,
stdenv,
stestr,
stevedore,
}:
buildPythonPackage rec {
pname = "osc-lib";
version = "4.2.0";
pyproject = true;
src = fetchFromGitHub {
owner = "openstack";
repo = "osc-lib";
tag = version;
hash = "sha256-5WoYamGRLz3fjebel1yxg39YGAK9ZfMbTXG6IXPnJYo=";
};
postPatch = ''
# TODO: somehow bring this to upstreams attention
substituteInPlace pyproject.toml \
--replace-fail '"osc_lib"' '"osc_lib", "osc_lib.api", "osc_lib.cli", "osc_lib.command", "osc_lib.tests", "osc_lib.tests.api", "osc_lib.tests.cli", "osc_lib.tests.command", "osc_lib.tests.utils", "osc_lib.utils"'
'';
env.PBR_VERSION = version;
build-system = [
pbr
setuptools
];
dependencies = [
cliff
keystoneauth1
openstacksdk
oslo-i18n
oslo-utils
requests
stevedore
];
nativeCheckInputs = [
requests-mock
stestr
];
checkPhase = ''
stestr run -e <(echo "
${lib.optionalString stdenv.hostPlatform.isDarwin ''
osc_lib.tests.test_shell.TestShellCli.test_shell_args_cloud_public
osc_lib.tests.test_shell.TestShellCli.test_shell_args_precedence
osc_lib.tests.test_shell.TestShellCliPrecedence.test_shell_args_precedence_1
osc_lib.tests.test_shell.TestShellCliPrecedence.test_shell_args_precedence_2
''}")
'';
pythonImportsCheck = [ "osc_lib" ];
meta = {
description = "OpenStackClient Library";
homepage = "https://github.com/openstack/osc-lib";
license = lib.licenses.asl20;
teams = [ lib.teams.openstack ];
};
}