Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when pipeline dir doesn't contain main.nf or nextflow.config #1964

Merged
merged 6 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- Improve test coverage of sync.py
- `check_up_to_date()` function from `modules_json` also checks for subworkflows.
- The default branch can now be specified when creating a new pipeline repo [#1959](https://github.com/nf-core/tools/pull/1959).
- Only warn when checking that the pipeline directory contains a `main.nf` and a `nextflow.config` file if the pipeline is not an nf-core pipeline [#1964](https://github.com/nf-core/tools/pull/1964)
- Add file `versions.yml` when generating `test.yml` with `nf-core modules create-test-yml` but don't check for md5sum [#1963](https://github.com/nf-core/tools/pull/1963)

### Modules
Expand Down
4 changes: 3 additions & 1 deletion nf_core/modules/modules_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ def has_valid_directory(self):
main_nf = os.path.join(self.dir, "main.nf")
nf_config = os.path.join(self.dir, "nextflow.config")
if not os.path.exists(main_nf) and not os.path.exists(nf_config):
raise UserWarning(f"Could not find a 'main.nf' or 'nextflow.config' file in '{self.dir}'")
if Path(self.dir).resolve().parts[-1].startswith("nf-core"):
raise UserWarning(f"Could not find a 'main.nf' or 'nextflow.config' file in '{self.dir}'")
log.warning(f"Could not find a 'main.nf' or 'nextflow.config' file in '{self.dir}'")
return True

def has_modules_file(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/modules/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def test_modules_install_nopipeline(self):
@with_temporary_folder
def test_modules_install_emptypipeline(self, tmpdir):
"""Test installing a module - empty dir given"""
self.mods_install.dir = tmpdir
os.mkdir(os.path.join(tmpdir, "nf-core-pipe"))
self.mods_install.dir = os.path.join(tmpdir, "nf-core-pipe")
with pytest.raises(UserWarning) as excinfo:
self.mods_install.install("foo")
assert "Could not find a 'main.nf' or 'nextflow.config' file" in str(excinfo.value)
Expand Down