-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install requirements from viz, telemetry separately
Signed-off-by: Nok Lam Chan <[email protected]>
- Loading branch information
Showing
7 changed files
with
105 additions
and
17 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,15 +1,21 @@ | ||
from kedro_telemetry.plugin import _check_for_telemetry_consent | ||
import logging | ||
# import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
# logger = logging.getLogger(__name__) | ||
|
||
if __name__ == "__main__": | ||
from pathlib import Path | ||
import sys | ||
import sys | ||
|
||
if len(sys.argv) > 1: | ||
path = Path(sys.argv[1]) | ||
else: | ||
path = Path.cwd() | ||
consent = _check_for_telemetry_consent(path) | ||
logger.debug(f"Consent for telemetry: {consent}") | ||
|
||
|
||
|
||
|
||
# logger.debug(f"Consent for telemetry: {consent}") | ||
print("dummy") | ||
# return "dummy" |
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,47 @@ | ||
import subprocess | ||
import sys | ||
from pathlib import Path | ||
|
||
def install_dependencies(extension_root_dir): | ||
""" | ||
Install dependencies required for the Kedro extension. | ||
Args: | ||
extension_root_dir (str): The root directory of the extension. | ||
Raises: | ||
ImportError: If the required dependencies are not found. | ||
""" | ||
... | ||
libs_path = Path(extension_root_dir) / "bundled" / "libs" | ||
requirements_path = Path(extension_root_dir) / "kedro-viz-requirements.txt" | ||
|
||
try: | ||
import kedro_telemetry | ||
from packaging.version import parse | ||
|
||
version = parse(kedro_telemetry.__version__) | ||
if version.major<1 and version.minor<6: # at least >0.6.0 | ||
raise ImportError("kedro-telemetry version must be >=0.6.0") | ||
except ImportError: | ||
subprocess.check_call( | ||
[ | ||
sys.executable, | ||
"-m", | ||
"pip", | ||
"install", | ||
"-r", | ||
Path(requirements_path), | ||
"-t", | ||
Path(libs_path), | ||
"--no-cache-dir", | ||
"--no-deps" | ||
] | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) > 1: | ||
extension_root_dir = sys.argv[1] | ||
else: | ||
extension_root_dir = None | ||
install_dependencies(extension_root_dir) |
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,2 @@ | ||
packaging | ||
kedro-telemetry>=0.6.0 # First version that does not prompt for telemetry |
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,3 +1,3 @@ | ||
fastapi>=0.100.0,<0.200.0 | ||
pydantic>=2.0.0 # In case of FastAPI installs pydantic==1 | ||
orjson>=3.9, <4.0 | ||
orjson>=3.9, <4.0 |
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