vsphere-automation-sdk-python icon indicating copy to clipboard operation
vsphere-automation-sdk-python copied to clipboard

Deprecation warnings from setuptools

Open sodul opened this issue 2 years ago • 3 comments

Describe the bug

vmware/vapi/vsphere/__init__.py:5
    /root/.pyenv/versions/3.11.2/lib/python3.11/site-packages/vmware/vapi/vsphere/__init__.py:5: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('vmware.vapi.vsphere')`.
    Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
      pkg_resources.declare_namespace(__name__)

Reproduction steps

  1. Install latest SDK: pip install --upgrade git+https://github.com/vmware/vsphere-automation-sdk-python.git
  2. Run code that uses the SDK.

Expected behavior

No warnings.

Additional context

No response

sodul avatar Feb 23 '23 01:02 sodul

Hi @sodul As of setuptools v67.3.0 the use of "pkg_resources.declare_namespace" method raises deprecation warning. Our Python SDK uses setuptools v62.0.0 as mentioned in requirements.txt We highly recommend following our installation guide - https://github.com/vmware/vsphere-automation-sdk-python#quick-start-guide

aagrawal3 avatar Mar 01 '23 07:03 aagrawal3

@aagrawal3 we have other dependencies that cannot install with setuptools v62.0.0. Our workaround is to install the sdk first and then our stack on top and ignore what the SDK claims in its requirements.

This is still a forward compatibility bug and I believe the SDK should be fixed to work with newer versions of setuptools.

sodul avatar Mar 22 '23 21:03 sodul

@aagrawal3 I have the same problem. Even I rollback my python to 3.6.x, it also tells me the setuptools have an error, and can't collect it from pip official site. When I manually download it to install, it tells me that "future feature annotations is not defined".

Xionghaizi001 avatar Mar 25 '23 01:03 Xionghaizi001