HalfDeadPie / labelord_halfdeadpie

v0.5
Creative Commons Zero v1.0 Universal
0 stars 0 forks source link

CLI not importable/usable #3

Open MarekSuchanek opened 7 years ago

MarekSuchanek commented 7 years ago

With latest release v0.2 you are not able to run CLI commands from v0.1 nor import cli to other Python projects or tests. It ends up with error (if default config is not there):

% python labelord.py --help
No repositories specification has been found

You need to postpone check of configuration for web app to reload_config call and/or before first request. See related issue https://github.com/MarekSuchanek/labelord_tests/issues/18#issuecomment-338366322

Other things seems to work well... Please do this little fix with v0.2.1 tag.

HalfDeadPie commented 7 years ago

@MarekSuchanek I hope I fixed that. Now I can run % python labelord.py --help properly and also I am able to pass the CLI tests.

MarekSuchanek commented 7 years ago

Sorry, but not yet.

If you now do export FLASK_APP=labelord.py and flask run (even with default config.cfg present), everything seems fine but then you get 500 Internal Server Error with crazy error in console. You should check the configuration not just when reload_config (just in tests) but before every (or better before first) request... So correct error message will appear in console (like No GitHub token has been provided or other).

Just add checking/loading the configuration to appropriate place and it will be ready for 5 points.

HalfDeadPie commented 7 years ago

So is It ok now @MarekSuchanek ?

MarekSuchanek commented 7 years ago

Yeah it is OK now, but because of the non-revoked tokens I have to give you 4 points...