diff --git a/pkgs/development/python-modules/click/default.nix b/pkgs/development/python-modules/click/default.nix index e028343fbb65..368589cac6ef 100644 --- a/pkgs/development/python-modules/click/default.nix +++ b/pkgs/development/python-modules/click/default.nix @@ -2,6 +2,7 @@ lib, buildPythonPackage, fetchFromGitHub, + fetchpatch, importlib-metadata, pytestCheckHook, @@ -26,6 +27,15 @@ buildPythonPackage rec { hash = "sha256-3FfLKwpfkiGfY2+H2fQoZwLBqfPlV46xw2Bc4YEsyps="; }; + patches = [ + # https://github.com/pallets/click/pull/2940 + (fetchpatch { + name = "fix-SystemExit-when-using-stdin.patch"; + url = "https://github.com/pallets/click/commit/93c6966eb3a575c2b600434d1cc9f4b3aee505ac.patch"; + hash = "sha256-DkVF0JnKbcsdAhgVjWJEDZZ8vr2sf6wba8P3SyRUy6o="; + }) + ]; + build-system = [ flit-core ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/swh-core/default.nix b/pkgs/development/python-modules/swh-core/default.nix index abe4979eb1f1..3697adfb5894 100644 --- a/pkgs/development/python-modules/swh-core/default.nix +++ b/pkgs/development/python-modules/swh-core/default.nix @@ -18,6 +18,7 @@ hypothesis, iso8601, lzip, + moto, msgpack, postgresql, postgresqlTestHook, @@ -29,7 +30,9 @@ pytest-postgresql, pytz, requests-mock, + swh-model, systemd, + tqdm, types-deprecated, types-psycopg2, types-pytz, @@ -41,7 +44,7 @@ buildPythonPackage rec { pname = "swh-core"; - version = "4.5.2"; + version = "4.6.0"; pyproject = true; src = fetchFromGitLab { @@ -50,7 +53,7 @@ buildPythonPackage rec { owner = "devel"; repo = "swh-core"; tag = "v${version}"; - hash = "sha256-yNWij9GclQCysQe9Bukr4cHlZgSQqLAuX1KwGWzAK+0="; + hash = "sha256-dI+xfj0DnUbBdYIVycyJQg3B/jnH/eg/Ju8YX2k8Qkc="; }; build-system = [ @@ -58,6 +61,11 @@ buildPythonPackage rec { setuptools-scm ]; + pythonRelaxDeps = [ + # we patched click 8.2.1 + "click" + ]; + dependencies = [ backports-entry-points-selectable click @@ -79,6 +87,7 @@ buildPythonPackage rec { hypothesis iso8601 lzip + moto msgpack postgresql postgresqlTestHook @@ -90,7 +99,9 @@ buildPythonPackage rec { pytest-postgresql pytz requests-mock + swh-model systemd + tqdm types-deprecated types-psycopg2 types-pytz @@ -111,6 +122,7 @@ buildPythonPackage rec { ]; meta = { + changelog = "https://gitlab.softwareheritage.org/swh/devel/swh-core/-/tags/${src.tag}"; description = "Low-level utilities and helpers used by almost all other modules in the stack"; homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-core"; license = lib.licenses.gpl3Only; diff --git a/pkgs/development/python-modules/swh-objstorage/default.nix b/pkgs/development/python-modules/swh-objstorage/default.nix index 5dda6b224fa5..aac86b8de896 100644 --- a/pkgs/development/python-modules/swh-objstorage/default.nix +++ b/pkgs/development/python-modules/swh-objstorage/default.nix @@ -18,7 +18,7 @@ tenacity, swh-core, swh-model, - swh-perfecthash, + swh-shard, aiohttp, azure-core, azure-storage-blob, @@ -40,7 +40,7 @@ buildPythonPackage rec { pname = "swh-objstorage"; - version = "4.0.0"; + version = "5.1.0"; pyproject = true; src = fetchFromGitLab { @@ -49,7 +49,7 @@ buildPythonPackage rec { owner = "devel"; repo = "swh-objstorage"; tag = "v${version}"; - hash = "sha256-c0ZH2PMT9DVnpTV5PDyX0Yw4iHiJSolEgq/bMXEwXG8="; + hash = "sha256-NnNT9Lt/LGDIJpUmfkfPn6JnF3k8Usf2UVa88zHPKlg="; }; build-system = [ @@ -71,7 +71,7 @@ buildPythonPackage rec { tenacity swh-core swh-model - swh-perfecthash + swh-shard ]; preCheck = '' @@ -110,6 +110,7 @@ buildPythonPackage rec { ]; meta = { + changelog = "https://gitlab.softwareheritage.org/swh/devel/swh-objstorage/-/tags/${src.tag}"; description = "Content-addressable object storage for the Software Heritage project"; homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-objstorage"; license = lib.licenses.gpl3Only; diff --git a/pkgs/development/python-modules/swh-scanner/default.nix b/pkgs/development/python-modules/swh-scanner/default.nix index 03fef49e9878..5dca94bb53d2 100644 --- a/pkgs/development/python-modules/swh-scanner/default.nix +++ b/pkgs/development/python-modules/swh-scanner/default.nix @@ -2,7 +2,6 @@ lib, buildPythonPackage, fetchFromGitLab, - fetchpatch, setuptools, setuptools-scm, requests, @@ -36,15 +35,6 @@ buildPythonPackage rec { hash = "sha256-baUUuYFapBD7iuDaDP8CSR9f4glVZcS5qBpZddVf7z8="; }; - patches = [ - # To be removed at the next release - # See https://gitlab.softwareheritage.org/swh/devel/swh-scanner/-/merge_requests/160 - (fetchpatch { - url = "https://gitlab.softwareheritage.org/swh/devel/swh-scanner/-/commit/0eb273475826b0074844c7619b767c052562cfe4.patch"; - hash = "sha256-i3hpaQJmHpIYgix+/npICQGtJ/IKVRXcCTm2O1VsR9M="; - }) - ]; - build-system = [ setuptools setuptools-scm @@ -78,11 +68,14 @@ buildPythonPackage rec { disabledTestPaths = [ # pytestRemoveBytecodePhase fails with: "error (ignored): error: opening directory "/tmp/nix-build-python3.12-swh-scanner-0.8.3.drv-5/build/pytest-of-nixbld/pytest-0/test_randomdir_policy_info_cal0/big-directory/dir/dir/dir/ ......" "swh/scanner/tests/test_policy.py" + # TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' + "swh/scanner/tests/test_cli.py" ]; meta = { - description = "Implementation of the Data model of the Software Heritage project, used to archive source code artifacts"; - homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-model"; + changelog = "https://gitlab.softwareheritage.org/swh/devel/swh-scanner/-/tags/${src.tag}"; + description = "Source code scanner to analyze code bases and compare them with source code artifacts archived by Software Heritage"; + homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-scanner"; license = lib.licenses.gpl3Only; maintainers = [ ]; }; diff --git a/pkgs/development/python-modules/swh-scheduler/default.nix b/pkgs/development/python-modules/swh-scheduler/default.nix index ba2f4e10d1b3..7bb37313ed3c 100644 --- a/pkgs/development/python-modules/swh-scheduler/default.nix +++ b/pkgs/development/python-modules/swh-scheduler/default.nix @@ -30,7 +30,7 @@ buildPythonPackage rec { pname = "swh-scheduler"; - version = "3.1.0"; + version = "3.3.0"; pyproject = true; src = fetchFromGitLab { @@ -39,7 +39,7 @@ buildPythonPackage rec { owner = "devel"; repo = "swh-scheduler"; tag = "v${version}"; - hash = "sha256-YpMHeZVHK8IPIiuBaPNR0D/yB9lIQ3DK7NEAiBmjWpA="; + hash = "sha256-Kv5QH3sj/InKOSjxGtwVxtoAluHx5eIxO5GqcbOs0NY="; }; build-system = [ @@ -47,6 +47,11 @@ buildPythonPackage rec { setuptools-scm ]; + pythonRelaxDeps = [ + # we patched click 8.2.1 + "click" + ]; + dependencies = [ celery flask @@ -80,6 +85,7 @@ buildPythonPackage rec { disabledTests = [ "test_setup_log_handler_with_env_configuration" ]; meta = { + changelog = "https://gitlab.softwareheritage.org/swh/devel/swh-scheduler/-/tags/${src.tag}"; description = "Job scheduler for the Software Heritage project"; homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-scheduler"; license = lib.licenses.gpl3Only; diff --git a/pkgs/development/python-modules/swh-shard/default.nix b/pkgs/development/python-modules/swh-shard/default.nix new file mode 100644 index 000000000000..a07c344b04a2 --- /dev/null +++ b/pkgs/development/python-modules/swh-shard/default.nix @@ -0,0 +1,72 @@ +{ + buildPythonPackage, + click, + cmake, + cmph, + fetchFromGitLab, + lib, + ninja, + pkg-config, + pybind11, + pytest-mock, + pytestCheckHook, + scikit-build-core, + setuptools-scm, +}: + +buildPythonPackage rec { + pname = "swh-shard"; + version = "2.2.0"; + pyproject = true; + + src = fetchFromGitLab { + domain = "gitlab.softwareheritage.org"; + group = "swh"; + owner = "devel"; + repo = "swh-shard"; + tag = "v${version}"; + hash = "sha256-97oZ+Wa8GmyL2V4CnlSvaTbQZJ+mPbg6uVmWd0oxv1Q="; + }; + + build-system = [ + cmake + ninja + pybind11 + scikit-build-core + setuptools-scm + ]; + + nativeBuildInputs = [ + pkg-config + ]; + + dontUseCmakeConfigure = true; + + buildInputs = [ + cmph + ]; + + dependencies = [ + click + ]; + + pythonImportsCheck = [ "swh.shard" ]; + + nativeCheckInputs = [ + pytest-mock + pytestCheckHook + ]; + + preCheck = '' + # import from $out + rm src/swh/shard/*.py + ''; + + meta = { + changelog = "https://gitlab.softwareheritage.org/swh/devel/swh-shard/-/tags/v2.2.0"; + description = "Shard File Format for the Software Heritage Object Storage"; + homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-shard"; + license = lib.licenses.gpl3Only; + maintainers = [ lib.maintainers.dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/swh-storage/default.nix b/pkgs/development/python-modules/swh-storage/default.nix index 74e312d07606..dcf09bf27cf4 100644 --- a/pkgs/development/python-modules/swh-storage/default.nix +++ b/pkgs/development/python-modules/swh-storage/default.nix @@ -12,6 +12,8 @@ iso8601, mypy-extensions, psycopg, + psycopg-pool, + pyasyncore, redis, tenacity, swh-core, @@ -30,7 +32,7 @@ buildPythonPackage rec { pname = "swh-storage"; - version = "3.1.0"; + version = "4.1.0"; pyproject = true; src = fetchFromGitLab { @@ -39,7 +41,7 @@ buildPythonPackage rec { owner = "devel"; repo = "swh-storage"; tag = "v${version}"; - hash = "sha256-Bxwc8OccmqadLjHtmhToHBYHGkD7Fw3Cl3go9VLV/Bs="; + hash = "sha256-JXeHE/wZ3Wcf1I1eGyCNlCGsreiQH6kCYZoDXV1h0A0="; }; build-system = [ @@ -47,6 +49,11 @@ buildPythonPackage rec { setuptools-scm ]; + pythonRelaxDeps = [ + # we patched click 8.2.1 + "click" + ]; + dependencies = [ backports-entry-points-selectable cassandra-driver @@ -56,13 +63,14 @@ buildPythonPackage rec { iso8601 mypy-extensions psycopg + psycopg-pool + pyasyncore redis tenacity swh-core swh-model swh-objstorage - ] - ++ psycopg.optional-dependencies.pool; + ]; pythonImportsCheck = [ "swh.storage" ]; @@ -88,11 +96,13 @@ buildPythonPackage rec { "swh/storage/tests/test_cassandra_migration.py" "swh/storage/tests/test_cassandra_ttl.py" "swh/storage/tests/test_cli_cassandra.py" + "swh/storage/tests/test_cli_object_references_cassandra.py" # Failing tests "swh/storage/tests/test_cli_object_references.py" ]; meta = { + changelog = "https://gitlab.softwareheritage.org/swh/devel/swh-storage/-/tags/${src.tag}"; description = "Abstraction layer over the archive, allowing to access all stored source code artifacts as well as their metadata"; homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-storage"; license = lib.licenses.gpl3Only; diff --git a/pkgs/development/python-modules/swh-web-client/default.nix b/pkgs/development/python-modules/swh-web-client/default.nix index b7ec8be2d090..deeba3f3a3b1 100644 --- a/pkgs/development/python-modules/swh-web-client/default.nix +++ b/pkgs/development/python-modules/swh-web-client/default.nix @@ -37,6 +37,11 @@ buildPythonPackage rec { setuptools-scm ]; + pythonRelaxDeps = [ + # we patched click 8.2.1 + "click" + ]; + dependencies = [ click dateutils diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b2826a75d266..eed1757847cc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -18096,6 +18096,8 @@ self: super: with self; { swh-scheduler = callPackage ../development/python-modules/swh-scheduler { }; + swh-shard = callPackage ../development/python-modules/swh-shard { }; + swh-storage = callPackage ../development/python-modules/swh-storage { }; swh-web-client = callPackage ../development/python-modules/swh-web-client { };