Skip to content

Commit

Permalink
Merge pull request #3012 from mirpedrol/remove-licenses-command
Browse files Browse the repository at this point in the history
Remove nf-core licences command
  • Loading branch information
mirpedrol authored Jun 26, 2024
2 parents 5201eb1 + 46e8f1a commit 1e93853
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 542 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- return directory if base_dir is the root directory ([#3003](https://github.com/nf-core/tools/pull/3003))
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.4.6 ([#3006](https://github.com/nf-core/tools/pull/3006))
- Create: allow more special characters on the pipeline name for non-nf-core pipelines ([#3008](https://github.com/nf-core/tools/pull/3008))
- Remove nf-core licences command ([#3012](https://github.com/nf-core/tools/pull/3012))
- README - absolute image paths ([#3013](https://github.com/nf-core/tools/pull/3013))
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.4.7 ([#3015](https://github.com/nf-core/tools/pull/3015))
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.4.8 ([#3017](https://github.com/nf-core/tools/pull/3017))
Expand Down
2 changes: 1 addition & 1 deletion nf_core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"nf-core pipelines": [
{
"name": "For users",
"commands": ["list", "launch", "download", "create-params-file", "licences"],
"commands": ["list", "launch", "download", "create-params-file"],
},
{
"name": "For developers",
Expand Down
115 changes: 0 additions & 115 deletions nf_core/licences.py

This file was deleted.

32 changes: 0 additions & 32 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,38 +199,6 @@ def test_cli_download(self, mock_dl):

mock_dl.return_value.download_workflow.assert_called_once()

@mock.patch("nf_core.licences.WorkflowLicences")
def test_licences(self, mock_lic):
"""Test nf-core pipeline licence is printed out and cli parameters are passed on."""
licence_text = "dummy licence text"
mock_lic.return_value.run_licences.return_value = licence_text

params = {
"json": None,
}

cmd = ["licences"] + self.assemble_params(params) + ["pipeline_name"]
result = self.invoke_cli(cmd)

assert result.exit_code == 0
assert licence_text in result.output

mock_lic.assert_called_once_with(cmd[-1])

@mock.patch("nf_core.licences.WorkflowLicences")
def test_licences_log_error(self, mock_lic):
"""Test LookupError is logged"""
error_txt = "LookupError has been raised"
mock_lic.return_value.run_licences.side_effect = LookupError(error_txt)

cmd = ["licences", "pipeline_name"]
with self.assertLogs() as captured_logs:
result = self.invoke_cli(cmd)

assert result.exit_code == 1
assert error_txt in captured_logs.output[-1]
assert captured_logs.records[-1].levelname == "ERROR"

@mock.patch("nf_core.pipelines.create.create.PipelineCreate")
def test_create(self, mock_create):
"""Test nf-core pipeline is created and cli parameters are passed on."""
Expand Down
57 changes: 0 additions & 57 deletions tests/test_licenses.py

This file was deleted.

Loading

0 comments on commit 1e93853

Please sign in to comment.