From dda8c5c4593ad6cc7cd48a2272cbd70ceb9933d1 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 1 Apr 2025 19:32:22 +0200 Subject: [PATCH 01/10] python313Packages.cassandra-driver: mark as broken for Python >= 3.13 --- pkgs/development/python-modules/cassandra-driver/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/cassandra-driver/default.nix b/pkgs/development/python-modules/cassandra-driver/default.nix index 5ad23b111c49..20923a4ea908 100644 --- a/pkgs/development/python-modules/cassandra-driver/default.nix +++ b/pkgs/development/python-modules/cassandra-driver/default.nix @@ -21,6 +21,7 @@ twisted, setuptools, distutils, + pythonAtLeast, }: buildPythonPackage rec { @@ -114,6 +115,8 @@ buildPythonPackage rec { }; meta = { + # cassandra/io/libevwrapper.c:668:10: error: implicit declaration of function ‘PyEval_ThreadsInitialized’ [] + broken = pythonAtLeast "3.13"; description = "Python client driver for Apache Cassandra"; homepage = "http://datastax.github.io/python-driver"; changelog = "https://github.com/datastax/python-driver/blob/${version}/CHANGELOG.rst"; From 5df5826b5c05506df08f1780793017e9b4c708a2 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 1 Apr 2025 10:31:46 +0200 Subject: [PATCH 02/10] cmph: add missing `meta.mainProgram` --- pkgs/by-name/cm/cmph/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/cm/cmph/package.nix b/pkgs/by-name/cm/cmph/package.nix index 6780c294ecc5..9b4b5ef8c0bc 100644 --- a/pkgs/by-name/cm/cmph/package.nix +++ b/pkgs/by-name/cm/cmph/package.nix @@ -20,6 +20,7 @@ stdenv.mkDerivation (finalAttrs: { gpl2 mpl11 ]; + mainProgram = "cmph"; maintainers = with lib.maintainers; [ drupol ]; platforms = lib.platforms.linux ++ lib.platforms.darwin; }; From 3c92e1c9f197d93328191b5b457cfe5f6a5cbff1 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 1 Apr 2025 13:54:33 +0200 Subject: [PATCH 03/10] python312Packages.swh-scanner: add patch to fix a test --- .../python-modules/swh-scanner/default.nix | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/swh-scanner/default.nix b/pkgs/development/python-modules/swh-scanner/default.nix index 84aec2c17944..5f34c0c20cc5 100644 --- a/pkgs/development/python-modules/swh-scanner/default.nix +++ b/pkgs/development/python-modules/swh-scanner/default.nix @@ -2,6 +2,7 @@ lib, buildPythonPackage, fetchFromGitLab, + fetchpatch, setuptools, setuptools-scm, requests, @@ -35,6 +36,15 @@ 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 @@ -65,11 +75,6 @@ buildPythonPackage rec { types-requests ]; - disabledTests = [ - # AttributeError: 'called_once' is not a valid assertion. Use a spec for the mock if 'called_once' is meant to be an attribute. - "test_scan_api_url_option_success" - ]; - 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" From 74d8a5f072807199b9f751af688be8fa51590f61 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Mon, 31 Mar 2025 18:32:47 +0200 Subject: [PATCH 04/10] python312Packages.swh-perfecthash: init at 1.3.2 --- .../swh-perfecthash/default.nix | 62 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 64 insertions(+) create mode 100644 pkgs/development/python-modules/swh-perfecthash/default.nix diff --git a/pkgs/development/python-modules/swh-perfecthash/default.nix b/pkgs/development/python-modules/swh-perfecthash/default.nix new file mode 100644 index 000000000000..821b1c6bf255 --- /dev/null +++ b/pkgs/development/python-modules/swh-perfecthash/default.nix @@ -0,0 +1,62 @@ +{ + lib, + buildPythonPackage, + fetchFromGitLab, + setuptools, + setuptools-scm, + cffi, + pytestCheckHook, + pytest-mock, + pkgs, # only for cmph +}: + +buildPythonPackage rec { + pname = "swh-perfecthash"; + version = "1.3.2"; + pyproject = true; + + src = fetchFromGitLab { + domain = "gitlab.softwareheritage.org"; + group = "swh"; + owner = "devel"; + repo = "swh-perfecthash"; + tag = "v${version}"; + hash = "sha256-cG0h0lfSSooA7Mzrlsi5yIcbkbxQZ7mI5NtiB7D5Crs="; + }; + + build-system = [ + setuptools + setuptools-scm + ]; + + dependencies = [ + cffi + pkgs.cmph + ]; + + # The installed library clashes with the `swh` directory remaining in the source path. + # Usually, we get around this by `rm -rf` the python source files to ensure that the installed package is used. + # Here, we cannot do that as it would also remove the tests which are also in the `swh` directory. + preCheck = '' + rm -rf swh/perfecthash/*.py + ''; + + pythonImportsCheck = [ "swh.perfecthash" ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-mock + ]; + + disabledTests = [ + # Flake tests + "test_build_speed" + ]; + + meta = { + description = "Perfect hash table for software heritage object storage"; + homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-perfecthash"; + 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 edf440be213a..029d037dce48 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-perfecthash = callPackage ../development/python-modules/swh-perfecthash { }; + swh-scanner = callPackage ../development/python-modules/swh-scanner { }; swh-web-client = callPackage ../development/python-modules/swh-web-client { }; From e9dfc5bfb52de51aed10bdd3e1a39cd0c3e2640b Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Mon, 31 Mar 2025 20:32:46 +0200 Subject: [PATCH 05/10] python312Packages.swh-objstorage: init at 4.0.0 --- pkgs/by-name/sw/swh/package.nix | 1 + .../python-modules/swh-objstorage/default.nix | 111 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 114 insertions(+) create mode 100644 pkgs/development/python-modules/swh-objstorage/default.nix 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 { }; From 0d3a1cd8884869dfab0e4d681eee078f96373ecd Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 1 Apr 2025 11:11:29 +0200 Subject: [PATCH 06/10] python312Packages.pytest-shared-session-scope: init at 0.4.0 --- .../pytest-shared-session-scope/default.nix | 49 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 ++ 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/pytest-shared-session-scope/default.nix diff --git a/pkgs/development/python-modules/pytest-shared-session-scope/default.nix b/pkgs/development/python-modules/pytest-shared-session-scope/default.nix new file mode 100644 index 000000000000..96571b31d88a --- /dev/null +++ b/pkgs/development/python-modules/pytest-shared-session-scope/default.nix @@ -0,0 +1,49 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatchling, + filelock, + pytest, + typing-extensions, + polars, + pytest-xdist, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "pytest-shared-session-scope"; + version = "0.4.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "StefanBRas"; + repo = "pytest-shared-session-scope"; + tag = "v${version}"; + hash = "sha256-cG4RUwQwo7RyOQDCP54gGTLhnJtHTo5iQh8MjNRZ4HI="; + }; + + build-system = [ hatchling ]; + + dependencies = [ + filelock + pytest + typing-extensions + ]; + + nativeCheckInputs = [ + polars + pytest-xdist + pytestCheckHook + ]; + + pythonImportsCheck = [ "pytest_shared_session_scope" ]; + + meta = { + changelog = "https://github.com/StefanBRas/pytest-shared-session-scope/blob/v${version}/CHANGELOG.md"; + description = "Pytest session-scoped fixture that works with xdist"; + homepage = "https://pypi.org/project/pytest-shared-session-scope/"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ drupol ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6ad96cb88104..09e5892f344d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13627,6 +13627,10 @@ self: super: with self; { pytest-services = callPackage ../development/python-modules/pytest-services { }; + pytest-shared-session-scope = + callPackage ../development/python-modules/pytest-shared-session-scope + { }; + pytest-shutil = callPackage ../development/python-modules/pytest-shutil { }; pytest-smtpd = callPackage ../development/python-modules/pytest-smtpd { }; From df4895cb62a5e5bcd362f6580d522918445e0bf8 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 1 Apr 2025 11:31:24 +0200 Subject: [PATCH 07/10] python312Packages.swh-journal: init at 2.0.0 --- .../python-modules/swh-journal/default.nix | 54 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 56 insertions(+) create mode 100644 pkgs/development/python-modules/swh-journal/default.nix diff --git a/pkgs/development/python-modules/swh-journal/default.nix b/pkgs/development/python-modules/swh-journal/default.nix new file mode 100644 index 000000000000..c3a0e223e125 --- /dev/null +++ b/pkgs/development/python-modules/swh-journal/default.nix @@ -0,0 +1,54 @@ +{ + lib, + buildPythonPackage, + fetchFromGitLab, + setuptools, + setuptools-scm, + confluent-kafka, + msgpack, + swh-core, + swh-model, + pytestCheckHook, + pytest-mock, +}: + +buildPythonPackage rec { + pname = "swh-journal"; + version = "2.0.0"; + pyproject = true; + + src = fetchFromGitLab { + domain = "gitlab.softwareheritage.org"; + group = "swh"; + owner = "devel"; + repo = "swh-journal"; + tag = "v${version}"; + hash = "sha256-ycTB7hSjTerJOd+nEv8HbM82vPAO8P1+xooy0oN4eHw="; + }; + + build-system = [ + setuptools + setuptools-scm + ]; + + dependencies = [ + confluent-kafka + msgpack + swh-core + swh-model + ]; + + pythonImportsCheck = [ "swh.journal" ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-mock + ]; + + meta = { + description = "Persistent logger of changes to the archive, with publish-subscribe support"; + homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-journal"; + 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 09e5892f344d..125e52d3f3dc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16663,6 +16663,8 @@ self: super: with self; { swh-core = callPackage ../development/python-modules/swh-core { }; + swh-journal = callPackage ../development/python-modules/swh-journal { }; + swh-model = callPackage ../development/python-modules/swh-model { }; swh-objstorage = callPackage ../development/python-modules/swh-objstorage { }; From 387987c50fa9fbfa10aa02d70b1ee1d2665b6f02 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 1 Apr 2025 13:53:07 +0200 Subject: [PATCH 08/10] python312Packages.swh-storage: init at 3.1.0 --- pkgs/by-name/sw/swh/package.nix | 1 + .../python-modules/swh-storage/default.nix | 100 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 103 insertions(+) create mode 100644 pkgs/development/python-modules/swh-storage/default.nix diff --git a/pkgs/by-name/sw/swh/package.nix b/pkgs/by-name/sw/swh/package.nix index 6375ca0c6bd0..d17d5d6aee7c 100644 --- a/pkgs/by-name/sw/swh/package.nix +++ b/pkgs/by-name/sw/swh/package.nix @@ -6,6 +6,7 @@ python3Packages.swh-model python3Packages.swh-objstorage python3Packages.swh-scanner + python3Packages.swh-storage python3Packages.swh-web-client ], }: diff --git a/pkgs/development/python-modules/swh-storage/default.nix b/pkgs/development/python-modules/swh-storage/default.nix new file mode 100644 index 000000000000..01806be6b4b8 --- /dev/null +++ b/pkgs/development/python-modules/swh-storage/default.nix @@ -0,0 +1,100 @@ +{ + lib, + buildPythonPackage, + fetchFromGitLab, + setuptools, + setuptools-scm, + backports-entry-points-selectable, + cassandra-driver, + click, + deprecated, + flask, + iso8601, + mypy-extensions, + psycopg, + redis, + tenacity, + swh-core, + swh-model, + swh-objstorage, + postgresql, + postgresqlTestHook, + pytest-aiohttp, + pytest-mock, + pytest-postgresql, + pytest-shared-session-scope, + pytest-xdist, + pytestCheckHook, + swh-journal, +}: + +buildPythonPackage rec { + pname = "swh-storage"; + version = "3.1.0"; + pyproject = true; + + src = fetchFromGitLab { + domain = "gitlab.softwareheritage.org"; + group = "swh"; + owner = "devel"; + repo = "swh-storage"; + tag = "v${version}"; + hash = "sha256-Bxwc8OccmqadLjHtmhToHBYHGkD7Fw3Cl3go9VLV/Bs="; + }; + + build-system = [ + setuptools + setuptools-scm + ]; + + dependencies = [ + backports-entry-points-selectable + cassandra-driver + click + deprecated + flask + iso8601 + mypy-extensions + psycopg + redis + tenacity + swh-core + swh-model + swh-objstorage + ] ++ psycopg.optional-dependencies.pool; + + pythonImportsCheck = [ "swh.storage" ]; + + nativeCheckInputs = [ + postgresql + postgresqlTestHook + pytest-aiohttp + pytest-mock + pytest-postgresql + pytest-shared-session-scope + pytest-xdist + pytestCheckHook + swh-journal + ]; + + disabledTestPaths = [ + # E fixture 'redisdb' not found + "swh/storage/tests/test_replay.py" + # Unable to setup the local Cassandra database + "swh/storage/tests/test_cassandra.py" + "swh/storage/tests/test_cassandra_converters.py" + "swh/storage/tests/test_cassandra_diagram.py" + "swh/storage/tests/test_cassandra_migration.py" + "swh/storage/tests/test_cassandra_ttl.py" + "swh/storage/tests/test_cli_cassandra.py" + # Failing tests + "swh/storage/tests/test_cli_object_references.py" + ]; + + meta = { + 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; + maintainers = with lib.maintainers; [ drupol ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 125e52d3f3dc..12fd90e184fd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16673,6 +16673,8 @@ self: super: with self; { swh-scanner = callPackage ../development/python-modules/swh-scanner { }; + swh-storage = callPackage ../development/python-modules/swh-storage { }; + swh-web-client = callPackage ../development/python-modules/swh-web-client { }; swift = callPackage ../development/python-modules/swift { }; From 4e91a457780586d98c99d3301801ce0cf27e6114 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 1 Apr 2025 13:55:12 +0200 Subject: [PATCH 09/10] python312Packages.plotille: init at 5.0.0 --- .../python-modules/plotille/default.nix | 66 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 68 insertions(+) create mode 100644 pkgs/development/python-modules/plotille/default.nix diff --git a/pkgs/development/python-modules/plotille/default.nix b/pkgs/development/python-modules/plotille/default.nix new file mode 100644 index 000000000000..48ffcf7156c5 --- /dev/null +++ b/pkgs/development/python-modules/plotille/default.nix @@ -0,0 +1,66 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + fetchpatch, + poetry-core, + setuptools, + mock, + pendulum, + pytestCheckHook, + pytest-cov-stub, + pytest-mock, +}: + +buildPythonPackage rec { + pname = "plotille"; + version = "5.0.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "tammoippen"; + repo = "plotille"; + tag = "v${version}"; + hash = "sha256-P2qwd935aaYgwLAKpTA2OAuohxVVzKwzYqjsuPSOSHs="; + }; + + patches = [ + # To remove when PR https://github.com/tammoippen/plotille/pull/63 has landed + (fetchpatch { + name = "add-build-information"; + url = "https://github.com/tammoippen/plotille/commit/db744e1fa9c141290966476ddf22a5e7d9a00c0a.patch"; + hash = "sha256-8vBVKrcH7R1d9ol3D7RLVtAzZbpMsB9rA1KHD7t3Ydc="; + }) + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail poetry.masonry.api poetry.core.masonry.api \ + --replace-fail "poetry>=" "poetry-core>=" + ''; + + build-system = [ + poetry-core + setuptools + ]; + + pythonImportsCheck = [ + "plotille" + ]; + + nativeCheckInputs = [ + mock + pendulum + pytestCheckHook + pytest-cov-stub + pytest-mock + ]; + + meta = { + changelog = "https://github.com/tammoippen/plotille/releases/tag/v${version}"; + description = "Plot in the terminal using braille dots"; + homepage = "https://github.com/tammoippen/plotille"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ drupol ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 12fd90e184fd..51bce94ab387 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11100,6 +11100,8 @@ self: super: with self; { ploomber-extension = callPackage ../development/python-modules/ploomber-extension { }; + plotille = callPackage ../development/python-modules/plotille { }; + plotext = callPackage ../development/python-modules/plotext { }; plotly = callPackage ../development/python-modules/plotly { }; From 673b83cc7334ee761474b01bc06ee420b3311dc6 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 1 Apr 2025 14:29:58 +0200 Subject: [PATCH 10/10] python312Packages.swh-scheduler: init at 3.1.0 --- pkgs/by-name/sw/swh/package.nix | 1 + .../python-modules/swh-scheduler/default.nix | 88 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 91 insertions(+) create mode 100644 pkgs/development/python-modules/swh-scheduler/default.nix diff --git a/pkgs/by-name/sw/swh/package.nix b/pkgs/by-name/sw/swh/package.nix index d17d5d6aee7c..96561b1c703b 100644 --- a/pkgs/by-name/sw/swh/package.nix +++ b/pkgs/by-name/sw/swh/package.nix @@ -6,6 +6,7 @@ python3Packages.swh-model python3Packages.swh-objstorage python3Packages.swh-scanner + python3Packages.swh-scheduler python3Packages.swh-storage python3Packages.swh-web-client ], diff --git a/pkgs/development/python-modules/swh-scheduler/default.nix b/pkgs/development/python-modules/swh-scheduler/default.nix new file mode 100644 index 000000000000..349383c72de4 --- /dev/null +++ b/pkgs/development/python-modules/swh-scheduler/default.nix @@ -0,0 +1,88 @@ +{ + lib, + buildPythonPackage, + fetchFromGitLab, + setuptools, + setuptools-scm, + celery, + flask, + humanize, + importlib-metadata, + pika, + psycopg, + tabulate, + swh-storage, + plotille, + postgresql, + postgresqlTestHook, + pytestCheckHook, + pytest-mock, + pytest-postgresql, + pytest-shared-session-scope, + pytest-xdist, + requests-mock, + simpy, + swh-journal, + types-python-dateutil, + types-pyyaml, + types-requests, +}: + +buildPythonPackage rec { + pname = "swh-scheduler"; + version = "3.1.0"; + pyproject = true; + + src = fetchFromGitLab { + domain = "gitlab.softwareheritage.org"; + group = "swh"; + owner = "devel"; + repo = "swh-scheduler"; + tag = "v${version}"; + hash = "sha256-YpMHeZVHK8IPIiuBaPNR0D/yB9lIQ3DK7NEAiBmjWpA="; + }; + + build-system = [ + setuptools + setuptools-scm + ]; + + dependencies = [ + celery + flask + humanize + importlib-metadata + pika + psycopg + tabulate + swh-storage + ]; + + pythonImportsCheck = [ "swh.scheduler" ]; + + nativeCheckInputs = [ + plotille + postgresql + postgresqlTestHook + pytestCheckHook + pytest-mock + pytest-postgresql + pytest-shared-session-scope + pytest-xdist + requests-mock + simpy + swh-journal + types-python-dateutil + types-pyyaml + types-requests + ]; + + disabledTests = [ "test_setup_log_handler_with_env_configuration" ]; + + meta = { + description = "Job scheduler for the Software Heritage project"; + homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-scheduler"; + 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 51bce94ab387..4fde03c3b1f0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16675,6 +16675,8 @@ self: super: with self; { swh-scanner = callPackage ../development/python-modules/swh-scanner { }; + swh-scheduler = callPackage ../development/python-modules/swh-scheduler { }; + swh-storage = callPackage ../development/python-modules/swh-storage { }; swh-web-client = callPackage ../development/python-modules/swh-web-client { };