python312Packages.sqlalchemy-i18n: refactor and mark as broken (#373360)

This commit is contained in:
OTABI Tomoya
2025-01-19 20:02:33 +09:00
committed by GitHub
2 changed files with 41 additions and 11 deletions
@@ -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
@@ -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";
};
}