Skip to content

Commit b4316f5

Browse files
authored
Merge pull request #430 from microsoftgraph/chore/update-workflows
Chore/update workflows
2 parents 40be454 + a0fee87 commit b4316f5

File tree

5 files changed

+46
-10
lines changed

5 files changed

+46
-10
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
max-parallel: 4
1717
matrix:
18-
python-version: ["3.8", "3.9", "3.10", "3.11"]
18+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1919

2020
steps:
2121
- uses: actions/checkout@v4
@@ -29,10 +29,13 @@ jobs:
2929
pip install -r requirements-dev.txt
3030
- name: Check code format
3131
run: |
32-
yapf -dr .
32+
yapf -dr src
3333
- name: Check import order
3434
run: |
35-
isort .
35+
isort src
36+
- name: Static type checking with Mypy
37+
run: |
38+
mypy src
3639
- name: Lint with Pylint
3740
run: |
3841
pylint src --disable=W --rcfile=.pylintrc

.github/workflows/publish.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
name: Publish package
1+
name: Publish package to PyPI
22

33
on:
4-
push:
5-
branches: [kiota/long-term-branch]
4+
release:
5+
types:
6+
- published
67

78
jobs:
89
build:

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Create a release
2+
3+
on:
4+
push:
5+
branches: [kiota/long-term-branch]
6+
tags:
7+
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
8+
9+
jobs:
10+
autorelease:
11+
name: Create release
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- name: Set up Python 3.8
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: 3.11
22+
- name: Release Notes
23+
run: |
24+
git log $(git describe HEAD~ --tags --abbrev=0)..HEAD --pretty='format:* %h %s%n' --no-merges >> ".github/RELEASE-TEMPLATE.md"
25+
- name: Create Release Draft
26+
uses: softprops/action-gh-release@v1
27+
if: github.repository == 'microsoftgraph/msgraph-sdk-python-core' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
28+
with:
29+
body_path: ".github/RELEASE-TEMPLATE.md"
30+
draft: true
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

src/msgraph_core/graph_client_factory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def create_with_default_middleware(
4444
Returns:
4545
httpx.AsyncClient: An instance of the AsyncClient object
4646
"""
47-
client.base_url = GraphClientFactory._get_base_url(host, api_version)
47+
client.base_url = GraphClientFactory._get_base_url(host, api_version) # type: ignore
4848
middleware = KiotaClientFactory.get_default_middleware(options)
4949
telemetry_handler = GraphClientFactory._get_telemetry_handler(options)
5050
middleware.append(telemetry_handler)
@@ -70,7 +70,7 @@ def create_with_custom_middleware(
7070
host (NationalClouds): The national clound endpoint to be used.
7171
Defaults to NationalClouds.Global.
7272
"""
73-
client.base_url = GraphClientFactory._get_base_url(host, api_version)
73+
client.base_url = GraphClientFactory._get_base_url(host, api_version) # type: ignore
7474
return GraphClientFactory._load_middleware_to_client(client, middleware)
7575

7676
@staticmethod

src/msgraph_core/middleware/options/graph_telemetry_handler_option.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def api_version(self):
3232
return self._api_version
3333

3434
@api_version.setter
35-
def api_version(self, value: bool):
35+
def api_version(self, value: APIVersion):
3636
self._api_version = value
3737

3838
@property
@@ -41,7 +41,7 @@ def sdk_version(self):
4141
return self._sdk_version
4242

4343
@sdk_version.setter
44-
def sdk_version(self, value: List[str]):
44+
def sdk_version(self, value: str):
4545
self._sdk_version = value
4646

4747
@staticmethod

0 commit comments

Comments
 (0)