-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release(v0.0.1): just to reserve name
- Loading branch information
Showing
7 changed files
with
57 additions
and
4 deletions.
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,5 @@ | ||
pip install -r requirements/dev.txt | ||
|
||
python setup.py sdist bdist_wheel | ||
|
||
twine upload dist/* |
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,37 @@ | ||
import click | ||
import yaml | ||
import os | ||
|
||
def set_yaml_state(file: str) -> dict: | ||
with open(file, 'r') as f: | ||
data_dict = yaml.load(f, Loader=yaml.FullLoader) | ||
return data_dict | ||
def update_yaml_state(state: dict, file_path: str) -> None: | ||
with open(file_path, 'w') as outputfile: | ||
yaml.dump(state, outputfile, default_flow_style=False) | ||
|
||
@click.command() | ||
def configure(): | ||
"""To configure the interface for future calls""" | ||
|
||
PATH = '~/.mindmate' | ||
FILE_NAME = 'environment.yaml' | ||
|
||
while not os.path.isfile(PATH+'/'+FILE_NAME): | ||
try: | ||
os.makedirs(PATH) | ||
except FileExistsError as f: | ||
pass | ||
data = { | ||
'keys': { | ||
'openai_token':'xxxx' | ||
} | ||
} | ||
with open(PATH+'/'+FILE_NAME, 'w') as outputfile: | ||
yaml.dump(data, outputfile, default_flow_style=False) | ||
|
||
file = set_yaml_state(PATH+'/'+FILE_NAME) | ||
openai_value = file['keys']['openai_token'] | ||
openai_user_token = click.prompt(f'OPENAI TOKEN [****************{openai_value[-4:]}]', type=str) | ||
file['keys']['openai_token'] = openai_user_token | ||
update_yaml_state(state=file, file_path=PATH+'/'+FILE_NAME) |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
click==8.1.3 | ||
click==8.1.3 | ||
openai>=0.27 | ||
PyYAML==6 |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
-r base.txt | ||
wheel | ||
wheel | ||
twine |
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