Skip to main content

The Ascend.io SDK for Python

Project description

Ascend SDK

This folder contains the customer-buildable ascend-io-sdk Python package. The SDK package now builds with uv and no longer requires Bazel, Ascend-owned GCP credentials, or the Ascend remote Bazel cache for packaging.

Package

  • Distribution name: ascend-io-sdk
  • Import package: ascend.sdk
  • Build tool: uv
  • Package source: source/ascend/sdk/src

The src/ tree contains the SDK Python sources plus the generated protobuf, OpenAPI, and protoc_gen_swagger Python artifacts that were historically produced by Bazel during packaging. These generated artifacts are checked in so customers can build the SDK package cleanly in their own environment.

Build

From this folder:

cd source/ascend/sdk
uv build

This creates source and wheel distributions in source/ascend/sdk/dist/:

source/ascend/sdk/dist/ascend_io_sdk-<version>-py3-none-any.whl
source/ascend/sdk/dist/ascend_io_sdk-<version>.tar.gz

Local Install From Wheels

cd source/ascend/sdk
uv build

uv venv /tmp/ascend-sdk-venv
source /tmp/ascend-sdk-venv/bin/activate
uv pip install dist/ascend_io_sdk-*.whl

python - <<'PY'
from ascend.sdk.client import Client
print(Client)
PY

If your shell has PYTHONPATH pointing at another Ascend source checkout, unset it before testing an installed wheel:

unset PYTHONPATH

Run Directly With UV

You can run the SDK directly from this folder without manually creating or activating a virtual environment:

cd source/ascend/sdk
uv run python

If your shell exports PYTHONPATH for another Ascend checkout, remove it for the command so Python imports this package instead of the other checkout:

cd source/ascend/sdk
env -u PYTHONPATH uv run python

Quick import check:

cd source/ascend/sdk
env -u PYTHONPATH uv run python - <<'PY'
from ascend.sdk.client import Client
print(Client)
PY

Test Locally With UV

Use uv run for quick source-tree checks without manually creating a virtual environment:

cd source/ascend/sdk
env -u PYTHONPATH uv run python - <<'PY'
from ascend.sdk.client import Client
from ascend.sdk import definitions
from ascend.protos.api import api_pb2

print(Client.__name__)
print(definitions.DataService.__name__)
print(api_pb2.__name__)
PY

To test the built wheel instead of the editable source tree:

cd source/ascend/sdk
env -u PYTHONPATH uv build

SDK_WHEEL="$(ls dist/ascend_io_sdk-*-py3-none-any.whl)"

env -u PYTHONPATH uv run \
  --no-project \
  --with "$SDK_WHEEL" \
  python - <<'PY'
from ascend.sdk.client import Client
print(Client)
PY

If you want to test against an Ascend environment, make sure your Ascend API credentials are configured and pass the hostname to the client:

cd source/ascend/sdk
env -u PYTHONPATH uv run python - <<'PY'
from ascend.sdk.client import Client

client = Client(hostname="your-instance.ascend.io")
for data_service in client.list_data_services().data:
  print(data_service.id)
PY

Publish to a Private PyPI Repository

Customers can publish this package to their own private package repository and install it from there.

cd source/ascend/sdk
uv build

export UV_PUBLISH_URL="https://pypi.customer.example/legacy/"
export UV_PUBLISH_USERNAME="__token__"
export UV_PUBLISH_PASSWORD="<private-pypi-token>"

uv publish dist/*

Install from the private index with:

uv venv /tmp/ascend-sdk-venv
source /tmp/ascend-sdk-venv/bin/activate
uv pip install --index-url https://pypi.customer.example/simple/ ascend-io-sdk

If the private index does not mirror public PyPI, add a second index or publish the SDK's third-party dependencies into the private repository.

Updating Generated Artifacts

The package intentionally avoids Bazel for customer builds. If protobuf or OpenAPI definitions change, regenerate the Python artifacts using the historical internal Bazel pipeline, then refresh source/ascend/sdk/src with the generated package contents before publishing a new SDK wheel.

For the current handoff, source/ascend/sdk/src is the buildable source of truth for the SDK package.

Integration Tests

The existing integration tests under source/ascend/sdk/test are retained for reference and require a live Ascend environment. They are not part of the packaging build.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ascend_io_sdk-0.2.66.tar.gz (320.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ascend_io_sdk-0.2.66-py3-none-any.whl (341.5 kB view details)

Uploaded Python 3

File details

Details for the file ascend_io_sdk-0.2.66.tar.gz.

File metadata

  • Download URL: ascend_io_sdk-0.2.66.tar.gz
  • Upload date:
  • Size: 320.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for ascend_io_sdk-0.2.66.tar.gz
Algorithm Hash digest
SHA256 51da6c52683a62bcbc9a0a56951555e29b0cf51acac9953c3b164cfd482ff4b5
MD5 1cd6fd690cea8d7ac55abde58d3dbd5c
BLAKE2b-256 39cdba11760be9d6821fec790786bb183bf1f063b57e07227b55ed8027096c25

See more details on using hashes here.

File details

Details for the file ascend_io_sdk-0.2.66-py3-none-any.whl.

File metadata

File hashes

Hashes for ascend_io_sdk-0.2.66-py3-none-any.whl
Algorithm Hash digest
SHA256 30cc658ab1bf67676fef6657bf15210a25ff00e792465fa6f0f8e6e8fe626d62
MD5 a0e3cb20656b0c09ea13fb6fd784ff9a
BLAKE2b-256 8d0cd9f62c86c4659678c46a937fa13977634b5034c167826678104919f0aac2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page