invoke 2.1.3 does not work when run inside bash
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
Research direction
Reproduce the issue with the shown tasks.py, tasks/init.py, tasks/build.py, and tasks/tests.py structure using both direct invocation and bash -c "invoke -l -d". Compare the loader output for each command, focusing on why the tasks.py module is selected in the shell case. Done means the defined tasks are discovered consistently in both invocation modes.
Written by the indexing model from the issue text.
Description
I have a typical folder structure with:
/tasks.py
/tasks/__init__.py
/tasks/build.py
/tasks/tests.py
Everything runes with 2.0.0, but after upgrading to 2.1.3 tasks are not found anymore.
When run invoke -l -d I get a working output:
invoke.program.parse_collection: No default namespace provided, trying to load one from disk
invoke.loader.find: FilesystemLoader find starting at '/Users/alexander.petermann/projects/abc'
invoke.loader.find: Found module: '/Users/alexander.petermann/projects/abc/tasks'
invoke.config._load_file: Didn't see any /Users/alexander.petermann/projects/abc/invoke.yaml, skipping.
....
but if I call invoke inside a bash script OR like bash -c "invoke -l -d", invoke will not find the defined tasks:
invoke.program.parse_collection: No default namespace provided, trying to load one from disk
invoke.loader.find: FilesystemLoader find starting at '/Users/alexander.petermann/projects/abc'
invoke.loader.find: Found module: ModuleSpec(name='tasks', loader=<_frozen_importlib_external.SourceFileLoader object at 0x1015fe1d0>, origin='/Users/alexander.petermann/projects/abc/tasks.py')
invoke.config._load_file: Didn't see any /Users/alexander.petermann/projects/abc/invoke.yaml, skipping.
...
- Dominant language
- Python
- Stars
- 4.8k
- Forks
- 412
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pyinvoke/invoke
-
[Security] Shell injection via Context.cd() path argument — metacharacters not escaped (CWE-78) Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stephrobert/dsoxlab#238 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
sublimehq/package_control#1780 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
nwg-piotr/nwg-displays#145 ·