From 3c971bb4f9562b0300cb9c9b55043ade8e1b128f Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 14 Oct 2024 18:27:51 +0200 Subject: [PATCH 1/5] snakemake: move to by-name --- .../snakemake/default.nix => by-name/sn/snakemake/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{applications/science/misc/snakemake/default.nix => by-name/sn/snakemake/package.nix} (100%) diff --git a/pkgs/applications/science/misc/snakemake/default.nix b/pkgs/by-name/sn/snakemake/package.nix similarity index 100% rename from pkgs/applications/science/misc/snakemake/default.nix rename to pkgs/by-name/sn/snakemake/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d60050bd692d..8a6167bb202d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18389,8 +18389,6 @@ with pkgs; smc = callPackage ../tools/misc/smc { }; - snakemake = callPackage ../applications/science/misc/snakemake { }; - snore = callPackage ../tools/misc/snore { }; snzip = callPackage ../tools/archivers/snzip { }; From 49a382308c4d68bb6094639403dbc8b4570dac94 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 14 Oct 2024 18:28:05 +0200 Subject: [PATCH 2/5] snakemake: format --- pkgs/by-name/sn/snakemake/package.nix | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/sn/snakemake/package.nix b/pkgs/by-name/sn/snakemake/package.nix index 07cc2ceaedcc..4e11f5f520af 100644 --- a/pkgs/by-name/sn/snakemake/package.nix +++ b/pkgs/by-name/sn/snakemake/package.nix @@ -1,7 +1,8 @@ -{ lib -, fetchPypi -, python3 -, stress +{ + lib, + fetchPypi, + python3, + stress, }: python3.pkgs.buildPythonApplication rec { @@ -133,6 +134,10 @@ python3.pkgs.buildPythonApplication rec { workflows are essentially Python scripts extended by declarative code to define rules. Rules describe how to create output files from input files. ''; - maintainers = with maintainers; [ helkafen renatoGarcia veprbl ]; + maintainers = with maintainers; [ + helkafen + renatoGarcia + veprbl + ]; }; } From f0ce7ff011d1ac9f155989a3470202dbc40b1070 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 14 Oct 2024 18:36:56 +0200 Subject: [PATCH 3/5] python312Packages.snakemake-interface-executor-plugins: 9.2.0 -> 9.3.2 Diff: https://github.com/snakemake/snakemake-interface-executor-plugins/compare/refs/tags/v9.2.0...v9.3.2 Changelog: https://github.com/snakemake/snakemake-interface-executor-plugins/blob/v9.3.2/CHANGELOG.md --- .../default.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/snakemake-interface-executor-plugins/default.nix b/pkgs/development/python-modules/snakemake-interface-executor-plugins/default.nix index 19365d837ff2..e6411e3abdf2 100644 --- a/pkgs/development/python-modules/snakemake-interface-executor-plugins/default.nix +++ b/pkgs/development/python-modules/snakemake-interface-executor-plugins/default.nix @@ -10,19 +10,19 @@ buildPythonPackage rec { pname = "snakemake-interface-executor-plugins"; - version = "9.2.0"; - format = "pyproject"; + version = "9.3.2"; + pyproject = true; src = fetchFromGitHub { owner = "snakemake"; - repo = pname; + repo = "snakemake-interface-executor-plugins"; rev = "refs/tags/v${version}"; - hash = "sha256-WMbJP17YnDzFVcr6YepT5Ltw+Jo6PPn7ayIrjx2k+go="; + hash = "sha256-3XdsEnL+kuYhNOeAxkAsjTJ2R6NOtq97zPhQg9kdFkI="; }; - nativeBuildInputs = [ poetry-core ]; + build-system = [ poetry-core ]; - propagatedBuildInputs = [ + dependencies = [ argparse-dataclass throttler snakemake-interface-common @@ -30,10 +30,11 @@ buildPythonPackage rec { pythonImportsCheck = [ "snakemake_interface_executor_plugins" ]; - meta = with lib; { + meta = { description = "This package provides a stable interface for interactions between Snakemake and its executor plugins"; homepage = "https://github.com/snakemake/snakemake-interface-executor-plugins"; - license = licenses.mit; - maintainers = with maintainers; [ veprbl ]; + changelog = "https://github.com/snakemake/snakemake-interface-executor-plugins/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ veprbl ]; }; } From 381bfca378d7dba80598bb8427333a14b915b658 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 14 Oct 2024 18:42:57 +0200 Subject: [PATCH 4/5] python312Packages.conda-inject: init at 1.3.2 --- .../python-modules/conda-inject/default.nix | 47 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/development/python-modules/conda-inject/default.nix diff --git a/pkgs/development/python-modules/conda-inject/default.nix b/pkgs/development/python-modules/conda-inject/default.nix new file mode 100644 index 000000000000..78d57f748bb1 --- /dev/null +++ b/pkgs/development/python-modules/conda-inject/default.nix @@ -0,0 +1,47 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + poetry-core, + + # dependencies + pyyaml, +}: + +buildPythonPackage rec { + pname = "conda-inject"; + version = "1.3.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "koesterlab"; + repo = "conda-inject"; + rev = "refs/tags/v${version}"; + hash = "sha256-M4+bz7ZuHlcF8tF5kSCUjjkIHG75eCCW1IJxcwxNL6o="; + }; + + build-system = [ + poetry-core + ]; + + dependencies = [ + pyyaml + ]; + + pythonImportsCheck = [ + "conda_inject" + ]; + + # no tests + doCheck = false; + + meta = { + description = "Helper functions for injecting a conda environment into the current python environment"; + homepage = "https://github.com/koesterlab/conda-inject"; + changelog = "https://github.com/koesterlab/conda-inject/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1df20a0804e3..e6546b5815d0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2514,6 +2514,8 @@ self: super: with self; { conda = callPackage ../development/python-modules/conda { }; + conda-inject = callPackage ../development/python-modules/conda-inject { }; + conda-libmamba-solver = callPackage ../development/python-modules/conda-libmamba-solver { }; conda-package-handling = callPackage ../development/python-modules/conda-package-handling { }; From a019ba32e53cdef552a99d74dd53ee778f95618e Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 14 Oct 2024 18:32:54 +0200 Subject: [PATCH 5/5] snakemake: 8.20.1 -> 8.23.0 Diff: https://github.com/snakemake/snakemake/compare/refs/tags/v8.20.1...v8.23.0 Changelog: https://github.com/snakemake/snakemake/blob/refs/tags/v8.23.0/CHANGELOG.md --- pkgs/by-name/sn/snakemake/package.nix | 113 ++++++++++++++++---------- pkgs/top-level/python-packages.nix | 2 +- 2 files changed, 71 insertions(+), 44 deletions(-) diff --git a/pkgs/by-name/sn/snakemake/package.nix b/pkgs/by-name/sn/snakemake/package.nix index 4e11f5f520af..5fa93c593006 100644 --- a/pkgs/by-name/sn/snakemake/package.nix +++ b/pkgs/by-name/sn/snakemake/package.nix @@ -1,18 +1,21 @@ { lib, + stdenv, fetchPypi, - python3, + python3Packages, stress, + versionCheckHook, }: -python3.pkgs.buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "snakemake"; - version = "8.20.1"; - format = "setuptools"; + version = "8.23.0"; + + pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-adNwIA1z/TwWsa0gQb4hAsUvHInjd30sm1dYKXvvXy8="; + hash = "sha256-XENI9VJW62KyrxDGSwQiygggYZOu9yW2QSNyp4BO9Us="; }; postPatch = '' @@ -24,8 +27,13 @@ python3.pkgs.buildPythonApplication rec { --replace-fail '"unit_tests/templates"' '"'"$PWD"'/snakemake/unit_tests/templates"' ''; - propagatedBuildInputs = with python3.pkgs; [ + build-system = with python3Packages; [ + setuptools + ]; + + dependencies = with python3Packages; [ appdirs + conda-inject configargparse connection-pool datrie @@ -60,7 +68,7 @@ python3.pkgs.buildPythonApplication rec { # for the current basic test suite. Slurm, Tibanna and Tes require extra # setup. - nativeCheckInputs = with python3.pkgs; [ + nativeCheckInputs = with python3Packages; [ numpy pandas pytestCheckHook @@ -69,7 +77,9 @@ python3.pkgs.buildPythonApplication rec { snakemake-executor-plugin-cluster-generic snakemake-storage-plugin-fs stress + versionCheckHook ]; + versionCheckProgramArg = [ "--version" ]; pytestFlagsArray = [ "tests/tests.py" @@ -80,39 +90,55 @@ python3.pkgs.buildPythonApplication rec { "tests/test_api.py" ]; - # Some will be disabled via https://github.com/snakemake/snakemake/pull/3074 - disabledTests = [ - # requires graphviz - "test_filegraph" - # requires s3 - "test_storage" - "test_default_storage" - "test_output_file_cache_storage" - # requires peppy and eido - "test_pep" - "test_modules_peppy" - # requires perl - "test_shadow" - # requires snakemake-storage-plugin-http - "test_ancient" - "test_modules_prefix" - # requires snakemake-storage-plugin-s3 - "test_deploy_sources" - # requires modules - "test_env_modules" - # issue with locating template file - "test_generate_unit_tests" - # weird - "test_strict_mode" - "test_issue1256" - "test_issue2574" - "test_github_issue1384" - # future-proofing - "conda" - "singularity" - "apptainer" - "container" - ]; + disabledTests = + [ + # FAILED tests/tests.py::test_env_modules - AssertionError: expected successful execution + "test_ancient" + "test_conda_create_envs_only" + "test_env_modules" + "test_generate_unit_tests" + "test_modules_prefix" + "test_strict_mode" + # Requires perl + "test_shadow" + # Require peppy and eido + "test_peppy" + "test_modules_peppy" + "test_pep_pathlib" + + # CalledProcessError + "test_filegraph" # requires graphviz + "test_github_issue1384" + + # AssertionError: assert 127 == 1 + "test_issue1256" + "test_issue2574" + + # Require `snakemake-storage-plugin-fs` (circular dependency) + "test_default_storage" + "test_default_storage_local_job" + "test_deploy_sources" + "test_output_file_cache_storage" + "test_storage" + ] + ++ lib.optionals stdenv.isDarwin [ + # Unclear failure: + # AssertionError: expected successful execution + # `__darwinAllowLocalNetworking` doesn't help + "test_excluded_resources_not_submitted_to_cluster" + "test_group_job_resources_with_pipe" + "test_group_jobs_resources" + "test_group_jobs_resources_with_limited_resources" + "test_group_jobs_resources_with_max_threads" + "test_issue850" + "test_issue860" + "test_multicomp_group_jobs" + "test_queue_input" + "test_queue_input_dryrun" + "test_queue_input_forceall" + "test_resources_submitted_to_cluster" + "test_scopes_submitted_to_cluster" + ]; pythonImportsCheck = [ "snakemake" @@ -122,10 +148,11 @@ python3.pkgs.buildPythonApplication rec { export HOME="$(mktemp -d)" ''; - meta = with lib; { + meta = { homepage = "https://snakemake.github.io"; - license = licenses.mit; + license = lib.licenses.mit; description = "Python-based execution environment for make-like workflows"; + changelog = "https://github.com/snakemake/snakemake/blob/v${version}/CHANGELOG.md"; mainProgram = "snakemake"; longDescription = '' Snakemake is a workflow management system that aims to reduce the complexity of @@ -134,7 +161,7 @@ python3.pkgs.buildPythonApplication rec { workflows are essentially Python scripts extended by declarative code to define rules. Rules describe how to create output files from input files. ''; - maintainers = with maintainers; [ + maintainers = with lib.maintainers; [ helkafen renatoGarcia veprbl diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e6546b5815d0..f5bace870a9b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -14536,7 +14536,7 @@ self: super: with self; { }); snakemake = toPythonModule (pkgs.snakemake.override { - python3 = python; + python3Packages = self; }); snakemake-executor-plugin-cluster-generic = callPackage ../development/python-modules/snakemake-executor-plugin-cluster-generic { };