Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
05a19c3
mvp
Mar 3, 2026
670eede
requests
Mar 3, 2026
e1aa6e2
typo
Mar 3, 2026
73a12c5
openai
Mar 3, 2026
54ae205
runnable from whl
Mar 3, 2026
7f655a5
Readme
Mar 3, 2026
070a5ce
winml working
Mar 3, 2026
5514a33
naming
Mar 3, 2026
d30ba9b
macos bug fix
Mar 4, 2026
2a409e4
flc mac version
Mar 4, 2026
418c951
copilot feedback
Mar 4, 2026
fdcd592
more copilot feedback
Mar 4, 2026
9aeaab7
even more copilot feedback
Mar 5, 2026
86131ff
an insane amount of copilot feedback
Mar 5, 2026
91c9c86
pull from pypi working
Mar 12, 2026
96f1079
winml
Mar 17, 2026
75bbe96
pipeline fixes
Mar 17, 2026
b6a8ed6
specific whl file
Mar 17, 2026
73bfd4f
Merge remote-tracking branch 'origin' into prathikrao/python-sdk-v2
Mar 17, 2026
c6ce9fd
config set
Mar 17, 2026
f9ae4ce
no extra
Mar 17, 2026
eded26f
loosen reqs
Mar 17, 2026
8c67f55
add back verions
Mar 17, 2026
728e54a
auth
Mar 17, 2026
a665645
pat
Mar 17, 2026
2d50d07
no pat
Mar 17, 2026
b37d902
pat pat
Mar 17, 2026
1472a71
only ort-nightly
Mar 17, 2026
0cd68b9
pre
Mar 17, 2026
f9d1ec1
try exact match
Mar 17, 2026
25b0546
0.0.0
Mar 17, 2026
bde6fdf
upgrade pip
Mar 17, 2026
32cc087
add back pre
Mar 17, 2026
4bea569
loose
Mar 17, 2026
867975a
pre in reqs
Mar 17, 2026
360f378
pre --pre
Mar 17, 2026
9c90292
revert
Mar 17, 2026
b6ef740
set global pre
Mar 17, 2026
a671bf0
Merge remote-tracking branch 'origin' into prathikrao/python-sdk-v2
Mar 18, 2026
9d5f29a
pypi fallback
Mar 18, 2026
3d9d65d
final pipeline fixes
Mar 18, 2026
1a7f689
macos bug fix
Mar 18, 2026
87ae166
more mac changes
Mar 18, 2026
74f3ffb
Merge remote-tracking branch 'origin' into prathikrao/python-sdk-v2
Mar 18, 2026
072b34a
Revert "more mac changes"
Mar 18, 2026
5211334
pipeline fix
Mar 18, 2026
b46e7f3
secrets inherit
Mar 18, 2026
4641562
mac fixes
Mar 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions .github/workflows/build-python-steps.yml
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_v2/python
run: echo '__version__ = "${{ inputs.version }}"' > src/version.py

- name: Build wheel (Cross-Platform)
if: ${{ inputs.useWinML == false }}
working-directory: sdk_v2/python
run: python -m build --wheel --outdir dist/

- name: Build wheel (WinML)
if: ${{ inputs.useWinML == true }}
working-directory: sdk_v2/python
run: python -m build --wheel -C winml=true --outdir dist/

- name: Install built wheel
working-directory: sdk_v2/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_v2/python
run: python -m pytest test/ -v

- name: Upload Python packages
uses: actions/upload-artifact@v4
with:
name: foundry-local-sdk${{ inputs.useWinML == true && '-winml' || '' }}
path: sdk_v2/python/dist/*

- name: Upload flcore logs
uses: actions/upload-artifact@v4
if: always()
with:
name: foundry-local-core${{ inputs.useWinML == true && '-winml' || '' }}-logs
path: sdk_v2/python/logs/**
21 changes: 20 additions & 1 deletion .github/workflows/foundry-local-sdk-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ jobs:
version: '0.9.0.${{ github.run_number }}'
platform: 'windows'
secrets: inherit
build-python-windows:
uses: ./.github/workflows/build-python-steps.yml
with:
version: '0.9.0.${{ github.run_number }}'
platform: 'windows'
secrets: inherit
build-rust-windows:
uses: ./.github/workflows/build-rust-steps.yml
with:
Expand All @@ -50,6 +56,13 @@ jobs:
platform: 'windows'
useWinML: true
secrets: inherit
build-python-windows-WinML:
uses: ./.github/workflows/build-python-steps.yml
with:
version: '0.9.0.${{ github.run_number }}'
platform: 'windows'
useWinML: true
secrets: inherit
build-rust-windows-WinML:
uses: ./.github/workflows/build-rust-steps.yml
with:
Expand All @@ -70,9 +83,15 @@ jobs:
version: '0.9.0.${{ github.run_number }}'
platform: 'macos'
secrets: inherit
build-python-macos:
uses: ./.github/workflows/build-python-steps.yml
with:
version: '0.9.0.${{ github.run_number }}'
platform: 'macos'
secrets: inherit
build-rust-macos:
uses: ./.github/workflows/build-rust-steps.yml
with:
platform: 'macos'
run-integration-tests: true
secrets: inherit
secrets: inherit
20 changes: 20 additions & 0 deletions sdk_v2/python/.gitignore
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/
21 changes: 21 additions & 0 deletions sdk_v2/python/LICENSE.txt
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.
Loading
Loading