Skip to content

Commit 7810de1

Browse files
committed
Refactor directory structure to enable 'from msgraph.core' import format
1 parent 583a0f5 commit 7810de1

23 files changed

+45
-48
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,12 @@ repos:
2121
name: pylint
2222
stages: [commit]
2323
language: system
24-
entry: pipenv run pylint msgraphcore --disable=W --rcfile=.pylintrc
24+
entry: pipenv run pylint msgraph --disable=W --rcfile=.pylintrc
2525
types: [python]
2626

2727
- id: pytest-unit
2828
name: pytest-unit
2929
stages: [commit]
3030
language: system
31-
entry: pipenv run coverage run -m pytest tests/unit
32-
types: [python]
33-
34-
- id: pytest-integration
35-
name: pytest-integration
36-
stages: [commit]
37-
language: system
38-
entry: pipenv run coverage run -m pytest tests/integration
31+
entry: pipenv run pytest
3932
types: [python]

msgraph/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# ------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
# -----------------------------------

msgraph/core/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from .client_factory import HTTPClientFactory
2+
from .constants import SDK_VERSION
3+
from .graph_client import GraphClient
4+
5+
__version__ = SDK_VERSION
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
from requests import Session
55

6-
from msgraphcore.constants import CONNECTION_TIMEOUT, REQUEST_TIMEOUT
7-
from msgraphcore.enums import APIVersion, NationalClouds
8-
from msgraphcore.middleware.abc_token_credential import TokenCredential
9-
from msgraphcore.middleware.authorization import AuthorizationHandler
10-
from msgraphcore.middleware.middleware import BaseMiddleware, MiddlewarePipeline
6+
from .constants import CONNECTION_TIMEOUT, REQUEST_TIMEOUT
7+
from .enums import APIVersion, NationalClouds
8+
from .middleware.abc_token_credential import TokenCredential
9+
from .middleware.authorization import AuthorizationHandler
10+
from .middleware.middleware import BaseMiddleware, MiddlewarePipeline
1111

1212

1313
class HTTPClientFactory:
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
from requests import Request, Session
44

5-
from msgraphcore.client_factory import HTTPClientFactory
6-
from msgraphcore.middleware.abc_token_credential import TokenCredential
7-
from msgraphcore.middleware.middleware import BaseMiddleware
8-
from msgraphcore.middleware.request_context import RequestContext
5+
from .client_factory import HTTPClientFactory
6+
from .middleware.abc_token_credential import TokenCredential
7+
from .middleware.middleware import BaseMiddleware
8+
from .middleware.request_context import RequestContext
99

1010
supported_options = ['scopes', 'custom_option']
1111

msgraph/core/middleware/__init__.py

Whitespace-only changes.
File renamed without changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from msgraphcore.enums import FeatureUsageFlag
2-
from msgraphcore.middleware.abc_token_credential import TokenCredential
3-
from msgraphcore.middleware.middleware import BaseMiddleware
1+
from ..enums import FeatureUsageFlag
2+
from .abc_token_credential import TokenCredential
3+
from .middleware import BaseMiddleware
44

55

66
class AuthorizationHandler(BaseMiddleware):

0 commit comments

Comments
 (0)