From 67bfc3a52caa427d85c98f7a79676c14b8059c59 Mon Sep 17 00:00:00 2001 From: Michael Roach Date: Tue, 17 Oct 2023 10:12:43 +1030 Subject: [PATCH] BUG: misc fixes --- tests/test_snaketool.py | 2 +- {{cookiecutter.project_slug}}/setup.py | 2 +- .../{{cookiecutter.project_slug}}/__main__.py | 6 +++--- .../{{cookiecutter.project_slug}}/config/config.yaml | 7 ++++--- .../{{cookiecutter.project_slug}}/workflow/Snakefile | 1 - 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/test_snaketool.py b/tests/test_snaketool.py index 452a52d..3eb540f 100644 --- a/tests/test_snaketool.py +++ b/tests/test_snaketool.py @@ -46,6 +46,6 @@ def test_snaketool_cli(tmp_dir): def test_snaketool_commands(tmp_dir): """test Snaketool""" - exec_command("my_snaketool run --input yeet") + exec_command("my_snaketool run --input yeet --no-use-conda ") exec_command("my_snaketool config") exec_command("my_snaketool citation") diff --git a/{{cookiecutter.project_slug}}/setup.py b/{{cookiecutter.project_slug}}/setup.py index 0104237..6df83bd 100644 --- a/{{cookiecutter.project_slug}}/setup.py +++ b/{{cookiecutter.project_slug}}/setup.py @@ -52,7 +52,7 @@ def get_data_files(): data_files=get_data_files(), py_modules=["{{cookiecutter.project_slug}}"], install_requires=[ - "snaketool-utils>=0.0.3", + "snaketool-utils>=0.0.4", "snakemake{{cookiecutter.snakemake_version}}", "pyyaml{{cookiecutter.pyyaml_version}}", "Click{{cookiecutter.click_version}}", diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/__main__.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/__main__.py index c34e174..041e756 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/__main__.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/__main__.py @@ -151,7 +151,7 @@ def run(**kwargs): """Run {{cookiecutter.project_name}}""" # Config to add or update in configfile merge_config = { - "{{cookiecutter.project_name}}": { + "{{cookiecutter.project_slug}}": { "args": kwargs } } @@ -167,9 +167,9 @@ def run(**kwargs): @click.command() @common_options -def config(**kwargs): +def config(configfile, system_config, **kwargs): """Copy the system default config file""" - copy_config(kwargs["configfile"]) + copy_config(configfile, system_config=system_config) @click.command() diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/config/config.yaml b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/config/config.yaml index c7d157f..5c2a172 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/config/config.yaml +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/config/config.yaml @@ -1,5 +1,6 @@ # Namespaced config file example {{cookiecutter.project_slug}}: - args: - # Command line args will overwrite anything here at runtime - # Customisable config here + args: # Command line args will be (over)written here at runtime + input: + output: + # Add customisable config here \ No newline at end of file diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/workflow/Snakefile b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/workflow/Snakefile index 6dad1ee..8067bc2 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/workflow/Snakefile +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/workflow/Snakefile @@ -2,7 +2,6 @@ # Update default config with runtime config configfile: os.path.join(workflow.basedir, "../", "config", "config.yaml") configfile: os.path.join(workflow.basedir, "../", "config", "system_config.yaml") -config.update(config["{{cookiecutter.project_slug}}"]) # convenience if using namespaced config # Rules files