pyinvoke / invoke

Pythonic task management & command execution.
http://pyinvoke.org
BSD 2-Clause "Simplified" License
4.31k stars 365 forks source link

invoke 2.1.3 does not work when run inside bash #955

Open AlexanderPetermann opened 12 months ago

AlexanderPetermann commented 12 months ago

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.
...