fava: move to python3Packages (#461926)
This commit is contained in:
@@ -1,93 +1 @@
|
|||||||
{
|
{ python3Packages }: python3Packages.toPythonApplication python3Packages.fava
|
||||||
lib,
|
|
||||||
python3Packages,
|
|
||||||
buildNpmPackage,
|
|
||||||
fetchFromGitHub,
|
|
||||||
stdenv,
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
src = buildNpmPackage (finalAttrs: {
|
|
||||||
pname = "fava-frontend";
|
|
||||||
version = "1.30.7";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "beancount";
|
|
||||||
repo = "fava";
|
|
||||||
tag = "v${finalAttrs.version}";
|
|
||||||
hash = "sha256-gO6eJIFp/yWAXFWhUcqkkfk2pA8/vyTxgPRPBmv4a6Q=";
|
|
||||||
};
|
|
||||||
sourceRoot = "${finalAttrs.src.name}/frontend";
|
|
||||||
|
|
||||||
npmDepsHash = "sha256-cXIhEzYFpLOxUEY7lhTWW7R3/ptkx7hB9K92Fd2m1Ng=";
|
|
||||||
makeCacheWritable = true;
|
|
||||||
|
|
||||||
preBuild = ''
|
|
||||||
chmod -R u+w ..
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
cp -R .. $out
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
in
|
|
||||||
python3Packages.buildPythonApplication {
|
|
||||||
pname = "fava";
|
|
||||||
inherit (src) version;
|
|
||||||
pyproject = true;
|
|
||||||
|
|
||||||
inherit src;
|
|
||||||
|
|
||||||
patches = [ ./dont-compile-frontend.patch ];
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
substituteInPlace tests/test_cli.py \
|
|
||||||
--replace-fail '"fava"' '"${placeholder "out"}/bin/fava"'
|
|
||||||
'';
|
|
||||||
|
|
||||||
build-system = [ python3Packages.setuptools-scm ];
|
|
||||||
|
|
||||||
dependencies = with python3Packages; [
|
|
||||||
babel
|
|
||||||
beancount
|
|
||||||
beangulp
|
|
||||||
beanquery
|
|
||||||
cheroot
|
|
||||||
click
|
|
||||||
flask
|
|
||||||
flask-babel
|
|
||||||
jinja2
|
|
||||||
markdown2
|
|
||||||
ply
|
|
||||||
simplejson
|
|
||||||
werkzeug
|
|
||||||
watchfiles
|
|
||||||
];
|
|
||||||
|
|
||||||
nativeCheckInputs = [ python3Packages.pytestCheckHook ];
|
|
||||||
|
|
||||||
# tests/test_cli.py
|
|
||||||
__darwinAllowLocalNetworking = true;
|
|
||||||
|
|
||||||
# flaky, fails only on ci
|
|
||||||
disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ "tests/test_core_watcher.py" ];
|
|
||||||
|
|
||||||
env = {
|
|
||||||
# Disable some tests when building with beancount2
|
|
||||||
SNAPSHOT_IGNORE = lib.versions.major python3Packages.beancount.version == "2";
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Web interface for beancount";
|
|
||||||
mainProgram = "fava";
|
|
||||||
homepage = "https://beancount.github.io/fava";
|
|
||||||
changelog = "https://beancount.github.io/fava/changelog.html";
|
|
||||||
license = lib.licenses.mit;
|
|
||||||
maintainers = with lib.maintainers; [
|
|
||||||
bhipple
|
|
||||||
prince213
|
|
||||||
sigmanificient
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|||||||
111
pkgs/development/python-modules/fava/default.nix
Normal file
111
pkgs/development/python-modules/fava/default.nix
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildPythonPackage,
|
||||||
|
buildNpmPackage,
|
||||||
|
fetchFromGitHub,
|
||||||
|
stdenv,
|
||||||
|
babel,
|
||||||
|
beancount,
|
||||||
|
beangulp,
|
||||||
|
beanquery,
|
||||||
|
cheroot,
|
||||||
|
click,
|
||||||
|
flask,
|
||||||
|
flask-babel,
|
||||||
|
jinja2,
|
||||||
|
markdown2,
|
||||||
|
ply,
|
||||||
|
pytestCheckHook,
|
||||||
|
setuptools-scm,
|
||||||
|
simplejson,
|
||||||
|
watchfiles,
|
||||||
|
werkzeug,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
src = buildNpmPackage (finalAttrs: {
|
||||||
|
pname = "fava-frontend";
|
||||||
|
version = "1.30.7";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "beancount";
|
||||||
|
repo = "fava";
|
||||||
|
tag = "v${finalAttrs.version}";
|
||||||
|
hash = "sha256-gO6eJIFp/yWAXFWhUcqkkfk2pA8/vyTxgPRPBmv4a6Q=";
|
||||||
|
};
|
||||||
|
sourceRoot = "${finalAttrs.src.name}/frontend";
|
||||||
|
|
||||||
|
npmDepsHash = "sha256-cXIhEzYFpLOxUEY7lhTWW7R3/ptkx7hB9K92Fd2m1Ng=";
|
||||||
|
makeCacheWritable = true;
|
||||||
|
|
||||||
|
preBuild = ''
|
||||||
|
chmod -R u+w ..
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
cp -R .. $out
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
in
|
||||||
|
buildPythonPackage {
|
||||||
|
pname = "fava";
|
||||||
|
inherit (src) version;
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
inherit src;
|
||||||
|
|
||||||
|
patches = [ ./dont-compile-frontend.patch ];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace tests/test_cli.py \
|
||||||
|
--replace-fail '"fava"' '"${placeholder "out"}/bin/fava"'
|
||||||
|
'';
|
||||||
|
|
||||||
|
build-system = [ setuptools-scm ];
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
babel
|
||||||
|
beancount
|
||||||
|
beangulp
|
||||||
|
beanquery
|
||||||
|
cheroot
|
||||||
|
click
|
||||||
|
flask
|
||||||
|
flask-babel
|
||||||
|
jinja2
|
||||||
|
markdown2
|
||||||
|
ply
|
||||||
|
simplejson
|
||||||
|
werkzeug
|
||||||
|
watchfiles
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeCheckInputs = [ pytestCheckHook ];
|
||||||
|
|
||||||
|
pythonImportsCheck = [ "fava" ];
|
||||||
|
|
||||||
|
# tests/test_cli.py
|
||||||
|
__darwinAllowLocalNetworking = true;
|
||||||
|
|
||||||
|
# flaky, fails only on ci
|
||||||
|
disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ "tests/test_core_watcher.py" ];
|
||||||
|
|
||||||
|
env = {
|
||||||
|
# Disable some tests when building with beancount2
|
||||||
|
SNAPSHOT_IGNORE = lib.versions.major beancount.version == "2";
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Web interface for beancount";
|
||||||
|
mainProgram = "fava";
|
||||||
|
homepage = "https://beancount.github.io/fava";
|
||||||
|
changelog = "https://beancount.github.io/fava/changelog.html";
|
||||||
|
license = lib.licenses.mit;
|
||||||
|
maintainers = with lib.maintainers; [
|
||||||
|
bhipple
|
||||||
|
prince213
|
||||||
|
sigmanificient
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -5206,6 +5206,8 @@ self: super: with self; {
|
|||||||
|
|
||||||
faust-cchardet = callPackage ../development/python-modules/faust-cchardet { };
|
faust-cchardet = callPackage ../development/python-modules/faust-cchardet { };
|
||||||
|
|
||||||
|
fava = callPackage ../development/python-modules/fava { };
|
||||||
|
|
||||||
favicon = callPackage ../development/python-modules/favicon { };
|
favicon = callPackage ../development/python-modules/favicon { };
|
||||||
|
|
||||||
fe25519 = callPackage ../development/python-modules/fe25519 { };
|
fe25519 = callPackage ../development/python-modules/fe25519 { };
|
||||||
|
|||||||
Reference in New Issue
Block a user