Might be nicer of invoke to not generate a tasks.pyc.
Can you provide a specific example of how this is problematic? We have to import/run tasks.py at some point, which is what generates the pyc.
Also not sure if one CAN tell Python not to bytecode-compile at runtime, I'm mostly used to the Python interpreter option like PYTHONDONTWRITEBYTECODE.
I wouldn't go so far to call it problematic. I just think it's not nice of an build tool to save some of its own meta data (I know it's not meta data, but let's just pretend it is) persistently in the folder it just happens to be. Call me anal, but I would prefer to have a clean project/build folder.
Some projects managed with invoke might not be python projects and developers might wonder where this pyc file is coming from and whether they have to add it to the repository or should better put it on the ignore list.
But still - this is not really an issue.
You can prevent Python from generating pyc files with the following two lines in /usr/bin/invoke:
sys.dont_write_bytecode = True
This has the downside of not generating pyc files at all. So there is no speed improvement with the second execution. It might be possible to insert this a bit later but I didn't try it, since invoke is pretty fast.
I forgot all about the sys. angle - thanks. I understand your argument and right now I'm +0 on it - given pyc compilation is intended to help with speed, it's not critical for Invoke's use case. In an average use case I'd expect bytecode compilation time to be dwarfed by the runtime of the subcommands the user is triggering.
If you have time to add this as an option (so advanced users who do have a "care about speed" use case have an 'out') I'd merge it. Thanks!
Okay, I'll take care of this in the next few weeks. I've got a dealine ahead, so this will have to wait a few days.
Sure, no rush on my part, I've had to let my OSS slide real bad lately myself :( Thanks!
This sounds pretty neat. What's the state of it and ea93218?
Is that commit part of an actual PR somewhere? If it is, github's not telling me. @brutus
I just tired it again here: brutus@e424074 and it still works for me.
Just had a quick look though. The tests run fine, expect core_help_option_prints_core_help that fails on the additional --write-pyc option in the help output as expected, but I handled that in my no-pyc branch.
Implement #68 + tests
Went a more direct route than #244 since it was more test-friendly.
Turned out to be less code too, not like it matters here...
Changelog re #68, re #244
Implemented, finally. Thanks again @brutus & @brejoc!