From 4e87c8e191dc5066a82a6ac8f9f58cb384907503 Mon Sep 17 00:00:00 2001 From: Casey Jao Date: Wed, 12 Jul 2023 17:55:17 -0400 Subject: [PATCH] Mem (1/3): Fix requirements workflow Change abs imports to rel imports. Needed to please pip-missing-reqs. --- .github/workflows/requirements.yml | 7 ++----- covalent/_shared_files/schemas/common.py | 2 +- covalent/_workflow/electron.py | 3 +-- covalent_dispatcher/_dal/exporters/electron.py | 3 ++- covalent_dispatcher/_dal/exporters/lattice.py | 2 +- covalent_dispatcher/_dal/exporters/result.py | 4 ++-- covalent_dispatcher/_dal/exporters/tg.py | 2 +- covalent_dispatcher/_dal/importers/electron.py | 13 +++++++------ covalent_dispatcher/_dal/importers/lattice.py | 7 ++++--- covalent_dispatcher/_dal/importers/result.py | 11 +++++------ covalent_dispatcher/_dal/importers/tg.py | 12 ++++++------ covalent_dispatcher/_db/load.py | 10 +++++----- requirements.txt | 1 - 13 files changed, 37 insertions(+), 40 deletions(-) diff --git a/.github/workflows/requirements.yml b/.github/workflows/requirements.yml index 519b6d639..d9bb5e71a 100644 --- a/.github/workflows/requirements.yml +++ b/.github/workflows/requirements.yml @@ -43,17 +43,14 @@ jobs: run: python -m pip install pip-check-reqs - name: Check extra core requirements - run: pip-extra-reqs -r werkzeug -r python-multipart covalent covalent_dispatcher covalent_ui + run: pip-extra-reqs -r werkzeug covalent covalent_dispatcher covalent_ui - name: Check missing SDK requirements run: > pip-missing-reqs --ignore-module=covalent_ui.* - --ignore-module=covalent.* --ignore-module=urllib3.* --ignore-module=pkg_resources - --ignore-module=covalent/_dispatcher_plugins - --ignore-module=covalent/_shared_files --ignore-file=covalent/executor/** --ignore-file=covalent/triggers/** --ignore-file=covalent/cloud_resource_manager/** @@ -64,7 +61,7 @@ jobs: pip-missing-reqs --ignore-module=covalent_ui.* --ignore-module=covalent.* - --ignore-module=covalent_dispatcher.* + --ignore-module=covalent_dispatcher --ignore-module=distributed.* covalent_dispatcher diff --git a/covalent/_shared_files/schemas/common.py b/covalent/_shared_files/schemas/common.py index 7b639ddda..4ba450c83 100644 --- a/covalent/_shared_files/schemas/common.py +++ b/covalent/_shared_files/schemas/common.py @@ -22,7 +22,7 @@ from enum import Enum -from covalent._shared_files.util_classes import RESULT_STATUS +from ..util_classes import RESULT_STATUS class StatusEnum(str, Enum): diff --git a/covalent/_workflow/electron.py b/covalent/_workflow/electron.py index a620d15df..5bf1652b5 100644 --- a/covalent/_workflow/electron.py +++ b/covalent/_workflow/electron.py @@ -29,8 +29,7 @@ from functools import wraps from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Union -from covalent._dispatcher_plugins.local import LocalDispatcher - +from .._dispatcher_plugins.local import LocalDispatcher from .._file_transfer.enums import Order from .._file_transfer.file_transfer import FileTransfer from .._shared_files import logger diff --git a/covalent_dispatcher/_dal/exporters/electron.py b/covalent_dispatcher/_dal/exporters/electron.py index 46fdd1be6..73a66d2b7 100644 --- a/covalent_dispatcher/_dal/exporters/electron.py +++ b/covalent_dispatcher/_dal/exporters/electron.py @@ -29,7 +29,8 @@ ElectronMetadata, ElectronSchema, ) -from covalent_dispatcher._dal.electron import ASSET_KEYS, Electron + +from ..electron import ASSET_KEYS, Electron app_log = logger.app_log diff --git a/covalent_dispatcher/_dal/exporters/lattice.py b/covalent_dispatcher/_dal/exporters/lattice.py index 277412d2c..fa132d546 100644 --- a/covalent_dispatcher/_dal/exporters/lattice.py +++ b/covalent_dispatcher/_dal/exporters/lattice.py @@ -24,8 +24,8 @@ from covalent._shared_files.schemas.asset import AssetSchema from covalent._shared_files.schemas.lattice import LatticeAssets, LatticeMetadata, LatticeSchema -from covalent_dispatcher._dal.lattice import ASSET_KEYS, METADATA_KEYS, Lattice +from ..lattice import ASSET_KEYS, METADATA_KEYS, Lattice from .tg import export_transport_graph diff --git a/covalent_dispatcher/_dal/exporters/result.py b/covalent_dispatcher/_dal/exporters/result.py index d97adf34d..05d8f7636 100644 --- a/covalent_dispatcher/_dal/exporters/result.py +++ b/covalent_dispatcher/_dal/exporters/result.py @@ -33,9 +33,9 @@ ResultSchema, ) from covalent._shared_files.utils import format_server_url -from covalent_dispatcher._dal.electron import Electron -from covalent_dispatcher._dal.result import Result, get_result_object +from ..electron import Electron +from ..result import Result, get_result_object from ..utils.uri_filters import AssetScope, URIFilterPolicy, filter_asset_uri from .lattice import export_lattice diff --git a/covalent_dispatcher/_dal/exporters/tg.py b/covalent_dispatcher/_dal/exporters/tg.py index 04eb88659..601814ce8 100644 --- a/covalent_dispatcher/_dal/exporters/tg.py +++ b/covalent_dispatcher/_dal/exporters/tg.py @@ -27,8 +27,8 @@ from covalent._shared_files.schemas.edge import EdgeMetadata, EdgeSchema from covalent._shared_files.schemas.electron import ElectronSchema from covalent._shared_files.schemas.transport_graph import TransportGraphSchema -from covalent_dispatcher._dal.tg import _TransportGraph +from ..tg import _TransportGraph from .electron import export_electron app_log = logger.app_log diff --git a/covalent_dispatcher/_dal/importers/electron.py b/covalent_dispatcher/_dal/importers/electron.py index 677ff0723..c85594e22 100644 --- a/covalent_dispatcher/_dal/importers/electron.py +++ b/covalent_dispatcher/_dal/importers/electron.py @@ -44,12 +44,13 @@ ElectronAssets, ElectronSchema, ) -from covalent_dispatcher._dal.asset import Asset -from covalent_dispatcher._dal.electron import ElectronMeta -from covalent_dispatcher._dal.lattice import Lattice -from covalent_dispatcher._db import models -from covalent_dispatcher._db.write_result_to_db import get_electron_type -from covalent_dispatcher._object_store.base import BaseProvider + +from ..._db import models +from ..._db.write_result_to_db import get_electron_type +from ..._object_store.base import BaseProvider +from ..asset import Asset +from ..electron import ElectronMeta +from ..lattice import Lattice app_log = logger.app_log diff --git a/covalent_dispatcher/_dal/importers/lattice.py b/covalent_dispatcher/_dal/importers/lattice.py index 98627c7ff..3cd3e4ab9 100644 --- a/covalent_dispatcher/_dal/importers/lattice.py +++ b/covalent_dispatcher/_dal/importers/lattice.py @@ -45,9 +45,10 @@ LatticeAssets, LatticeSchema, ) -from covalent_dispatcher._dal.asset import Asset -from covalent_dispatcher._dal.lattice import Lattice -from covalent_dispatcher._object_store.local import BaseProvider + +from ..._object_store.local import BaseProvider +from ..asset import Asset +from ..lattice import Lattice def _get_lattice_meta(lat: LatticeSchema, storage_path) -> dict: diff --git a/covalent_dispatcher/_dal/importers/result.py b/covalent_dispatcher/_dal/importers/result.py index 026c0eda3..4dbe5f312 100644 --- a/covalent_dispatcher/_dal/importers/result.py +++ b/covalent_dispatcher/_dal/importers/result.py @@ -31,13 +31,12 @@ from covalent._shared_files.schemas.lattice import LatticeSchema from covalent._shared_files.schemas.result import ResultAssets, ResultSchema from covalent._shared_files.utils import format_server_url -from covalent_dispatcher._dal.asset import Asset -from covalent_dispatcher._dal.electron import ElectronMeta -from covalent_dispatcher._dal.job import Job -from covalent_dispatcher._dal.result import Result, ResultMeta -from covalent_dispatcher._object_store.local import BaseProvider, local_store -from ..asset import copy_asset_meta +from ..._object_store.local import BaseProvider, local_store +from ..asset import Asset, copy_asset_meta +from ..electron import ElectronMeta +from ..job import Job +from ..result import Result, ResultMeta from ..tg_ops import TransportGraphOps from ..utils.uri_filters import AssetScope, URIFilterPolicy, filter_asset_uri from .lattice import _get_lattice_meta, import_lattice_assets diff --git a/covalent_dispatcher/_dal/importers/tg.py b/covalent_dispatcher/_dal/importers/tg.py index 5cc40496a..ea0f00fc0 100644 --- a/covalent_dispatcher/_dal/importers/tg.py +++ b/covalent_dispatcher/_dal/importers/tg.py @@ -28,13 +28,13 @@ from covalent._shared_files import logger from covalent._shared_files.schemas.edge import EdgeSchema from covalent._shared_files.schemas.transport_graph import TransportGraphSchema -from covalent_dispatcher._dal.edge import ElectronDependency -from covalent_dispatcher._dal.electron import Electron -from covalent_dispatcher._dal.job import Job -from covalent_dispatcher._dal.lattice import Lattice -from covalent_dispatcher._db import models -from covalent_dispatcher._object_store.base import BaseProvider +from ..._db import models +from ..._object_store.base import BaseProvider +from ..edge import ElectronDependency +from ..electron import Electron +from ..job import Job +from ..lattice import Lattice from .electron import import_electron app_log = logger.app_log diff --git a/covalent_dispatcher/_db/load.py b/covalent_dispatcher/_db/load.py index 829021ff1..e014a57f2 100644 --- a/covalent_dispatcher/_db/load.py +++ b/covalent_dispatcher/_db/load.py @@ -29,12 +29,12 @@ from covalent._shared_files.util_classes import Status from covalent._workflow.transport import TransportableObject from covalent._workflow.transport import _TransportGraph as SDKGraph -from covalent_dispatcher._dal.electron import ASSET_KEYS as ELECTRON_ASSETS -from covalent_dispatcher._dal.electron import METADATA_KEYS as ELECTRON_META -from covalent_dispatcher._dal.result import get_result_object -from covalent_dispatcher._dal.tg import _TransportGraph as SRVGraph -from covalent_dispatcher._object_store.local import local_store +from .._dal.electron import ASSET_KEYS as ELECTRON_ASSETS +from .._dal.electron import METADATA_KEYS as ELECTRON_META +from .._dal.result import get_result_object +from .._dal.tg import _TransportGraph as SRVGraph +from .._object_store.local import local_store from .datastore import workflow_db from .models import Electron, Lattice diff --git a/requirements.txt b/requirements.txt index 88c16507e..6f6d6f3bc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,6 @@ furl>=2.1.3 networkx>=2.8.6 psutil>=5.9.0 pydantic>=1.10.1 -python-multipart>=0.0.6 python-socketio>=5.7.1 requests>=2.24.0 simplejson>=3.17.6