Merge pull request #325081 from NixOS/backport-317405-to-release-24.05

[Backport release-24.05] ansible-cmdb: init at 1.31, python3Packages.jsonxs: init at 0.6
This commit is contained in:
Masum Reza 2024-07-08 22:42:15 +05:30 committed by GitHub
commit 2539810c5b
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

@ -6128,6 +6128,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 { };