or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

index.md
tile.json

tessl/pypi-azure-nspkg

Microsoft Azure namespace package for Python 2.7 that enables namespace package functionality for Azure SDK components.

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/azure-nspkg@3.0.x

To install, run

npx @tessl/cli install tessl/pypi-azure-nspkg@3.0.0

index.mddocs/

Azure NSPKG

Microsoft Azure namespace package for Python 2.7 that provides namespace package functionality for Azure SDK components. This is an internal infrastructure package that enables other Azure SDK packages to extend the azure namespace using Python's pkgutil.extend_path mechanism.

Package Information

  • Package Name: azure-nspkg
  • Package Type: pypi
  • Language: Python
  • Installation: pip install azure-nspkg
  • Python Compatibility: Python 2.7 only (Python 3+ uses PEP420 namespace packages)

Core Imports

import azure

Basic Usage

The azure-nspkg package is not intended for direct usage by end users. It serves as infrastructure for other Azure SDK packages to extend the azure namespace. When installed, it allows packages like azure-storage, azure-keyvault, etc. to be imported as submodules of the azure namespace.

# After installing azure-nspkg and other Azure packages:
# from azure.storage import BlobService  # (if azure-storage is installed)
# from azure.keyvault import KeyVaultClient  # (if azure-keyvault is installed)

Architecture

The package uses Python's namespace package mechanism:

  • Namespace Extension: Uses pkgutil.extend_path(__path__, __name__) to enable namespace package functionality
  • Conditional Installation: Only installs the azure package on Python 2.7; Python 3+ relies on PEP420 implicit namespace packages
  • Compatibility Protection: Prevents installation alongside incompatible azure v0.x packages that used different namespace mechanisms

Capabilities

Namespace Package Extension

Provides the foundational namespace package functionality that allows multiple Azure SDK packages to coexist under the azure namespace.

# azure/__init__.py content:
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

Version Compatibility Checking

The setup process includes compatibility validation to prevent conflicts with older azure packages that used incompatible namespace mechanisms.

# Compatibility check logic (from setup.py):
try:
    import azure
    try:
        ver = azure.__version__  # Only exists in incompatible v0.x
        raise Exception(
            'This package is incompatible with azure=={}. '.format(ver) +
            'Uninstall it with "pip uninstall azure".'
        )
    except AttributeError:
        pass  # Compatible, no __version__ attribute
except ImportError:
    pass  # No existing azure package, safe to install

Installation Behavior

Python 2.7

  • Installs the azure namespace package module
  • Enables namespace functionality for other Azure SDK packages
  • Provides backward compatibility with existing Python 2.7 code

Python 3.x

  • Installs an empty package to satisfy dependencies
  • Does not provide actual namespace functionality (relies on PEP420)
  • Prevents package server compatibility issues with python_requires

Package Metadata

# Package configuration:
name = 'azure-nspkg'
version = '3.0.2'
description = 'Microsoft Azure Namespace Package [Internal]'
author = 'Microsoft Corporation'
license = 'MIT License'
zip_safe = False
packages = ['azure']  # Python 2.7 only, empty list for Python 3.x

Dependencies

  • Runtime Dependencies: None (uses only Python standard library)
  • Build Dependencies: setuptools

Notes

  • This package is intended for internal use by the Azure SDK ecosystem
  • Not designed for direct end-user consumption
  • Essential for Azure SDK packages to work together on Python 2.7
  • Python 3.x installations use this package only to satisfy dependency requirements