Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fava: 1.3 -> 1.5, refactor and fetchfromPypi #31212

Merged
merged 2 commits into from
Nov 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 16 additions & 32 deletions pkgs/applications/office/fava/default.nix
Original file line number Diff line number Diff line change
@@ -1,42 +1,26 @@
{ stdenv, pkgs, fetchurl, python3Packages, fetchFromGitHub, fetchzip, python3, beancount }:

python3Packages.buildPythonApplication rec {
version = "1.3";
name = "fava-${version}";

src = fetchFromGitHub {
owner = "beancount";
repo = "fava";
rev = "v${version}";
sha256 = "0g0aj0qcmpny6dipi00nks7h3mf5a4jfd6bxjm1rb5807wswcpg8";
};

assets = fetchzip {
url = "https://github.com/beancount/fava/releases/download/v${version}/fava-${version}.tar.gz";
sha256 = "0yn2psbn436g1w5ixn94z8ca6dfd54izg98979arn0k7slpiccvz";
{ stdenv, python3, beancount }:

let
inherit (python3.pkgs) buildPythonApplication fetchPypi;
in
buildPythonApplication rec {
pname = "fava";
version = "1.5";
name = "${pname}-${version}";

src = fetchPypi {
inherit pname version;
sha256 = "0d3jncidzvfsxjplzg4cmflqr4mxrbrlj5bh6fpxj529pialpkk6";
};

checkInputs = with python3Packages; [ pytest ];

checkPhase = ''
# pyexcel is optional
# the other 2 tests fail due non-unicode locales
PATH=$out/bin:$PATH pytest tests \
--ignore tests/test_util_excel.py \
--ignore tests/test_cli.py \
--ignore tests/test_translations.py \
'';

postInstall = ''
cp -r $assets/fava/static/gen $out/${python3.sitePackages}/fava/static
'';
doCheck = false;

propagatedBuildInputs = with python3Packages;
propagatedBuildInputs = with python3.pkgs;
[ flask dateutil pygments wheel markdown2 flaskbabel tornado
click beancount ];

meta = {
homepage = https://github.com/aumayr/fava;
homepage = https://beancount.github.io/fava;
description = "Web interface for beancount";
license = stdenv.lib.licenses.mit;
maintainers = with stdenv.lib.maintainers; [ matthiasbeyer ];
Expand Down