Skip to content

Commit 7af1c0e

Browse files
committed
fix(env): load_env
1 parent 062b5f0 commit 7af1c0e

15 files changed

Lines changed: 11 additions & 30 deletions

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath"
3-
version = "2.1.33"
3+
version = "2.1.34"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

src/uipath/_cli/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import click
55

6+
from ._utils._common import load_environment_variables
67
from .cli_auth import auth as auth
78
from .cli_deploy import deploy as deploy # type: ignore
89
from .cli_dev import dev as dev
@@ -43,6 +44,7 @@ def _get_safe_version() -> str:
4344
help="Display the current version of uipath.",
4445
)
4546
def cli(lv: bool, v: bool) -> None:
47+
load_environment_variables()
4648
if lv:
4749
try:
4850
version = importlib.metadata.version("uipath-langchain")

src/uipath/_cli/_auth/_auth_server.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@
77
import time
88
from typing import Optional
99

10-
from dotenv import load_dotenv
11-
1210
from ._oidc_utils import get_auth_config
1311

14-
load_dotenv(override=True)
15-
1612
# Server port
1713
PORT = 6234
1814

src/uipath/_cli/_evals/progress_reporter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def __init__(
3232
no_of_evals: Number of evaluations in the set
3333
evaluators: List of evaluator instances
3434
"""
35+
3536
self._eval_set_id = eval_set_id
3637
self.agent_snapshot = agent_snapshot
3738
self._no_of_evals = no_of_evals

src/uipath/_cli/_utils/_common.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from urllib.parse import urlparse
44

55
import click
6+
from dotenv import find_dotenv, load_dotenv
67

78
from ..spinner import Spinner
89

@@ -102,3 +103,7 @@ def clean_directory(directory: str) -> None:
102103

103104
if os.path.isfile(file_path) and file_name.endswith(".py"):
104105
os.remove(file_path)
106+
107+
108+
def load_environment_variables():
109+
load_dotenv(dotenv_path=find_dotenv(usecwd=True), override=True)

src/uipath/_cli/cli_auth.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from urllib.parse import urlparse
88

99
import click
10-
from dotenv import load_dotenv
1110

1211
from ..telemetry import track
1312
from ._auth._auth_server import HTTPServer
@@ -18,7 +17,6 @@
1817
from ._utils._common import environment_options
1918
from ._utils._console import ConsoleLogger
2019

21-
load_dotenv(override=True)
2220
console = ConsoleLogger()
2321

2422

src/uipath/_cli/cli_eval.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
from typing import List, Optional, Tuple
66

77
import click
8-
from dotenv import load_dotenv
98

109
from .._utils.constants import ENV_JOB_ID
1110
from ..telemetry import track
1211
from ._evals.evaluation_service import EvaluationService
1312
from ._utils._console import ConsoleLogger
1413

1514
console = ConsoleLogger()
16-
load_dotenv(override=True)
1715

1816

1917
class LiteralOption(click.Option):

src/uipath/_cli/cli_init.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,9 @@ def write_config_file(config_data: Dict[str, Any]) -> None:
125125
@track
126126
def init(entrypoint: str, infer_bindings: bool) -> None:
127127
"""Create uipath.json with input/output schemas and bindings."""
128-
current_path = os.getcwd()
129-
load_dotenv(os.path.join(current_path, ".env"), override=True)
130-
131128
with console.spinner("Initializing UiPath project ..."):
129+
current_path = os.getcwd()
130+
load_dotenv(os.path.join(current_path, ".env"), override=True)
132131
current_directory = os.getcwd()
133132
generate_env_file(current_directory)
134133
create_telemetry_config_file(current_directory)

src/uipath/_cli/cli_invoke.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from ._utils._processes import get_release_info
2222

2323
logger = logging.getLogger(__name__)
24-
load_dotenv(override=True)
2524
console = ConsoleLogger()
2625

2726

src/uipath/_cli/cli_pull.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from typing import Dict, Set
1818

1919
import click
20-
from dotenv import load_dotenv
2120

2221
from ..telemetry import track
2322
from ._utils._console import ConsoleLogger
@@ -30,7 +29,6 @@
3029
)
3130

3231
console = ConsoleLogger()
33-
load_dotenv(override=True)
3432

3533

3634
def compute_normalized_hash(content: str) -> str:

0 commit comments

Comments
 (0)