From 7e1921a7f3cf1602fb9b007950f7cf01698922ce Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 2 Sep 2023 23:45:40 +0200 Subject: [PATCH 1/4] maintainers: Add soispha --- maintainers/maintainer-list.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 74000d81661f..cd88a32c1176 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -16136,6 +16136,16 @@ fingerprint = "E067 520F 5EF2 C175 3F60 50C0 BA46 725F 6A26 7442"; }]; }; + soispha = { + name = "Soispha"; + email = "soispha@vhack.eu"; + matrix = "@soispha:vhack.eu"; + github = "soispha"; + githubId = 132207423; + keys = [{ + fingerprint = "9606 FC74 9FCE 1636 0723 D4AD A5E9 4010 C3A6 42AD"; + }]; + }; solson = { email = "scott@solson.me"; matrix = "@solson:matrix.org"; From 6f66321bf79ed071e7e0c026e6f00884e7ebb8f8 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 2 Sep 2023 23:48:48 +0200 Subject: [PATCH 2/4] pythonPackages.schemainspect: init at 3.1.1663587362 --- .../python-modules/schemainspect/default.nix | 118 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 120 insertions(+) create mode 100644 pkgs/development/python-modules/schemainspect/default.nix diff --git a/pkgs/development/python-modules/schemainspect/default.nix b/pkgs/development/python-modules/schemainspect/default.nix new file mode 100644 index 000000000000..1703853f3c92 --- /dev/null +++ b/pkgs/development/python-modules/schemainspect/default.nix @@ -0,0 +1,118 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, fetchpatch +, pythonOlder +, sqlalchemy +, sqlbag +, setuptools +, poetry-core +, pytestCheckHook +, pytest-xdist +, pytest-sugar +, postgresql +, postgresqlTestHook +, +}: +buildPythonPackage rec { + pname = "schemainspect"; + version = "3.1.1663587362"; + format = "pyproject"; + disable = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "djrobstep"; + repo = pname; + # no tags on github, version patch number is unix time. + rev = "066262d6fb4668f874925305a0b7dbb3ac866882"; + hash = "sha256-SYpQQhlvexNc/xEgSIk8L8J+Ta+3OZycGLeZGQ6DWzk="; + }; + + patches = [ + # https://github.com/djrobstep/schemainspect/pull/87 + (fetchpatch + { + name = "specify_poetry.patch"; + url = "https://github.com/djrobstep/schemainspect/commit/bdcd001ef7798236fe0ff35cef52f34f388bfe68.patch"; + hash = "sha256-/SEmcV9GjjvzfbszeGPkfd2DvYenl7bZyWdC0aI3M4M="; + }) + ]; + + nativeBuildInputs = [ + poetry-core + ]; + propagatedBuildInputs = [ + setuptools # needed for 'pkg_resources' + sqlalchemy + ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-xdist + pytest-sugar + + postgresql + postgresqlTestHook + + sqlbag + ]; + + preCheck = '' + export PGUSER="nixbld"; + export postgresqlEnableTCP=1; + ''; + disabledTests = [ + # These all fail with "List argument must consist only of tuples or dictionaries": + # Related issue: https://github.com/djrobstep/schemainspect/issues/88 + "test_can_replace" + "test_collations" + "test_constraints" + "test_dep_order" + "test_enum_deps" + "test_exclusion_constraint" + "test_fk_col_order" + "test_fk_info" + "test_generated_columns" + "test_identity_columns" + "test_indexes" + "test_inherit" + "test_kinds" + "test_lineendings" + "test_long_identifiers" + "test_partitions" + "test_postgres_inspect" + "test_postgres_inspect_excludeschema" + "test_postgres_inspect_sigleschema" + "test_raw_connection" + "test_relationship" + "test_replica_trigger" + "test_rls" + "test_separate_validate" + "test_sequences" + "test_table_dependency_order" + "test_types_and_domains" + "test_view_trigger" + "test_weird_names" + ]; + + pytestFlagsArray = [ + "-x" + "-svv" + "tests" + ]; + pythonImportsCheck = [ + "schemainspect" + ]; + + postUnpack = '' + # this dir is used to bump the version number, having it here fails the build + rm -r ./source/deploy + ''; + + meta = with lib; { + description = "Schema inspection for PostgreSQL, and potentially others"; + homepage = "https://github.com/djrobstep/schemainspect"; + license = with licenses; [ unlicense ]; + maintainers = with maintainers; [ soispha ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4cf1f0a21474..75f09aa1581b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11576,6 +11576,8 @@ self: super: with self; { schema = callPackage ../development/python-modules/schema { }; + schemainspect = callPackage ../development/python-modules/schemainspect { }; + schema-salad = callPackage ../development/python-modules/schema-salad { }; schemdraw = callPackage ../development/python-modules/schemdraw { }; From 2bd1c265317898e953bff5bb1c453942261adf35 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 2 Sep 2023 23:57:08 +0200 Subject: [PATCH 3/4] pythonPackages.sqlbag: init at 0.1.1617247075 --- .../python-modules/sqlbag/default.nix | 95 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 97 insertions(+) create mode 100644 pkgs/development/python-modules/sqlbag/default.nix diff --git a/pkgs/development/python-modules/sqlbag/default.nix b/pkgs/development/python-modules/sqlbag/default.nix new file mode 100644 index 000000000000..8b21d89ad5da --- /dev/null +++ b/pkgs/development/python-modules/sqlbag/default.nix @@ -0,0 +1,95 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, isPy27 +, psycopg2 +, pymysql +, sqlalchemy +, pathlib +, six +, flask +, pendulum +, packaging +, setuptools +, poetry-core +, pytestCheckHook +, pytest-xdist +, pytest-sugar +, postgresql +, postgresqlTestHook +, +}: +buildPythonPackage rec { + pname = "sqlbag"; + version = "0.1.1617247075"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "djrobstep"; + repo = pname; + # no tags on github, version patch number is unix time. + rev = "eaaeec4158ffa139fba1ec30d7887f4d836f4120"; + hash = "sha256-lipgnkqrzjzqwbhtVcWDQypBNzq6Dct/qoM8y/FNiNs="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = + [ + sqlalchemy + six + packaging + + psycopg2 + pymysql + + setuptools # needed for 'pkg_resources' + ] + ++ lib.optional isPy27 pathlib; + + nativeCheckInputs = [ + pytestCheckHook + pytest-xdist + pytest-sugar + + postgresql + postgresqlTestHook + + flask + pendulum + ]; + + preCheck = '' + export PGUSER="nixbld"; + ''; + disabledTests = [ + # These all fail with "List argument must consist only of tuples or dictionaries": + # Related issue: https://github.com/djrobstep/sqlbag/issues/14 + "test_basic" + "test_createdrop" + "test_errors_and_messages" + "test_flask_integration" + "test_orm_stuff" + "test_pendulum_for_time_types" + "test_transaction_separation" + ]; + + pytestFlagsArray = [ + "-x" + "-svv" + "tests" + ]; + + pythonImportsCheck = [ + "sqlbag" + ]; + + meta = with lib; { + description = "Handy python code for doing database things"; + homepage = "https://github.com/djrobstep/sqlbag"; + license = with licenses; [ unlicense ]; + maintainers = with maintainers; [ soispha ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 75f09aa1581b..69818e9fc784 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12344,6 +12344,8 @@ self: super: with self; { sqlalchemy-views = callPackage ../development/python-modules/sqlalchemy-views { }; + sqlbag = callPackage ../development/python-modules/sqlbag { }; + sqlglot = callPackage ../development/python-modules/sqlglot { }; sqlitedict = callPackage ../development/python-modules/sqlitedict { }; From 1f691cc04b9bfe6c43a602ee4c719e739446080c Mon Sep 17 00:00:00 2001 From: Soispha Date: Sun, 3 Sep 2023 00:00:25 +0200 Subject: [PATCH 4/4] migra: init at 3.0.1647431138 --- pkgs/by-name/mi/migra/package.nix | 59 +++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 pkgs/by-name/mi/migra/package.nix diff --git a/pkgs/by-name/mi/migra/package.nix b/pkgs/by-name/mi/migra/package.nix new file mode 100644 index 000000000000..8fd3ef6332ed --- /dev/null +++ b/pkgs/by-name/mi/migra/package.nix @@ -0,0 +1,59 @@ +{ lib +, python3 +, fetchFromGitHub +, postgresql +, postgresqlTestHook +, +}: +python3.pkgs.buildPythonApplication rec { + pname = "migra"; + version = "3.0.1647431138"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "djrobstep"; + repo = pname; + rev = version; + hash = "sha256-LSCJA5Ym1LuV3EZl6gnl9jTHGc8A1LXmR1fj0ZZc+po="; + }; + + nativeBuildInputs = [ + python3.pkgs.poetry-core + ]; + + propagatedBuildInputs = with python3.pkgs; [ + schemainspect + six + sqlbag + ]; + + nativeCheckInputs = with python3.pkgs; [ + pytestCheckHook + postgresql + postgresqlTestHook + ]; + preCheck = '' + export PGUSER="nixbld"; + ''; + disabledTests = [ + # These all fail with "List argument must consist only of tuples or dictionaries": + # See this issue: https://github.com/djrobstep/migra/issues/232 + "test_excludeschema" + "test_fixtures" + "test_rls" + "test_singleschema" + ]; + + pytestFlagsArray = [ + "-x" + "-svv" + "tests" + ]; + + meta = with lib; { + description = "Like diff but for PostgreSQL schemas"; + homepage = "https://github.com/djrobstep/migra"; + license = with licenses; [ unlicense ]; + maintainers = with maintainers; [ soispha ]; + }; +}