Skip to content
Snippets Groups Projects
Commit 6dac8286 authored by Gokhan OZBULAK's avatar Gokhan OZBULAK
Browse files

Import modules when necessary #60.

parent cf7ca43e
No related branches found
No related tags found
No related merge requests found
Pipeline #86368 failed
...@@ -2,16 +2,8 @@ ...@@ -2,16 +2,8 @@
# #
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
import configparser
import json
import os
import pathlib import pathlib
import shutil
import tempfile
import click import click
import gitlab
import mlflow
from clapper.click import ResourceOption, verbosity_option from clapper.click import ResourceOption, verbosity_option
from clapper.logging import setup from clapper.logging import setup
...@@ -27,6 +19,8 @@ def _get_gitlab_config(): ...@@ -27,6 +19,8 @@ def _get_gitlab_config():
------- -------
Gitlab entry and credential. Gitlab entry and credential.
""" """
import gitlab
import configparser
cfg = pathlib.Path("~/.python-gitlab.cfg").expanduser() cfg = pathlib.Path("~/.python-gitlab.cfg").expanduser()
if cfg.exists(): if cfg.exists():
...@@ -56,6 +50,8 @@ def _create_temp_copy(source, target): ...@@ -56,6 +50,8 @@ def _create_temp_copy(source, target):
------- -------
Path to target file in temp folder. Path to target file in temp folder.
""" """
import shutil
import tempfile
temp_dir = pathlib.Path(tempfile.gettempdir()) temp_dir = pathlib.Path(tempfile.gettempdir())
target = temp_dir / target target = temp_dir / target
...@@ -120,6 +116,9 @@ def upload( ...@@ -120,6 +116,9 @@ def upload(
**_, # ignored **_, # ignored
) -> None: # numpydoc ignore=PR01 ) -> None: # numpydoc ignore=PR01
"""Upload results from an experiment folder.""" """Upload results from an experiment folder."""
import os
import json
import mlflow
logger.info("Getting Gitlab credentials for accessing to MLFlow server...") logger.info("Getting Gitlab credentials for accessing to MLFlow server...")
gitlab, config = _get_gitlab_config() gitlab, config = _get_gitlab_config()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment