Lint linter config for Python < 3.6 and issue warning if Actions are using Python 3.6 and older
Description of the bug
Run nf-core -l lint_log.txt lint --dir ${GITHUB_WORKSPACE} --markdown lint_results.md
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.6.15/x64/bin/nf-core", line 5, in <module>
from nf_core.__main__ import run_nf_core
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/nf_core/__main__.py", line 19, in <module>
import nf_core.lint
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/nf_core/lint/__init__.py", line 23, in <module>
import nf_core.modules.lint
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/nf_core/modules/__init__.py", line 1, in <module>
from .bump_versions import ModuleVersionBumper
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/nf_core/modules/bump_versions.py", line 24, in <module>
from .modules_command import ModuleCommand
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/nf_core/modules/modules_command.py", line [11](https://github.com/nf-core/scrnaseq/actions/runs/3188310073/jobs/5200822519#step:6:12), in <module>
from .modules_json import ModulesJson
File "/opt/hostedtoolcache/Python/3.6.[15](https://github.com/nf-core/scrnaseq/actions/runs/3188310073/jobs/5200822519#step:6:16)/x64/lib/python3.6/site-packages/nf_core/modules/modules_json.py", line 15, in <module>
import nf_core.modules.modules_repo
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/nf_core/modules/modules_repo.py", line 5, in <module>
from importlib.resources import path
ModuleNotFoundError: No module named 'importlib.resources'
Error: Process completed with exit code 1.
Command used and terminal output
https://github.com/nf-core/scrnaseq/actions/runs/3188310073/jobs/5200822519
System information
GHA
On Python 3.6, importlib.resources is not part of the standard library. 3.6 reached end of life a long time ago 😱
Basically, to solve this you would need to add
importlib_resources; python_version <'3.7'
and then create imports like
try:
from importlib.resources import ...
except ImportError:
from importlib_resources import ...
Or decide to not support 3.6 😛
We already dropped support for 3.6 elsewhere, so just drop it here I think. Should be sufficient to remove it from the CI actions matrix.
I changed the title accordingly...

I've been checking, we dropped 3.6 everywhere, and we also don't use importlib.resources anymore. I am closing the issue :)
Yeah, looks like it is there in master:
https://github.com/nf-core/tools/blob/dec66abe1c36a8975a952e1f80f045cab65bbf72/nf_core/modules/modules_repo.py#L5
But it's been removed in dev.
However, I think that we should either:
- Support Python 3.6 and add it back to the CI tests
- Prevent people from installing with Python 3.6 by adding a restriction in
setup.py
When we removed support for 3.6 we started using features specific for 3.7 (Actually, the features were used and then the support for Python 3.6 was dropped because we wanted to use these features. Besides, Python3.6 is officially deprecated.) - I'd advise against trying to support Python 3.6 again.
Clear vote for 2.
Done.