1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 11:40:45 +00:00

Merge pull request #317405 from tie/ansible-cmdb

ansible-cmdb: init at 1.31, python3Packages.jsonxs: init at 0.6
This commit is contained in:
Masum Reza 2024-07-06 23:10:39 +05:30 committed by GitHub
commit 757c5d5f02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 134 additions and 0 deletions

View file

@ -0,0 +1,60 @@
{
lib,
fetchFromGitHub,
substituteAll,
python3Packages,
testers,
ansible-cmdb,
}:
let
inherit (python3Packages)
setuptools
mako
pyyaml
jsonxs
buildPythonApplication
;
pname = "ansible-cmdb";
version = "1.31";
in
buildPythonApplication {
inherit pname version;
pyproject = true;
src = fetchFromGitHub {
owner = "fboender";
repo = "ansible-cmdb";
rev = version;
hash = "sha256-HOFLX8fiid+xJOVYNyVbz5FunrhteAUPlvS3ctclVHo=";
};
patches = [
(substituteAll {
src = ./setup.patch;
inherit version;
})
];
build-system = [ setuptools ];
dependencies = [
mako
pyyaml
jsonxs
];
passthru.tests.version = testers.testVersion {
package = ansible-cmdb;
version = "v${version}";
};
meta = {
description = "Generate host overview from ansible fact gathering output";
homepage = "https://github.com/fboender/ansible-cmdb";
license = lib.licenses.gpl3Only;
maintainers = [ lib.maintainers.tie ];
mainProgram = "ansible-cmdb";
};
}

View file

@ -0,0 +1,41 @@
diff --git a/src/ansible-cmdb.py b/bin/ansible-cmdb
similarity index 100%
rename from src/ansible-cmdb.py
rename to bin/ansible-cmdb
diff --git a/setup.py b/setup.py
index a8db25d..c1670f1 100755
--- a/setup.py
+++ b/setup.py
@@ -42,17 +42,16 @@ setup(
package_dir={'': 'src'},
packages=find_packages('src'),
include_package_data=True,
- data_files=\
- get_data_files(
- 'src/ansiblecmdb/data',
- strip='src',
- prefix='lib'
- ) +
- [['lib/ansiblecmdb/', ['src/ansible-cmdb.py']]],
+ data_files=get_data_files(
+ 'src/ansiblecmdb/data',
+ strip='src',
+ prefix='lib',
+ ),
zip_safe=False,
- install_requires=['mako', 'pyyaml', 'ushlex', 'jsonxs'],
+ install_requires=['mako', 'pyyaml'],
+ extras_require={'jsonxs_templates': ['jsonxs']},
scripts=[
- 'src/ansible-cmdb',
+ 'bin/ansible-cmdb',
],
classifiers=[
diff --git a/src/ansiblecmdb/data/VERSION b/src/ansiblecmdb/data/VERSION
index 79d94e6..14d2ff6 100644
--- a/src/ansiblecmdb/data/VERSION
+++ b/src/ansiblecmdb/data/VERSION
@@ -1 +1 @@
-MASTER
+@version@

View file

@ -0,0 +1,31 @@
{
lib,
fetchFromGitHub,
buildPythonPackage,
setuptools,
}:
let
pname = "jsonxs";
version = "0.6";
in
buildPythonPackage {
inherit pname version;
pyproject = true;
src = fetchFromGitHub {
owner = "fboender";
repo = "jsonxs";
rev = "v${version}";
hash = "sha256-CmKK+qStb9xjmEACY41tQnffD4cMUUQPb74Cni5FTEk=";
};
build-system = [ setuptools ];
meta = {
description = "A python library that uses path expression strings to get and set values in JSON";
homepage = "https://github.com/fboender/jsonxs";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.tie ];
};
}

View file

@ -6230,6 +6230,8 @@ self: super: with self; {
json5 = callPackage ../development/python-modules/json5 { };
jsonxs = callPackage ../development/python-modules/jsonxs { };
jsonargparse = callPackage ../development/python-modules/jsonargparse { };
jsonconversion = callPackage ../development/python-modules/jsonconversion { };