Fix for backwards compatibility with old packaging
BREAKING CHANGES:
None.
FEATURES:
None.
FIXES:
- Prevent messing up azure namespace on upgrade in environments with other azure packages.
More Info:
Old Kusto (<0.0.25) packaging (as documented by azure-sdk-for-python) included azure/__init__.py
file which was the root of azure namespace and used pkg-resource to declare the namespace.
After installation, Kusto's dist-info/RECORD
included azure/__init__.py
which caused it to be deleted once you upgrade (as upgrade is essentially uninstall + install newer).
New setup excludes azure/__init__.py
from packaging, because we declare a dependency on azure-nspkg
which is the owner of the azure name space and is responsible for the site-packages dir.
Because azure-nspkg
is already installed, it's skipped, but the azure/__init__.py
file is deleted (because it was present in the old dist-info/RECORD
).
There is a setup.py
property called namespace_packages
which is meant to be used with pkg-resource
but, when specified, installing with it, prevents the removal of the namespace.