Files
nixpkgs/pkgs/development/python-modules/flit-gettext/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.4 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
replaceVars,
# build-system
flit-scm,
wheel,
# dependencies
flit-core,
gettext,
# tests
build,
pytestCheckHook,
pytest-cov-stub,
}:
buildPythonPackage rec {
pname = "flit-gettext";
version = "1.0.1";
pyproject = true;
src = fetchFromGitHub {
owner = "codingjoe";
repo = "flit-gettext";
rev = version;
hash = "sha256-rrGRkZ7GeFdDZ7m1oLq/7nEjx6NY2+YWvLrtfRr4+Jw=";
};
patches = [
(replaceVars ./msgfmt-path.patch {
msgfmt = lib.getExe' gettext "msgfmt";
})
];
nativeBuildInputs = [
flit-scm
wheel
];
propagatedBuildInputs = [ flit-core ];
optional-dependencies = {
scm = [ flit-scm ];
};
nativeCheckInputs = [
build
pytestCheckHook
pytest-cov-stub
wheel
]
++ optional-dependencies.scm;
disabledTests = [
# tests for missing msgfmt, but we always provide it
"test_compile_gettext_translations__no_gettext"
];
disabledTestPaths = [
# calls python -m build, but can't find build
"tests/test_core.py"
"tests/test_scm.py"
];
pythonImportsCheck = [ "flit_gettext" ];
meta = {
description = "Compiling gettext i18n messages during project bundling";
homepage = "https://github.com/codingjoe/flit-gettext";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ hexa ];
};
}