diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml index 14990c61..370f5d2d 100644 --- a/.github/policies/resourceManagement.yml +++ b/.github/policies/resourceManagement.yml @@ -57,6 +57,16 @@ configuration: reply: This issue has been marked as duplicate and has not had any activity for **1 day**. It will be closed for housekeeping purposes. - closeIssue eventResponderTasks: + - if: + - payloadType: Issues + - isAction: + action: Closed + - hasLabel: + label: 'status:waiting-for-author-feedback' + then: + - removeLabel: + label: 'status:waiting-for-author-feedback' + description: - if: - payloadType: Issue_Comment - isAction: diff --git a/.github/workflows/auto-merge-dependabot.yml b/.github/workflows/auto-merge-dependabot.yml index e1b2d6b3..f1903792 100644 --- a/.github/workflows/auto-merge-dependabot.yml +++ b/.github/workflows/auto-merge-dependabot.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v2.1.0 + uses: dependabot/fetch-metadata@v2.2.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7b2793d9..b2f72ea3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,9 +5,6 @@ on: tags: - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 -permissions: - contents: write - jobs: build: uses: ./.github/workflows/build.yml @@ -36,18 +33,3 @@ jobs: with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} - - release: - name: Create release - runs-on: ubuntu-latest - needs: [publish] - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Extract release notes - id: extract-release-notes - uses: ffurrer2/extract-release-notes@v2 - - name: Create release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh release create --notes '${{ steps.extract-release-notes.outputs.release_notes }}' --title ${{ github.ref_name }} ${{ github.ref_name }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f3587d10..89623a7f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.1.0" + ".": "1.1.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cdd333b..6a9bca3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. +## [1.1.1](https://github.com/microsoftgraph/msgraph-sdk-python-core/compare/v1.1.0...v1.1.1) (2024-07-10) + + +### Bug Fixes + +* avoid using default mutable parameters ([9fa773a](https://github.com/microsoftgraph/msgraph-sdk-python-core/commit/9fa773a7ca92f916a6eb593f033322d5a1918a10)) +* fixes constants path for release please config ([2ff4440](https://github.com/microsoftgraph/msgraph-sdk-python-core/commit/2ff4440a18347feb173a40010ab4d9910717c6b6)) + ## [1.1.0](https://github.com/microsoftgraph/msgraph-sdk-python-core/compare/v1.0.1...v1.1.0) (2024-06-19) diff --git a/pyproject.toml b/pyproject.toml index a152ab13..efb5575a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" name = "msgraph-core" # The SDK version # x-release-please-start-version -version = "1.1.0" +version = "1.1.1" # x-release-please-end authors = [{name = "Microsoft", email = "graphtooling+python@microsoft.com"}] description = "Core component of the Microsoft Graph Python SDK" diff --git a/release-please-config.json b/release-please-config.json index e36a1fbb..77b191c6 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -15,7 +15,7 @@ "changelog-path": "CHANGELOG.md", "extra-files": [ "pyproject.toml", - "msgraph-core/_constants.py" + "src/msgraph_core/_constants.py" ] } }, diff --git a/requirements-dev.txt b/requirements-dev.txt index 06ee8ffe..2c625628 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -8,13 +8,13 @@ attrs==23.2.0 ; python_version >= '3.7' azure-core==1.30.2 ; python_version >= '3.7' -azure-identity==1.17.0 +azure-identity==1.17.1 build==1.2.1 bumpver==2023.1129 -certifi==2024.6.2 ; python_version >= '3.6' +certifi==2024.7.4 ; python_version >= '3.6' cffi==1.16.0 ; os_name == 'nt' and implementation_name != 'pypy' @@ -24,7 +24,7 @@ click==8.1.7 ; python_version >= '3.6' colorama==0.4.6 ; os_name == 'nt' -coverage[toml]==7.5.3 ; python_version >= '3.7' +coverage[toml]==7.5.4 ; python_version >= '3.7' cryptography==42.0.8 ; python_version >= '3.7' @@ -50,11 +50,11 @@ mccabe==0.7.0 ; python_version >= '3.6' mock==5.1.0 ; python_version >= '3.6' -msal==1.28.1 +msal==1.29.0 -msal-extensions==1.1.0 +msal-extensions==1.2.0 -mypy==1.10.0 +mypy==1.10.1 mypy-extensions==1.0.0 ; python_version >= '3.5' @@ -68,13 +68,13 @@ platformdirs==4.2.2 ; python_version >= '3.7' pluggy==1.5.0 ; python_version >= '3.7' -portalocker==2.8.2 ; python_version >= '3.5' and platform_system == 'Windows' +portalocker==2.10.0 ; python_version >= '3.5' and platform_system == 'Windows' pycparser==2.22 pyjwt[crypto]==2.8.0 ; python_version >= '3.7' -pylint==3.2.3 +pylint==3.2.5 pyproject-hooks==1.1.0 ; python_version >= '3.7' @@ -92,7 +92,7 @@ pywin32==306 ; platform_system == 'Windows' requests==2.32.3 ; python_version >= '3.7' -setuptools==70.0.0 +setuptools==70.3.0 six==1.16.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' @@ -106,11 +106,11 @@ tomli==2.0.1 ; python_version < '3.11' tomlkit==0.12.5 ; python_version >= '3.7' -trio==0.25.1 +trio==0.26.0 types-python-dateutil==2.9.0.20240316 -types-requests==2.32.0.20240602; python_version >= '3.7' +types-requests==2.32.0.20240622; python_version >= '3.7' urllib3==2.2.2 ; python_version >= '3.7' typing-extensions==4.12.2 ; python_version >= '3.7' @@ -147,7 +147,7 @@ microsoft-kiota-abstractions==1.3.3 microsoft-kiota-authentication-azure==1.0.0 -microsoft-kiota-http==1.3.1 +microsoft-kiota-http==1.3.2 multidict==6.0.5 ; python_version >= '3.7' diff --git a/src/msgraph_core/_constants.py b/src/msgraph_core/_constants.py index 568c66b9..33794627 100644 --- a/src/msgraph_core/_constants.py +++ b/src/msgraph_core/_constants.py @@ -10,6 +10,6 @@ DEFAULT_CONNECTION_TIMEOUT = 30 # The SDK version # x-release-please-start-version -SDK_VERSION = '1.0.1' +SDK_VERSION = '1.1.1' # x-release-please-end MS_DEFAULT_SCOPE = 'https://graph.microsoft.com/.default' diff --git a/src/msgraph_core/base_graph_request_adapter.py b/src/msgraph_core/base_graph_request_adapter.py index 2acfdc10..2ca00adc 100644 --- a/src/msgraph_core/base_graph_request_adapter.py +++ b/src/msgraph_core/base_graph_request_adapter.py @@ -7,6 +7,7 @@ SerializationWriterFactoryRegistry, ) from kiota_http.httpx_request_adapter import HttpxRequestAdapter +from typing import Optional from .graph_client_factory import GraphClientFactory @@ -16,11 +17,16 @@ class BaseGraphRequestAdapter(HttpxRequestAdapter): def __init__( self, authentication_provider: AuthenticationProvider, - parse_node_factory: ParseNodeFactory = ParseNodeFactoryRegistry(), - serialization_writer_factory: - SerializationWriterFactory = SerializationWriterFactoryRegistry(), - http_client: httpx.AsyncClient = GraphClientFactory.create_with_default_middleware() + parse_node_factory: Optional[ParseNodeFactory] = None, + serialization_writer_factory: Optional[SerializationWriterFactory] = None, + http_client: Optional[httpx.AsyncClient] = None ) -> None: + if parse_node_factory is None: + parse_node_factory = ParseNodeFactoryRegistry() + if serialization_writer_factory is None: + serialization_writer_factory = SerializationWriterFactoryRegistry() + if http_client is None: + http_client = GraphClientFactory.create_with_default_middleware() super().__init__( authentication_provider=authentication_provider, parse_node_factory=parse_node_factory, diff --git a/src/msgraph_core/graph_client_factory.py b/src/msgraph_core/graph_client_factory.py index bd821f3b..39344715 100644 --- a/src/msgraph_core/graph_client_factory.py +++ b/src/msgraph_core/graph_client_factory.py @@ -24,7 +24,7 @@ class GraphClientFactory(KiotaClientFactory): @staticmethod def create_with_default_middleware( api_version: APIVersion = APIVersion.v1, - client: httpx.AsyncClient = KiotaClientFactory.get_default_client(), + client: Optional[httpx.AsyncClient] = None, host: NationalClouds = NationalClouds.Global, options: Optional[Dict[str, RequestOption]] = None ) -> httpx.AsyncClient: @@ -44,6 +44,8 @@ def create_with_default_middleware( Returns: httpx.AsyncClient: An instance of the AsyncClient object """ + if client is None: + client = KiotaClientFactory.get_default_client() client.base_url = GraphClientFactory._get_base_url(host, api_version) # type: ignore middleware = KiotaClientFactory.get_default_middleware(options) telemetry_handler = GraphClientFactory._get_telemetry_handler(options) @@ -54,7 +56,7 @@ def create_with_default_middleware( def create_with_custom_middleware( middleware: Optional[List[BaseMiddleware]], api_version: APIVersion = APIVersion.v1, - client: httpx.AsyncClient = KiotaClientFactory.get_default_client(), + client: Optional[httpx.AsyncClient] = None, host: NationalClouds = NationalClouds.Global, ) -> httpx.AsyncClient: """Applies a custom middleware chain to the HTTP Client @@ -70,6 +72,8 @@ def create_with_custom_middleware( host (NationalClouds): The national clound endpoint to be used. Defaults to NationalClouds.Global. """ + if client is None: + client = KiotaClientFactory.get_default_client() client.base_url = GraphClientFactory._get_base_url(host, api_version) # type: ignore return GraphClientFactory._load_middleware_to_client(client, middleware)