diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index efc14b01..9381b803 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -@microsoftgraph/msgraph-devx-python-write +* @microsoftgraph/msgraph-devx-python-write diff --git a/.github/policies/msgraph-sdk-python-core.yml b/.github/policies/msgraph-sdk-python-core-branch-protection.yml similarity index 97% rename from .github/policies/msgraph-sdk-python-core.yml rename to .github/policies/msgraph-sdk-python-core-branch-protection.yml index a42b9b64..35be14b3 100644 --- a/.github/policies/msgraph-sdk-python-core.yml +++ b/.github/policies/msgraph-sdk-python-core-branch-protection.yml @@ -1,8 +1,6 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -# File initially created using https://github.com/MIchaelMainer/policyservicetoolkit/blob/main/branch_protection_export.ps1. - name: msgraph-sdk-python-core-branch-protection description: Branch protection policy for the msgraph-sdk-python-core repository resource: repository @@ -37,6 +35,7 @@ configuration: # existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status requiredStatusChecks: - CodeQL + - check-build-matrix # Require branches to be up to date before merging. Requires requiredStatusChecks. boolean requiresStrictStatusChecks: true # Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush. @@ -72,6 +71,7 @@ configuration: # existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status requiredStatusChecks: - CodeQL + - check-build-matrix # Require branches to be up to date before merging. Requires requiredStatusChecks. boolean requiresStrictStatusChecks: true # Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush. diff --git a/.github/workflows/auto-merge-dependabot.yml b/.github/workflows/auto-merge-dependabot.yml index 3e225b2e..e1b2d6b3 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@v1.6.0 + uses: dependabot/fetch-metadata@v2.1.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8bdfd4b..31b659d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,3 +48,17 @@ jobs: AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} + + # The check-build-matrix returns success if all matrix jobs in build are successful; otherwise, it returns a failure. + # Use this as a PR status check for GitHub Policy Service instead of individual matrix entry checks. + check-build-matrix: + runs-on: ubuntu-latest + needs: build + if: always() + steps: + - name: All build matrix options are successful + if: ${{ !(contains(needs.*.result, 'failure')) }} + run: exit 0 + - name: One or more build matrix options failed + if: ${{ contains(needs.*.result, 'failure') }} + run: exit 1 diff --git a/.github/workflows/project-auto-add.yml b/.github/workflows/project-auto-add.yml index 7d2a2603..b04122e6 100644 --- a/.github/workflows/project-auto-add.yml +++ b/.github/workflows/project-auto-add.yml @@ -9,19 +9,19 @@ on: types: - opened branches: - - 'main' + - "main" jobs: track_issue: - if: github.actor != 'dependabot[bot]' + if: github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.fork == false runs-on: ubuntu-latest steps: - name: Generate token id: generate_token - uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a + uses: actions/create-github-app-token@v1 with: - app_id: ${{ secrets.GRAPHBOT_APP_ID }} - private_key: ${{ secrets.GRAPHBOT_APP_PEM }} + app-id: ${{ secrets.GRAPHBOT_APP_ID }} + private-key: ${{ secrets.GRAPHBOT_APP_PEM }} - name: Get project data env: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 07d501ce..1796451b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -32,7 +32,7 @@ jobs: - name: Build package run: python -m build - name: Publish package - uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 + uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} diff --git a/requirements-dev.txt b/requirements-dev.txt index d423dceb..06ee8ffe 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,9 +6,9 @@ asyncmock==0.4.2 attrs==23.2.0 ; python_version >= '3.7' -azure-core==1.30.1 ; python_version >= '3.7' +azure-core==1.30.2 ; python_version >= '3.7' -azure-identity==1.16.0 +azure-identity==1.17.0 build==1.2.1 @@ -26,7 +26,7 @@ colorama==0.4.6 ; os_name == 'nt' coverage[toml]==7.5.3 ; python_version >= '3.7' -cryptography==42.0.7 ; python_version >= '3.7' +cryptography==42.0.8 ; python_version >= '3.7' dill==0.3.6 ; python_version < '3.11' @@ -34,7 +34,7 @@ exceptiongroup==1.1.1 ; python_version < '3.11' idna==3.7 ; python_version >= '3.5' -importlib-metadata==6.8.0 ; python_version >= '3.7' +importlib-metadata==7.1.0 ; python_version >= '3.7' iniconfig==2.0.0 ; python_version >= '3.7' @@ -50,7 +50,7 @@ mccabe==0.7.0 ; python_version >= '3.6' mock==5.1.0 ; python_version >= '3.6' -msal==1.28.0 +msal==1.28.1 msal-extensions==1.1.0 @@ -60,7 +60,7 @@ mypy-extensions==1.0.0 ; python_version >= '3.5' outcome==1.3.0.post0 ; python_version >= '3.7' -packaging==24.0 ; python_version >= '3.7' +packaging==24.1 ; python_version >= '3.7' pathlib2==2.3.7.post1 @@ -74,13 +74,13 @@ pycparser==2.22 pyjwt[crypto]==2.8.0 ; python_version >= '3.7' -pylint==3.2.2 +pylint==3.2.3 pyproject-hooks==1.1.0 ; python_version >= '3.7' -pytest==8.2.1 +pytest==8.2.2 -pytest-cov==4.1.0 +pytest-cov==5.0.0 pytest-mock==3.14.0 @@ -92,7 +92,7 @@ pywin32==306 ; platform_system == 'Windows' requests==2.32.3 ; python_version >= '3.7' -setuptools==69.5.1 +setuptools==70.0.0 six==1.16.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' @@ -111,15 +111,15 @@ trio==0.25.1 types-python-dateutil==2.9.0.20240316 types-requests==2.32.0.20240602; python_version >= '3.7' -urllib3==2.2.1 ; python_version >= '3.7' -typing-extensions==4.12.1 ; python_version >= '3.7' +urllib3==2.2.2 ; python_version >= '3.7' +typing-extensions==4.12.2 ; python_version >= '3.7' wrapt==1.15.0 ; python_version < '3.11' yapf==0.40.2 -zipp==3.19.1 ; python_version >= '3.7' +zipp==3.19.2 ; python_version >= '3.7' aiohttp==3.9.5 ; python_version >= '3.6' diff --git a/src/msgraph_core/tasks/page_iterator.py b/src/msgraph_core/tasks/page_iterator.py index 0b2571e8..c9b729db 100644 --- a/src/msgraph_core/tasks/page_iterator.py +++ b/src/msgraph_core/tasks/page_iterator.py @@ -67,6 +67,10 @@ def __init__( parsable_factory = type(response) elif constructor_callable is None: parsable_factory = PageResult + else: + raise ValueError( + 'One of the constructor_callable or the PageResult type parameter is required.' + ) self.parsable_factory = parsable_factory self.pause_index = 0 self.headers: HeadersCollection = HeadersCollection() @@ -141,7 +145,6 @@ async def next(self) -> Optional[PageResult]: if self.current_page is not None and not self.current_page.odata_next_link: return None response = await self.fetch_next_page() - print(f"Response - {type(response)}") page: PageResult = PageResult(response.odata_next_link, response.value) # type: ignore return page