Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:nf-core/tools into support-update-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikDanielsson committed Jul 29, 2022
2 parents f9677d8 + 880d627 commit 3607093
Show file tree
Hide file tree
Showing 29 changed files with 38 additions and 73 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Add `CITATION.cff` [#361](https://github.com/nf-core/tools/issues/361)
- Add Gitpod and Mamba profiles to the pipeline template ([#1673](https://github.com/nf-core/tools/pull/1673))
- Remove call to `getGenomeAttribute` in `main.nf` when running `nf-core create` without iGenomes ([#1670](https://github.com/nf-core/tools/issues/1670))
- Make `nf-core create` fail if Git default branch name is dev or TEMPLATE ([#1705](https://github.com/nf-core/tools/pull/1705))

### Linting

Expand Down
2 changes: 0 additions & 2 deletions nf_core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
""" nf-core: Helper tools for use with nf-core Nextflow pipelines. """
import logging
import os
import re
import sys
from email.policy import default

import rich.console
import rich.logging
Expand Down
1 change: 0 additions & 1 deletion nf_core/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import logging
import os
import re
import sys

import rich.console

Expand Down
20 changes: 19 additions & 1 deletion nf_core/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""Creates a nf-core pipeline matching the current
organization's specification based on a template.
"""
import configparser
import imghdr
import logging
import os
Expand Down Expand Up @@ -490,7 +491,24 @@ def download_pipeline_logo(self, url, img_fn):
break

def git_init_pipeline(self):
"""Initialises the new pipeline as a Git repository and submits first commit."""
"""Initialises the new pipeline as a Git repository and submits first commit.
Raises:
UserWarning: if Git default branch is set to 'dev' or 'TEMPLATE'.
"""
# Check that the default branch is not dev
try:
default_branch = git.config.GitConfigParser().get_value("init", "defaultBranch")
except configparser.Error:
default_branch = None
log.debug("Could not read init.defaultBranch")
if default_branch == "dev" or default_branch == "TEMPLATE":
raise UserWarning(
f"Your Git defaultBranch is set to '{default_branch}', which is incompatible with nf-core.\n"
"This can be modified with the command [white on grey23] git config --global init.defaultBranch <NAME> [/]\n"
"Pipeline git repository is not initialised."
)
# Initialise pipeline
log.info("Initialising pipeline git repository")
repo = git.Repo.init(self.outdir)
repo.git.add(A=True)
Expand Down
1 change: 0 additions & 1 deletion nf_core/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import webbrowser

import questionary
import requests
from rich.console import Console
from rich.markdown import Markdown
from rich.prompt import Confirm
Expand Down
1 change: 0 additions & 1 deletion nf_core/licences.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import json
import logging
import os
import re

import requests
import rich.console
Expand Down
1 change: 0 additions & 1 deletion nf_core/lint/actions_schema_validation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python

import glob
import json
import logging
import os

Expand Down
2 changes: 0 additions & 2 deletions nf_core/lint/modules_json.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python

from logging import warn

from nf_core.modules.modules_command import ModuleCommand
from nf_core.modules.modules_json import ModulesJson

Expand Down
2 changes: 0 additions & 2 deletions nf_core/lint/schema_description.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python

from logging import warn

import nf_core.schema


Expand Down
2 changes: 0 additions & 2 deletions nf_core/lint/schema_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import logging

import jsonschema

import nf_core.schema


Expand Down
1 change: 0 additions & 1 deletion nf_core/modules/bump_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from __future__ import print_function

import logging
import os
import re

import questionary
Expand Down
3 changes: 1 addition & 2 deletions nf_core/modules/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os

import questionary
import requests
import yaml
from rich import box
from rich.console import Group
Expand All @@ -15,7 +14,7 @@

from .module_utils import get_repo_type
from .modules_command import ModuleCommand
from .modules_repo import NF_CORE_MODULES_REMOTE, ModulesRepo
from .modules_repo import NF_CORE_MODULES_REMOTE

log = logging.getLogger(__name__)

Expand Down
1 change: 0 additions & 1 deletion nf_core/modules/lint/main_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import re

import requests
from galaxy.tool_util.deps.mulled.util import build_target

import nf_core
import nf_core.modules.module_utils
Expand Down
2 changes: 0 additions & 2 deletions nf_core/modules/lint/meta_yml.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python

from operator import imod

import yaml


Expand Down
3 changes: 0 additions & 3 deletions nf_core/modules/lint/module_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"""
import os

import requests
import rich


def module_changes(module_lint_object, module):
"""
Expand Down
5 changes: 0 additions & 5 deletions nf_core/modules/lint/module_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
Verify that a module has a correct entry in the modules.json file
"""

import json
import logging
import os
import re
import sys

import questionary

import nf_core
import nf_core.modules.module_utils
Expand Down
12 changes: 6 additions & 6 deletions nf_core/refgenie.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
from pathlib import Path
from textwrap import dedent

# import refgenconf
from warnings import warn

import rich
from rich.logging import RichHandler
import rich.traceback

import nf_core.utils

# import refgenconf


# Set up logging
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
Expand Down Expand Up @@ -53,7 +53,7 @@ def _print_nf_config(rgc):
pth = rgc.seek(genome, asset)
# Catch general exception instead of refgencof exception --> no refgenconf import needed
except Exception as e:
log.warn(f"{genome}/{asset} is incomplete, ignoring...")
log.warning(f"{genome}/{asset} is incomplete, ignoring...")
else:
genomes_str += f' {asset.ljust(20, " ")} = "{pth}"\n'
genomes_str += " }\n"
Expand Down Expand Up @@ -150,7 +150,7 @@ def update_config(rgc):
fh.write(refgenie_genomes)
log.info(f"Updated nf-core genomes config: {refgenie_genomes_config_file}")
except FileNotFoundError as e:
log.warn(f"Could not write to {refgenie_genomes_config_file}")
log.warning(f"Could not write to {refgenie_genomes_config_file}")
return False

# Add include statement to NXF_HOME/config
Expand Down
2 changes: 0 additions & 2 deletions tests/lint/files_exist.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import os

import yaml

import nf_core.lint


Expand Down
4 changes: 0 additions & 4 deletions tests/lint/files_unchanged.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import os
import shutil
import tempfile

import pytest

import nf_core.lint

Expand Down
2 changes: 0 additions & 2 deletions tests/lint/merge_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import os

import yaml

import nf_core.lint


Expand Down
3 changes: 0 additions & 3 deletions tests/lint/modules_json.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import nf_core.lint


def test_modules_json_pass(self):
self.lint_obj._load()
results = self.lint_obj.modules_json()
Expand Down
7 changes: 0 additions & 7 deletions tests/lint/nextflow_config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
import os
import shutil
import tempfile
import unittest

import pytest

import nf_core.create
import nf_core.lint

Expand Down
2 changes: 0 additions & 2 deletions tests/modules/lint.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import json

import nf_core.modules


Expand Down
1 change: 0 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
""" Tests covering the command-line code.
"""

import unittest
from unittest import mock

from click.testing import CliRunner
Expand Down
1 change: 0 additions & 1 deletion tests/test_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import json
import os
import shutil
import tempfile
import unittest
from unittest import mock
Expand Down
20 changes: 10 additions & 10 deletions tests/test_licenses.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env python
"""Some tests covering the pipeline creation sub command.
"""
import json
import os
import tempfile
import unittest

import pytest
from rich.console import Console

import nf_core.create
import nf_core.licences
# import json
# import os
# import tempfile
# import unittest
#
# import pytest
# from rich.console import Console
#
# import nf_core.create
# import nf_core.licences

# TODO nf-core: Assess and strip out if no longer required for DSL2

Expand Down
4 changes: 0 additions & 4 deletions tests/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
import json
import os
import shutil
import subprocess
import tempfile
import unittest
from unittest import mock

import pytest
import requests
import yaml

import nf_core.create
Expand Down
2 changes: 0 additions & 2 deletions tests/test_refgenie.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import tempfile
import unittest

import nf_core.refgenie


class TestRefgenie(unittest.TestCase):
"""Class for refgenie tests"""
Expand Down
3 changes: 1 addition & 2 deletions tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import unittest
from unittest import mock

import click
import pytest
import requests
import yaml
Expand Down Expand Up @@ -305,7 +304,7 @@ def test_build_schema_param_int(self):
param = self.schema_obj.build_schema_param("12")
assert param == {"type": "integer", "default": 12}

def test_build_schema_param_int(self):
def test_build_schema_param_float(self):
"""Build a new schema param from a config value (float)"""
param = self.schema_obj.build_schema_param("12.34")
assert param == {"type": "number", "default": 12.34}
Expand Down

0 comments on commit 3607093

Please sign in to comment.