Skip to content

Commit b18bbf4

Browse files
committed
renaming
1 parent 35a97e0 commit b18bbf4

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/python_activator/api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from fastapi import FastAPI, Header, HTTPException, Request
1111
from fastapi.openapi.docs import get_swagger_ui_html
1212

13-
from python_activator.manifest import process_manifest
13+
from python_activator.loader import load_packages
1414

1515

1616
class knowledge_object:
@@ -109,7 +109,7 @@ def install_requirements(modulepath):
109109

110110

111111
# look into the main directory that has all the packages and have the python ones installed
112-
def install_packages_from_directory(directory, manifest: dict):
112+
def install_packages(directory, manifest: dict):
113113
for ko in manifest:
114114
install_module(directory, manifest[ko])
115115
list_installed_packages()
@@ -203,8 +203,8 @@ async def startup_event():
203203
else:
204204
object_directory = os.path.join(Path(os.getcwd()).joinpath("pyshelf"), "")
205205

206-
manifest = process_manifest(object_directory)
207-
install_packages_from_directory(object_directory, manifest)
206+
manifest = load_packages(object_directory)
207+
install_packages(object_directory, manifest)
208208
try:
209209
del os.environ["COLLECTION_PATH"]
210210
del os.environ["MANIFEST_PATH"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def __init__(self, name, status):
1313
self.status = status
1414

1515

16-
def process_manifest(object_directory: str) -> dict:
16+
def load_packages(object_directory: str) -> dict:
1717
manifest_path = os.environ.get("MANIFEST_PATH")
1818
scanned_directories = [f.name for f in os.scandir(object_directory) if f.is_dir()]
1919
output_manifest = {}

tests/test_dot_dirs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from python_activator.api import install_module
2-
from python_activator.manifest import ko_object
2+
from python_activator.loader import ko_object
33
import os
44
import sys
55
import importlib

tests/test_manifest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
import requests
88
import urllib
99

10-
from python_activator.manifest import process_manifest
10+
from python_activator.loader import load_packages
1111

1212

1313
def test_process_local_manifest():
1414
os.environ["MANIFEST_PATH"] = "/home/faridsei/dev/test/manifest/manifest.json"
15-
process_manifest("/home/faridsei/dev/test/pyshelf/")
15+
load_packages("/home/faridsei/dev/test/pyshelf/")
1616
del os.environ["MANIFEST_PATH"]
1717

1818
# Assert
@@ -23,15 +23,15 @@ def test_process_internet_manifest():
2323
os.environ[
2424
"MANIFEST_PATH"
2525
] = "https://github.com/kgrid-objects/example-collection/releases/download/4.2.1/manifest.json"
26-
process_manifest("/home/faridsei/dev/test/pyshelf/")
26+
load_packages("/home/faridsei/dev/test/pyshelf/")
2727
del os.environ["MANIFEST_PATH"]
2828

2929
# Assert
3030
assert 1 == 1
3131

3232

3333
def test_process_no_manifest():
34-
process_manifest("/home/faridsei/dev/test/pyshelf/")
34+
load_packages("/home/faridsei/dev/test/pyshelf/")
3535

3636
# Assert
3737
assert 1 == 1

0 commit comments

Comments
 (0)