diff --git a/pkgs/by-name/sw/swh/package.nix b/pkgs/by-name/sw/swh/package.nix index ef90e1d9cf34..6375ca0c6bd0 100644 --- a/pkgs/by-name/sw/swh/package.nix +++ b/pkgs/by-name/sw/swh/package.nix @@ -4,6 +4,7 @@ withSwhPythonPackages ? [ python3Packages.swh-auth python3Packages.swh-model + python3Packages.swh-objstorage python3Packages.swh-scanner python3Packages.swh-web-client ], diff --git a/pkgs/development/python-modules/swh-objstorage/default.nix b/pkgs/development/python-modules/swh-objstorage/default.nix new file mode 100644 index 000000000000..478bc7e07bdf --- /dev/null +++ b/pkgs/development/python-modules/swh-objstorage/default.nix @@ -0,0 +1,111 @@ +{ + lib, + buildPythonPackage, + fetchFromGitLab, + setuptools, + setuptools-scm, + backports-entry-points-selectable, + cassandra-driver, + click, + deprecated, + flask, + iso8601, + msgpack, + mypy-extensions, + psycopg, + redis, + tenacity, + swh-core, + swh-model, + swh-perfecthash, + aiohttp, + azure-core, + azure-storage-blob, + fixtures, + libcloud, + postgresql, + postgresqlTestHook, + pytestCheckHook, + pytest-mock, + pytest-postgresql, + requests-mock, + requests-toolbelt, + systemd, + types-python-dateutil, + types-pyyaml, + types-requests, + util-linux, +}: + +buildPythonPackage rec { + pname = "swh-objstorage"; + version = "4.0.0"; + pyproject = true; + + src = fetchFromGitLab { + domain = "gitlab.softwareheritage.org"; + group = "swh"; + owner = "devel"; + repo = "swh-objstorage"; + tag = "v${version}"; + hash = "sha256-c0ZH2PMT9DVnpTV5PDyX0Yw4iHiJSolEgq/bMXEwXG8="; + }; + + build-system = [ + setuptools + setuptools-scm + ]; + + dependencies = [ + backports-entry-points-selectable + cassandra-driver + click + deprecated + flask + iso8601 + msgpack + mypy-extensions + psycopg + redis + tenacity + swh-core + swh-model + swh-perfecthash + ]; + + preCheck = '' + substituteInPlace swh/objstorage/backends/winery/roshard.py \ + --replace-fail "/usr/bin/fallocate" "fallocate" + ''; + + pythonImportsCheck = [ "swh.objstorage" ]; + + pytestFlagsArray = [ "swh/objstorage/tests" ]; + + nativeCheckInputs = [ + aiohttp + azure-core + azure-storage-blob + fixtures + libcloud + postgresql + postgresqlTestHook + pytestCheckHook + pytest-mock + pytest-postgresql + requests-mock + requests-toolbelt + systemd + types-python-dateutil + types-pyyaml + types-requests + util-linux + ] ++ psycopg.optional-dependencies.pool; + + meta = { + description = "Content-addressable object storage for the Software Heritage project"; + homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-objstorage"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ drupol ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 029d037dce48..6ad96cb88104 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16661,6 +16661,8 @@ self: super: with self; { swh-model = callPackage ../development/python-modules/swh-model { }; + swh-objstorage = callPackage ../development/python-modules/swh-objstorage { }; + swh-perfecthash = callPackage ../development/python-modules/swh-perfecthash { }; swh-scanner = callPackage ../development/python-modules/swh-scanner { };