diff --git a/pkgs/development/python-modules/sqlalchemy-continuum/default.nix b/pkgs/development/python-modules/sqlalchemy-continuum/default.nix index 77452fbccde6..501486e5059b 100644 --- a/pkgs/development/python-modules/sqlalchemy-continuum/default.nix +++ b/pkgs/development/python-modules/sqlalchemy-continuum/default.nix @@ -42,11 +42,20 @@ buildPythonPackage rec { i18n = [ sqlalchemy-i18n ]; }; - nativeCheckInputs = [ - psycopg2 - pymysql - pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + nativeCheckInputs = + [ + psycopg2 + pymysql + pytestCheckHook + ] + ++ optional-dependencies.flask + ++ optional-dependencies.flask-login + ++ optional-dependencies.flask-sqlalchemy; + + disabledTestPaths = [ + # requires sqlalchemy-i18n, which is incompatible with sqlalchemy>=2 + "tests/test_i18n.py" + ]; preCheck = '' # Indicate tests that we don't have a database server at hand diff --git a/pkgs/development/python-modules/sqlalchemy-i18n/default.nix b/pkgs/development/python-modules/sqlalchemy-i18n/default.nix index b3540712d926..172e1f352658 100644 --- a/pkgs/development/python-modules/sqlalchemy-i18n/default.nix +++ b/pkgs/development/python-modules/sqlalchemy-i18n/default.nix @@ -2,33 +2,54 @@ lib, fetchPypi, buildPythonPackage, + setuptools, sqlalchemy, sqlalchemy-utils, six, + postgresql, + postgresqlTestHook, + psycopg2, + pytestCheckHook, }: buildPythonPackage rec { pname = "sqlalchemy-i18n"; version = "1.1.0"; + pyproject = true; src = fetchPypi { pname = "SQLAlchemy-i18n"; inherit version; - sha256 = "de33376483a581ca14218d8f57a114466c5f72b674a95839b6c4564a6e67796f"; + hash = "sha256-3jM3ZIOlgcoUIY2PV6EURmxfcrZ0qVg5tsRWSm5neW8="; }; - propagatedBuildInputs = [ + build-system = [ setuptools ]; + + dependencies = [ sqlalchemy sqlalchemy-utils six ]; - # tests require running a postgresql server - doCheck = false; + pythonImportsCheck = [ "sqlalchemy_i18n" ]; - meta = with lib; { + nativeCheckInputs = [ + postgresql + postgresqlTestHook + psycopg2 + pytestCheckHook + ]; + + env = { + PGDATABASE = "sqlalchemy_i18n_test"; + postgresqlEnableTCP = 1; + }; + + meta = { homepage = "https://github.com/kvesteri/sqlalchemy-i18n"; description = "Internationalization extension for SQLAlchemy models"; - license = licenses.bsd3; + license = lib.licenses.bsd3; + # sqlalchemy.exc.InvalidRequestError: The 'sqlalchemy.orm.mapper()' function is removed as of SQLAlchemy 2.0. + broken = lib.versionAtLeast sqlalchemy.version "2"; }; }