-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a0e43f
commit c4aa17a
Showing
8 changed files
with
54 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
from hal9.api import * | ||
from hal9.create import create | ||
from hal9.run import run | ||
from hal9.deploy import deploy |
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,28 @@ | ||
import os | ||
import shutil | ||
from pathlib import Path | ||
|
||
def create(path :str, template :str) -> str: | ||
"""Create an application | ||
Parameters | ||
---------- | ||
path : str | ||
Path to the application. | ||
template : str | ||
The template to use. | ||
""" | ||
|
||
current_dir = Path(__file__).parent | ||
template_path = current_dir / "templates" / template | ||
|
||
os.makedirs(path, exist_ok=True) | ||
|
||
for item in template_path.iterdir(): | ||
dest = Path(path) / item.name | ||
if item.is_dir(): | ||
shutil.copytree(item, dest) | ||
else: | ||
shutil.copy2(item, dest) | ||
|
||
print(f'Project created!') |
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 @@ | ||
import requests | ||
import time | ||
import tempfile | ||
import sys | ||
import runpy | ||
|
||
def run(path :str) -> str: | ||
"""Run an application | ||
Parameters | ||
---------- | ||
path : str | ||
Path to the application. | ||
""" | ||
|
||
print(f'Running...') |
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 @@ | ||
print('Hello from OpenAI') |
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,9 +1,10 @@ | ||
[tool.poetry] | ||
name = "hal9" | ||
version = "2.0.2" | ||
version = "2.0.3" | ||
description = "" | ||
authors = ["Javier Luraschi <[email protected]>"] | ||
readme = "README.md" | ||
include = ["templates/openai/app.py"] | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.8,<3.9.7 || >3.9.7,<4.0" | ||
|
This file was deleted.
Oops, something went wrong.