-
Notifications
You must be signed in to change notification settings - Fork 272
implements python sdk #533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
prathikr
wants to merge
36
commits into
main
Choose a base branch
from
prathikrao/implement-python-sdk
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,845
−0
Open
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
47eadfd
impl
54c78b8
fix sdk reference in pipeline
0e60249
audio exception fix
86e26dd
copilot feedback
prathikr 236ec0e
copilot feedback
prathikr 29ea72b
copilot feedback
prathikr b930b6b
copilot feedback
714584f
copilot feedback
prathikr 17f3ffe
copilot feedback
prathikr ac0690d
copilot feedback
a4e9966
copilot feedback
prathikr 4d60c35
copilot feedback
prathikr d40b67a
copilot feedback
prathikr fbade09
Merge branch 'prathikrao/implement-python-sdk' of https://github.com/…
3dbf232
copilot feedback
c1e16cc
valueerror error
5b80fde
copilot feedback
prathikr b82a217
copilot feedback
prathikr edf6625
copilot feedback
prathikr 0349170
copilot feedback
prathikr 55d7be3
copilot feedback
prathikr 2f15b06
tool calling
4ec9daa
Merge branch 'prathikrao/implement-python-sdk' of https://github.com/…
cb2b759
ort-core
a9f8bbd
Merge remote-tracking branch 'origin' into prathikrao/implement-pytho…
783b2d0
copilot feedback
prathikr d61ca82
copilot feedback
prathikr 2f5af8e
copilot feedback
prathikr f7e55c5
cleanup
bd16140
copilot feedback
prathikr 3653079
cleanup cleanup
c65b79c
copilot feedback
prathikr 4639543
copilot feedback
89ed3c7
copilot feedback
prathikr 384887b
copilot feedback
prathikr ef014b4
python naming
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| name: Build Python SDK | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| version: | ||
| required: true | ||
| type: string | ||
| useWinML: | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| platform: | ||
| required: false | ||
| type: string | ||
| default: 'windows' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ${{ inputs.platform }}-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| clean: true | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| # Clone test-data-shared from Azure DevOps (models for integration tests) | ||
| - name: Checkout test-data-shared from Azure DevOps | ||
| shell: pwsh | ||
| working-directory: ${{ github.workspace }}/.. | ||
| run: | | ||
| $pat = "${{ secrets.AZURE_DEVOPS_PAT }}" | ||
| $encodedPat = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$pat")) | ||
|
|
||
| git config --global http.https://dev.azure.com.extraheader "AUTHORIZATION: Basic $encodedPat" | ||
|
|
||
| git lfs install | ||
| git clone --depth 1 https://dev.azure.com/microsoft/windows.ai.toolkit/_git/test-data-shared test-data-shared | ||
|
|
||
| Write-Host "Clone completed successfully to ${{ github.workspace }}/../test-data-shared" | ||
|
|
||
| - name: Checkout specific commit in test-data-shared | ||
| shell: pwsh | ||
| working-directory: ${{ github.workspace }}/../test-data-shared | ||
| run: | | ||
| git checkout 231f820fe285145b7ea4a449b112c1228ce66a41 | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Error "Git checkout failed." | ||
| exit 1 | ||
| } | ||
|
|
||
| - name: Install build tool | ||
| run: | | ||
| python -m pip install build | ||
|
|
||
| - name: Configure pip for Azure Artifacts | ||
| run: | | ||
| pip config set global.index-url https://pkgs.dev.azure.com/aiinfra/PublicPackages/_packaging/ORT-Nightly/pypi/simple/ | ||
| pip config set global.extra-index-url https://pypi.org/simple/ | ||
| pip config set global.pre true | ||
|
|
||
| - name: Set package version | ||
| working-directory: sdk/python | ||
| run: echo '__version__ = "${{ inputs.version }}"' > src/version.py | ||
|
|
||
| - name: Build wheel (Cross-Platform) | ||
| if: ${{ inputs.useWinML == false }} | ||
| working-directory: sdk/python | ||
| run: python -m build --wheel --outdir dist/ | ||
|
|
||
| - name: Build wheel (WinML) | ||
| if: ${{ inputs.useWinML == true }} | ||
| working-directory: sdk/python | ||
| run: python -m build --wheel -C winml=true --outdir dist/ | ||
|
|
||
| - name: Install built wheel | ||
| working-directory: sdk/python | ||
| shell: pwsh | ||
| run: | | ||
| $wheel = (Get-ChildItem dist/*.whl | Select-Object -First 1).FullName | ||
| pip install $wheel | ||
|
|
||
| - name: Install test dependencies | ||
| run: pip install coverage pytest>=7.0.0 pytest-timeout>=2.1.0 | ||
|
|
||
| - name: Run tests | ||
| working-directory: sdk/python | ||
| run: python -m pytest test/ -v | ||
|
|
||
| - name: Upload Python packages | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: python-sdk-${{ inputs.platform }}${{ inputs.useWinML == true && '-winml' || '' }} | ||
| path: sdk/python/dist/* | ||
|
|
||
| - name: Upload flcore logs | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: python-sdk-${{ inputs.platform }}${{ inputs.useWinML == true && '-winml' || '' }}-logs | ||
| path: sdk/python/logs/** | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Native binaries downloaded from NuGet (per-platform) | ||
| packages/ | ||
|
|
||
| # Build / egg info | ||
| *.egg-info/ | ||
| dist/ | ||
| build/ | ||
| *.whl | ||
| *.tar.gz | ||
| __pycache__/ | ||
|
|
||
| # Logs | ||
| logs/ | ||
|
|
||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
|
|
||
| # pytest | ||
| .pytest_cache/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) Microsoft Corporation | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.