Microsoft Azure Resource Management Namespace Package providing namespace infrastructure for Azure SDK Python management libraries
npx @tessl/cli install tessl/pypi-azure-mgmt-nspkg@3.0.00
# Azure Management Namespace Package
1
2
Microsoft Azure Resource Management Namespace Package providing namespace infrastructure for Azure SDK Python management libraries. This package enables proper namespace organization for the `azure.mgmt` hierarchy, serving as an internal dependency that other Azure management packages extend.
3
4
## Package Information
5
6
- **Package Name**: azure-mgmt-nspkg
7
- **Language**: Python
8
- **Installation**: `pip install azure-mgmt-nspkg` (automatically installed as dependency)
9
- **Version**: 3.0.2
10
- **License**: MIT License
11
- **Dependencies**: azure-nspkg>=3.0.0
12
13
## Core Imports
14
15
This package provides namespace functionality that is automatically handled when installed:
16
17
```python
18
# The namespace extensions happen automatically when installed
19
# No direct imports are typically needed by users
20
```
21
22
For understanding the namespace structure:
23
24
```python
25
import azure.mgmt
26
# This namespace becomes available through this package
27
```
28
29
## Basic Usage
30
31
This package is not intended for direct use by end-users. It is automatically installed as a dependency of other Azure management packages and provides namespace infrastructure:
32
33
```python
34
# Example of how other Azure management packages use this namespace:
35
# When you install azure-mgmt-compute, azure-mgmt-storage, etc.,
36
# they extend the azure.mgmt namespace enabled by this package
37
38
from azure.mgmt.compute import ComputeManagementClient
39
from azure.mgmt.storage import StorageManagementClient
40
# The azure.mgmt namespace is provided by azure-mgmt-nspkg
41
```
42
43
## Architecture
44
45
This package implements Python namespace package functionality with version-specific behavior:
46
47
- **Python 2.7**: Uses traditional namespace packages with `pkgutil.extend_path` and installs the `azure.mgmt` package
48
- **Python 3.x**: Relies on PEP 420 implicit namespace packages with an empty package (no packages installed)
49
- **Compatibility**: Includes validation to prevent conflicts with legacy azure packages (versions < 1.0)
50
51
The namespace structure enables multiple Azure management libraries to coexist under the `azure.mgmt` hierarchy. The installation behavior differs by Python version to accommodate the different namespace mechanisms while maintaining compatibility.
52
53
## Capabilities
54
55
### Namespace Extension
56
57
Provides the foundational namespace infrastructure for the Azure management SDK ecosystem.
58
59
```python { .api }
60
# azure/__init__.py
61
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
62
63
# azure/mgmt/__init__.py
64
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
65
```
66
67
### Version-Specific Package Behavior
68
69
Adapts installation behavior based on Python version to ensure compatibility across Python 2.7 and Python 3.x environments. On Python 2.7, installs the `azure.mgmt` package; on Python 3.x, installs an empty package to avoid conflicts with PEP 420.
70
71
```python { .api }
72
# Setup configuration (from setup.py)
73
import sys
74
75
PACKAGES = []
76
if sys.version_info[0] < 3:
77
PACKAGES = ['azure.mgmt']
78
```
79
80
### Compatibility Validation
81
82
Automatically detects and prevents installation conflicts with incompatible legacy Azure packages (version < 1.0) that have a `__version__` attribute.
83
84
```python { .api }
85
# Compatibility check logic (from setup.py)
86
try:
87
import azure
88
try:
89
ver = azure.__version__
90
raise Exception(
91
'This package is incompatible with azure=={}. '.format(ver) +
92
'Uninstall it with "pip uninstall azure".'
93
)
94
except AttributeError:
95
pass # Compatible - newer versions don't have __version__
96
except ImportError:
97
pass # No azure package installed
98
```
99
100
## Important Notes
101
102
- **Internal Infrastructure**: This package is not intended for direct installation by end users
103
- **Automatic Dependency**: Installed automatically when other Azure management packages are installed
104
- **No Direct Functionality**: Provides no functions, classes, or constants for direct use - only namespace organization
105
106
## Installation Context
107
108
When you install Azure management packages, this namespace package is automatically included:
109
110
```bash
111
# These commands will automatically install azure-mgmt-nspkg as a dependency:
112
pip install azure-mgmt-compute
113
pip install azure-mgmt-storage
114
pip install azure-mgmt-network
115
116
# Direct installation (not recommended for end users):
117
pip install azure-mgmt-nspkg
118
```
119
120
## Error Handling
121
122
The package includes built-in compatibility validation that will raise an exception during installation if incompatible azure packages are detected:
123
124
- **Exception Type**: `Exception`
125
- **Trigger**: When azure package with `__version__` attribute (v0.x) is present
126
- **Resolution**: Uninstall the conflicting azure package before proceeding