Skip to content

[sonic-config-engine] Pin 'importlib-resources' package to v3.3.1 for Python 2#6288

Merged
lguohan merged 1 commit intosonic-net:masterfrom
jleveque:pin_py2_importlib-resources
Dec 24, 2020
Merged

[sonic-config-engine] Pin 'importlib-resources' package to v3.3.1 for Python 2#6288
lguohan merged 1 commit intosonic-net:masterfrom
jleveque:pin_py2_importlib-resources

Conversation

@jleveque
Copy link
Copy Markdown
Contributor

@jleveque jleveque commented Dec 24, 2020

- Why I did it

importlib-resources v4.0.0 was released today (2020-12-23) and drops support for Python 2. This caused the sonic-config-engine Python 2 wheel build to fail.

Reference: https://pypi.org/project/importlib-resources/

Example failure:

16:23:36    File "/sonic/src/sonic-config-engine/tests/../sonic-cfggen", line 33, in <module>
16:23:36      import netaddr
16:23:36    File "/sonic/src/sonic-config-engine/.eggs/netaddr-0.8.0-py2.7.egg/netaddr/__init__.py", line 18, in <module>
16:23:36      from netaddr.core import (AddrConversionError, AddrFormatError,
16:23:36    File "/sonic/src/sonic-config-engine/.eggs/netaddr-0.8.0-py2.7.egg/netaddr/core.py", line 11, in <module>
16:23:36      from netaddr.compat import _callable, _iter_dict_keys
16:23:36    File "/sonic/src/sonic-config-engine/.eggs/netaddr-0.8.0-py2.7.egg/netaddr/compat.py", line 93, in <module>
16:23:36      import importlib_resources as _importlib_resources
16:23:36    File "/sonic/src/sonic-config-engine/.eggs/importlib_resources-4.0.0-py2.7.egg/importlib_resources/__init__.py", line 3, in <module>
16:23:36      from ._common import (
16:23:36    File "/sonic/src/sonic-config-engine/.eggs/importlib_resources-4.0.0-py2.7.egg/importlib_resources/_common.py", line 6, in <module>
16:23:36      from pathlib import Path
16:23:36  ImportError: No module named pathlib
16:23:36  ERROR

- How I did it

  • Pin 'importlib-resources' package to v3.3.1 for Python 2
  • Unrelated: remove pinned version of zipp for sonic-bgpcfgd because we no longer build a Python 2 version of that package.

- How to verify it

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@jleveque jleveque self-assigned this Dec 24, 2020
@lguohan lguohan merged commit e39cc01 into sonic-net:master Dec 24, 2020
@jleveque jleveque deleted the pin_py2_importlib-resources branch December 24, 2020 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants