-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make sure cli works without pip install
source from CCBR/CHAMPAGNE#180
- Loading branch information
1 parent
a0116d4
commit e4df1f1
Showing
2 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env python | ||
import os | ||
import re | ||
import sys | ||
|
||
# add script directory to the path to allow champagne CLI to work out-of-the-box | ||
# without the need to install it via pip first | ||
SCRIPT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "src", "renee") | ||
sys.path.append(SCRIPT_DIR) | ||
from src.renee.__main__ import main | ||
|
||
if ( | ||
__name__ == "__main__" | ||
): # this block is adapted from the executable file created by `pip install` | ||
sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0]) | ||
sys.exit(main()) |