From 77d19d14b4a09f27c2c05c07f17c9000b5e9621a Mon Sep 17 00:00:00 2001 From: Alexis Praga Date: Thu, 9 Jan 2025 22:26:53 +0100 Subject: [PATCH 1/2] spectra: init at 0.0.11. Dependency for multiqc --- .../python-modules/spectra/default.nix | 49 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 51 insertions(+) create mode 100644 pkgs/development/python-modules/spectra/default.nix diff --git a/pkgs/development/python-modules/spectra/default.nix b/pkgs/development/python-modules/spectra/default.nix new file mode 100644 index 000000000000..f07c17a3bd16 --- /dev/null +++ b/pkgs/development/python-modules/spectra/default.nix @@ -0,0 +1,49 @@ +{ + buildPythonPackage, + colormath, + fetchFromGitHub, + fetchpatch2, + lib, + pytestCheckHook, + setuptools, +}: + +buildPythonPackage rec { + pname = "spectra"; + version = "0.0.11"; + pyproject = true; + + src = fetchFromGitHub { + owner = "jsvine"; + repo = "spectra"; + tag = "v${version}"; + hash = "sha256-4A2TWTxYqckJ3DX5cd2KN3KXcmO/lQdXmOEnGi76RsA="; + }; + + patches = [ + # https://github.com/jsvine/spectra/pull/21 + (fetchpatch2 { + name = "nose-to-pytest.patch"; + url = "https://github.com/jsvine/spectra/commit/50037aba16dac4bf0fb7ffbd787d0e6b906e8a4b.patch"; + hash = "sha256-cMoIbjRwcZjvhiIOcJR7NmIAOaqpr/e5eh9+sPGKqos="; + excludes = [ ".github/*" ]; + }) + ]; + + build-system = [ + setuptools + ]; + + propagatedBuildInputs = [ colormath ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + meta = { + description = "Python library that makes color math, color scales, and color-space conversion easy"; + homepage = "https://github.com/jsvine/spectra"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ apraga ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8d3a99d79a72..c3364be62d90 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15158,6 +15158,8 @@ self: super: with self; { speaklater3 = callPackage ../development/python-modules/speaklater3 { }; + spectra = callPackage ../development/python-modules/spectra { }; + spectral-cube = callPackage ../development/python-modules/spectral-cube { }; speechbrain = callPackage ../development/python-modules/speechbrain { }; From 8fb567c1c20db084f147e27ac14bb1e03c079f8c Mon Sep 17 00:00:00 2001 From: Alexis Praga Date: Thu, 9 Jan 2025 22:28:56 +0100 Subject: [PATCH 2/2] multiqc: init at 1.26. Update the work of dflores to latest version and official tests. All test pass. Spectra has been added as dependencies in a previous commit. --- pkgs/by-name/mu/multiqc/package.nix | 117 ++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 pkgs/by-name/mu/multiqc/package.nix diff --git a/pkgs/by-name/mu/multiqc/package.nix b/pkgs/by-name/mu/multiqc/package.nix new file mode 100644 index 000000000000..be3f8ad6ea86 --- /dev/null +++ b/pkgs/by-name/mu/multiqc/package.nix @@ -0,0 +1,117 @@ +{ + lib, + python3Packages, + fetchFromGitHub, + procps, + stdenv, + versionCheckHook, +}: + +python3Packages.buildPythonApplication rec { + pname = "multiqc"; + version = "1.26"; + + # Two data sources. One for the code, another for the test data + srcs = [ + (fetchFromGitHub { + name = "multiqc"; + owner = "MultiQC"; + repo = "MultiQC"; + tag = "v${version}"; + hash = "sha256-MPAw6gG/3LzdskkDXOTDEM1NpG0sH9GvklYFQ1ZXWIs="; + }) + (fetchFromGitHub { + owner = "MultiQC"; + repo = "test-data"; + rev = "67435083a8bfa228dca3dda7d835facef15fc2c7"; + hash = "sha256-oYmPIJSy6dOKPcMr3B4foGoWcerA29x0XeGoU4dSYsA="; + name = "test-data"; + }) + ]; + + sourceRoot = "multiqc"; + + dependencies = with python3Packages; [ + click + humanize + importlib-metadata + jinja2 + kaleido + markdown + natsort + numpy + packaging + requests + pillow + plotly + pyyaml + rich + rich-click + coloredlogs + spectra + pydantic + typeguard + tqdm + ]; + + optional-dependencies = { + dev = with python3Packages; [ + pre-commit-hooks + pdoc3 + pytest + pytest-cov-stub + pytest-xdist + syrupy + pygithub + mypy + types-pyyaml + types-tqdm + types-requests + types-markdown + types-beautifulsoup4 + types-pillow + ]; + }; + + # Some tests run subprocess.run() with "multiqc" + preCheck = '' + chmod -R u+w ../test-data + ln -s ../test-data . + export PATH=$out/bin:$PATH + ''; + + # Some tests run subprocess.run() with "ps" + nativeCheckInputs = with python3Packages; [ + procps + pytest-cov + pytest-xdist + pytestCheckHook + syrupy + pygithub + versionCheckHook + ]; + + versionCheckProgramArg = [ "--version" ]; + + disabledTests = + # On darwin, kaleido fails to starts + lib.optionals (stdenv.hostPlatform.isDarwin) [ + "test_flat_plot" + ]; + + meta = { + description = "Aggregates bioinformatics results from multiple samples into a unified report"; + longDescription = '' + MultiQC is a tool to create a single report with interactive plots for multiple bioinformatics analyses across many samples. + + Reports are generated by scanning given directories for recognised log files. These are parsed and a single HTML report is generated summarising the statistics for all logs found. MultiQC reports can describe multiple analysis steps and large numbers of samples within a single plot, and multiple analysis tools making it ideal for routine fast quality control. + ''; + homepage = "https://multiqc.info"; + changelog = "https://github.com/MultiQC/MultiQC/releases/tag/v${version}/"; + license = [ lib.licenses.gpl3Plus ]; + maintainers = [ lib.maintainers.apraga ]; + mainProgram = "multiqc"; + platforms = lib.platforms.unix; + }; + +}