Merge pull request #85023 from symphorien/update-ihatemony
python3Packages.ihatemoney: 4.1 -> 4.2
This commit is contained in:
commit
ed72058658
@ -1,5 +1,11 @@
|
|||||||
|
{ system ? builtins.currentSystem,
|
||||||
|
config ? {},
|
||||||
|
pkgs ? import ../.. { inherit system config; }
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
f = backend: import ./make-test-python.nix ({ pkgs, ... }: {
|
inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
|
||||||
|
f = backend: makeTest {
|
||||||
name = "ihatemoney-${backend}";
|
name = "ihatemoney-${backend}";
|
||||||
machine = { lib, ... }: {
|
machine = { lib, ... }: {
|
||||||
services.ihatemoney = {
|
services.ihatemoney = {
|
||||||
@ -24,9 +30,10 @@ let
|
|||||||
testScript = ''
|
testScript = ''
|
||||||
machine.wait_for_open_port(8000)
|
machine.wait_for_open_port(8000)
|
||||||
machine.wait_for_unit("uwsgi.service")
|
machine.wait_for_unit("uwsgi.service")
|
||||||
|
machine.wait_until_succeeds("curl http://localhost:8000")
|
||||||
|
|
||||||
assert '"yay"' in machine.succeed(
|
assert '"yay"' in machine.succeed(
|
||||||
"curl -X POST http://localhost:8000/api/projects -d 'name=yay&id=yay&password=yay&contact_email=yay\@example.com'"
|
"curl -X POST http://localhost:8000/api/projects -d 'name=yay&id=yay&password=yay&contact_email=yay@example.com'"
|
||||||
)
|
)
|
||||||
owner, timestamp = machine.succeed(
|
owner, timestamp = machine.succeed(
|
||||||
"stat --printf %U:%G___%Y /var/lib/ihatemoney/secret_key"
|
"stat --printf %U:%G___%Y /var/lib/ihatemoney/secret_key"
|
||||||
@ -48,7 +55,7 @@ let
|
|||||||
|
|
||||||
assert "ihatemoney" in machine.succeed("curl http://localhost:8000")
|
assert "ihatemoney" in machine.succeed("curl http://localhost:8000")
|
||||||
'';
|
'';
|
||||||
});
|
};
|
||||||
in {
|
in {
|
||||||
ihatemoney-sqlite = f "sqlite";
|
ihatemoney-sqlite = f "sqlite";
|
||||||
ihatemoney-postgresql = f "postgresql";
|
ihatemoney-postgresql = f "postgresql";
|
||||||
|
42
pkgs/development/python-modules/debts/default.nix
Normal file
42
pkgs/development/python-modules/debts/default.nix
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{ lib
|
||||||
|
, python
|
||||||
|
, buildPythonPackage
|
||||||
|
, fetchFromGitLab
|
||||||
|
, isPy27
|
||||||
|
, jinja2
|
||||||
|
, pytest
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "debts";
|
||||||
|
version = "0.5";
|
||||||
|
|
||||||
|
# pypi does not ship tests
|
||||||
|
src = fetchFromGitLab {
|
||||||
|
domain = "framagit.org";
|
||||||
|
owner = "almet";
|
||||||
|
repo = "debts";
|
||||||
|
rev = "d887bd8b340172d1c9bbcca6426529b8d1c2a241"; # no tags
|
||||||
|
sha256 = "1d66nka81mv9c07mki78lp5hdajqv4cq6aq2k7bh3mhkc5hwnwlg";
|
||||||
|
};
|
||||||
|
|
||||||
|
disabled = isPy27;
|
||||||
|
|
||||||
|
propagatedBuildInputs = [ jinja2 ];
|
||||||
|
|
||||||
|
checkInputs = [ pytest ];
|
||||||
|
|
||||||
|
# for some reason tests only work if the module is properly installed
|
||||||
|
checkPhase = ''
|
||||||
|
rm -r debts
|
||||||
|
export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH
|
||||||
|
py.test tests
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
inherit (src.meta) homepage;
|
||||||
|
description = "A simple library and cli-tool to help you solve some debts settlement scenarios";
|
||||||
|
license = licenses.beerware;
|
||||||
|
maintainers = [ maintainers.symphorien ];
|
||||||
|
};
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
{ buildPythonPackage, lib, fetchFromGitHub, isPy27, nixosTests
|
{ buildPythonPackage, lib, fetchFromGitHub, isPy27, nixosTests, fetchpatch, fetchPypi
|
||||||
, alembic
|
, alembic
|
||||||
, aniso8601
|
, aniso8601
|
||||||
, Babel
|
, Babel
|
||||||
@ -15,33 +15,65 @@
|
|||||||
, flask_script
|
, flask_script
|
||||||
, flask_sqlalchemy
|
, flask_sqlalchemy
|
||||||
, flask_wtf
|
, flask_wtf
|
||||||
|
, debts
|
||||||
, idna
|
, idna
|
||||||
, itsdangerous
|
, itsdangerous
|
||||||
, jinja2
|
, jinja2
|
||||||
, Mako
|
, Mako
|
||||||
, markupsafe
|
, markupsafe
|
||||||
, mock
|
|
||||||
, python-dateutil
|
, python-dateutil
|
||||||
, pytz
|
, pytz
|
||||||
, six
|
, six
|
||||||
, sqlalchemy
|
, sqlalchemy
|
||||||
|
, sqlalchemy-continuum
|
||||||
, werkzeug
|
, werkzeug
|
||||||
, wtforms
|
, wtforms
|
||||||
, psycopg2 # optional, for postgresql support
|
, psycopg2 # optional, for postgresql support
|
||||||
, flask_testing
|
, flask_testing
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
# ihatemoney is not really a library. It will only ever be imported
|
||||||
|
# by the interpreter of uwsgi. So overrides for its depencies are fine.
|
||||||
|
let
|
||||||
|
# https://github.com/spiral-project/ihatemoney/issues/567
|
||||||
|
pinned_wtforms = wtforms.overridePythonAttrs (old: rec {
|
||||||
|
pname = "WTForms";
|
||||||
|
version = "2.2.1";
|
||||||
|
src = fetchPypi {
|
||||||
|
inherit pname version;
|
||||||
|
sha256 = "0q9vkcq6jnnn618h27lx9sas6s9qlg2mv8ja6dn0hy38gwzarnqc";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
pinned_flask_wtf = flask_wtf.override { wtforms = pinned_wtforms; };
|
||||||
|
in
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "ihatemoney";
|
pname = "ihatemoney";
|
||||||
version = "4.1";
|
version = "4.2";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "spiral-project";
|
owner = "spiral-project";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = version;
|
rev = version;
|
||||||
sha256 = "1ai7v2i2rvswzv21nwyq51fvp8lr2x2cl3n34p11br06kc1pcmin";
|
sha256 = "0d4vc6m0jkwlz9ly0hcjghccydvqbldh2jb8yzf94jrgkd5fd7k1";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
disabled = isPy27;
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
# fix migration on postgresql
|
||||||
|
# remove on next release
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://github.com/spiral-project/ihatemoney/commit/6129191b26784b895e203fa3eafb89cee7d88b71.patch";
|
||||||
|
sha256 = "0yc24gsih9x3pnh2mhj4v5i71x02dq93a9jd2r8b1limhcl4p1sw";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
# remove draconian pinning
|
||||||
|
sed -i 's/==.*$//' setup.cfg
|
||||||
|
'';
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
alembic
|
alembic
|
||||||
aniso8601
|
aniso8601
|
||||||
@ -58,7 +90,7 @@ buildPythonPackage rec {
|
|||||||
flask-restful
|
flask-restful
|
||||||
flask_script
|
flask_script
|
||||||
flask_sqlalchemy
|
flask_sqlalchemy
|
||||||
flask_wtf
|
pinned_flask_wtf
|
||||||
idna
|
idna
|
||||||
itsdangerous
|
itsdangerous
|
||||||
jinja2
|
jinja2
|
||||||
@ -68,14 +100,16 @@ buildPythonPackage rec {
|
|||||||
pytz
|
pytz
|
||||||
six
|
six
|
||||||
sqlalchemy
|
sqlalchemy
|
||||||
|
sqlalchemy-continuum
|
||||||
werkzeug
|
werkzeug
|
||||||
wtforms
|
pinned_wtforms
|
||||||
psycopg2
|
psycopg2
|
||||||
|
debts
|
||||||
];
|
];
|
||||||
|
|
||||||
checkInputs = [
|
checkInputs = [
|
||||||
flask_testing
|
flask_testing
|
||||||
] ++ lib.optionals isPy27 [ mock ];
|
];
|
||||||
|
|
||||||
passthru.tests = {
|
passthru.tests = {
|
||||||
inherit (nixosTests) ihatemoney;
|
inherit (nixosTests) ihatemoney;
|
||||||
|
@ -0,0 +1,46 @@
|
|||||||
|
{ stdenv
|
||||||
|
, lib
|
||||||
|
, fetchPypi
|
||||||
|
, buildPythonPackage
|
||||||
|
, flask
|
||||||
|
, flask_login
|
||||||
|
, flask_sqlalchemy
|
||||||
|
, flexmock
|
||||||
|
, pytestCheckHook
|
||||||
|
, sqlalchemy
|
||||||
|
, sqlalchemy-utils
|
||||||
|
, sqlalchemy-i18n
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "SQLAlchemy-Continuum";
|
||||||
|
version = "1.3.9";
|
||||||
|
|
||||||
|
src = fetchPypi {
|
||||||
|
inherit pname version;
|
||||||
|
sha256 = "0b7q0rqy5q7m9yw7yl7jzrk8p1jh1hqmqvzf45rwmwxs724kfkjg";
|
||||||
|
};
|
||||||
|
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
sqlalchemy
|
||||||
|
sqlalchemy-utils
|
||||||
|
];
|
||||||
|
|
||||||
|
# indicate tests that we don't have a database server at hand
|
||||||
|
DB = "sqlite";
|
||||||
|
|
||||||
|
checkInputs = [
|
||||||
|
pytestCheckHook
|
||||||
|
sqlalchemy-i18n
|
||||||
|
flask
|
||||||
|
flask_login
|
||||||
|
flask_sqlalchemy
|
||||||
|
flexmock
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/kvesteri/sqlalchemy-continuum/";
|
||||||
|
description = "Versioning and auditing extension for SQLAlchemy";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
};
|
||||||
|
}
|
32
pkgs/development/python-modules/sqlalchemy-i18n/default.nix
Normal file
32
pkgs/development/python-modules/sqlalchemy-i18n/default.nix
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{ stdenv
|
||||||
|
, lib
|
||||||
|
, fetchPypi
|
||||||
|
, buildPythonPackage
|
||||||
|
, sqlalchemy
|
||||||
|
, sqlalchemy-utils
|
||||||
|
, psycopg2
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "SQLAlchemy-i18n";
|
||||||
|
version = "1.0.3";
|
||||||
|
|
||||||
|
src = fetchPypi {
|
||||||
|
inherit pname version;
|
||||||
|
sha256 = "15xah8643p29kciz365ixs9pbsflj92pzr2d9anbdh2biyf4cka8";
|
||||||
|
};
|
||||||
|
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
sqlalchemy
|
||||||
|
sqlalchemy-utils
|
||||||
|
];
|
||||||
|
|
||||||
|
# tests require running a postgresql server
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/kvesteri/sqlalchemy-i18n";
|
||||||
|
description = "Internationalization extension for SQLAlchemy models";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
};
|
||||||
|
}
|
@ -54,11 +54,11 @@ in
|
|||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "uwsgi";
|
pname = "uwsgi";
|
||||||
version = "2.0.18";
|
version = "2.0.19.1";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://projects.unbit.it/downloads/${pname}-${version}.tar.gz";
|
url = "https://projects.unbit.it/downloads/${pname}-${version}.tar.gz";
|
||||||
sha256 = "10zmk4npknigmbqcq1wmhd461dk93159px172112vyq0i19sqwj9";
|
sha256 = "0256v72b7zr6ds4srpaawk1px3bp0djdwm239w3wrxpw7dzk1gjn";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ python3 pkgconfig ];
|
nativeBuildInputs = [ python3 pkgconfig ];
|
||||||
|
@ -683,6 +683,8 @@ in {
|
|||||||
inherit (pkgs) dbus pkgconfig;
|
inherit (pkgs) dbus pkgconfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
debts = callPackage ../development/python-modules/debts { };
|
||||||
|
|
||||||
dftfit = callPackage ../development/python-modules/dftfit { };
|
dftfit = callPackage ../development/python-modules/dftfit { };
|
||||||
|
|
||||||
dicom2nifti = callPackage ../development/python-modules/dicom2nifti { };
|
dicom2nifti = callPackage ../development/python-modules/dicom2nifti { };
|
||||||
@ -6025,6 +6027,10 @@ in {
|
|||||||
|
|
||||||
sqlalchemy-citext = callPackage ../development/python-modules/sqlalchemy-citext { };
|
sqlalchemy-citext = callPackage ../development/python-modules/sqlalchemy-citext { };
|
||||||
|
|
||||||
|
sqlalchemy-continuum = callPackage ../development/python-modules/sqlalchemy-continuum { };
|
||||||
|
|
||||||
|
sqlalchemy-i18n = callPackage ../development/python-modules/sqlalchemy-i18n { };
|
||||||
|
|
||||||
sqlalchemy_migrate = callPackage ../development/python-modules/sqlalchemy-migrate { };
|
sqlalchemy_migrate = callPackage ../development/python-modules/sqlalchemy-migrate { };
|
||||||
|
|
||||||
sqlalchemy-utils = callPackage ../development/python-modules/sqlalchemy-utils { };
|
sqlalchemy-utils = callPackage ../development/python-modules/sqlalchemy-utils { };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user