aap-utils 0.1.13__tar.gz → 0.1.15__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aap_utils
3
- Version: 0.1.13
3
+ Version: 0.1.15
4
4
  Summary: A Python library for registering an IP address for AAP
5
5
  Author: Minh Dang
6
6
  Author-email: danghoangminh86@gmail.com
@@ -8,3 +8,4 @@ Classifier: Programming Language :: Python :: 3
8
8
  Classifier: License :: OSI Approved :: MIT License
9
9
  Classifier: Operating System :: OS Independent
10
10
  Requires-Dist: requests
11
+ Requires-Dist: pathlib
@@ -2,7 +2,8 @@ import socket
2
2
  import requests
3
3
  import time
4
4
  import os
5
- from hydra import initialize, compose
5
+ from pathlib import Path
6
+ from hydra import initialize, compose, initialize_config_dir
6
7
  from omegaconf import OmegaConf, DictConfig
7
8
 
8
9
  def register_demo(debug=False):
@@ -60,11 +61,12 @@ def create_url(domain_name = "aiplatform.vcntt.tech"):
60
61
  url = f"https://{transformed_namespace}.{domain_name}"
61
62
  return url, transformed_namespace
62
63
 
64
+
63
65
  def get_args():
64
66
  kcn_params = "config.yaml"
65
67
 
66
68
  # Get the absolute path of the folder where run.py is located
67
- run_py_dir = Path(__file__).parent.resolve()
69
+ run_py_dir = Path(os.getcwd()).resolve()
68
70
  config_path = os.path.join(run_py_dir, "configs") # Absolute path to "configs/"
69
71
 
70
72
  overrides = []
@@ -80,8 +82,8 @@ def get_args():
80
82
  # Ensure the configs directory exists
81
83
  if not os.path.exists(os.path.join(config_path, kcn_params)):
82
84
  raise FileNotFoundError(f"Config file not found: {os.path.join(config_path, kcn_params)}")
83
-
85
+
84
86
  with initialize_config_dir(version_base=None, config_dir=config_path):
85
87
  args = compose(config_name=kcn_params)
86
88
 
87
- return args
89
+ return args
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aap_utils
3
- Version: 0.1.13
3
+ Version: 0.1.15
4
4
  Summary: A Python library for registering an IP address for AAP
5
5
  Author: Minh Dang
6
6
  Author-email: danghoangminh86@gmail.com
@@ -8,3 +8,4 @@ Classifier: Programming Language :: Python :: 3
8
8
  Classifier: License :: OSI Approved :: MIT License
9
9
  Classifier: Operating System :: OS Independent
10
10
  Requires-Dist: requests
11
+ Requires-Dist: pathlib
@@ -2,7 +2,6 @@ README.md
2
2
  pyproject.toml
3
3
  setup.py
4
4
  aap_utils/__init__.py
5
- aap_utils/config_loader.py
6
5
  aap_utils/register.py
7
6
  aap_utils.egg-info/PKG-INFO
8
7
  aap_utils.egg-info/SOURCES.txt
@@ -2,13 +2,14 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="aap_utils", # The name of your library
5
- version="0.1.13",
5
+ version="0.1.15",
6
6
  description="A Python library for registering an IP address for AAP",
7
7
  author="Minh Dang",
8
8
  author_email="danghoangminh86@gmail.com",
9
9
  packages=find_packages(), # Auto-find packages in the directory
10
10
  install_requires=[
11
11
  "requests", # Any external dependencies (e.g., 'requests')
12
+ "pathlib",
12
13
  ],
13
14
  classifiers=[
14
15
  "Programming Language :: Python :: 3",
@@ -1,26 +0,0 @@
1
- import os
2
- from hydra import initialize, compose
3
- from omegaconf import DictConfig
4
-
5
- class ConfigLoader:
6
- def __init__(self):
7
- self.kcn_params = "config.yaml"
8
- self.config_path = "configs/"
9
- self.overrides = []
10
-
11
- def _load_env_variables(self):
12
- """Load environment variables for config parameters and overrides."""
13
- if os.environ.get("KCN_PARAMS"):
14
- full_path = os.getenv("KCN_PARAMS")
15
- self.kcn_params = os.path.basename(full_path) # Extract the filename
16
-
17
- if os.environ.get("KCN_OVERRIDES"):
18
- overrides_env = os.getenv("KCN_OVERRIDES")
19
- self.overrides = overrides_env.split("|") if overrides_env else []
20
-
21
- def get_args(self) -> DictConfig:
22
- """Load and return the Hydra configuration."""
23
- self._load_env_variables()
24
- with initialize_config_dir(version_base=None, config_dir=self.config_path):
25
- args = compose(config_name=self.kcn_params, overrides=self.overrides)
26
- return args
File without changes
File without changes
File without changes