Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[barefoot][platform] platform API 2.0 fixes #6607

Merged
merged 1 commit into from
Jan 30, 2021

Conversation

vboykox
Copy link
Member

@vboykox vboykox commented Jan 29, 2021

Signed-off-by: Volodymyr Boyko volodymyrx.boiko@intel.com

- Why I did it
To improve python3 support of berefoot's sonic_platform
- How I did it

- How to verify it

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

  • 201811
  • 201911
  • 202006
  • 202012

- Description for the changelog

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

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
@vboykox
Copy link
Member Author

vboykox commented Jan 29, 2021

@jleveque

Comment on lines +67 to +70
try:
_str_type = basestring
except NameError:
_str_type = str
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All applications which import sonic-platform should now use the Python 3 API if it is available (as of a couple weeks ago). Therefore, you should be able stop building/installing a Python 2 sonic-platform package and you could then remove this check, as the string type will always be str with Python 3.

If you'd prefer to keep this for now and leave the remove of removal of Python 2 support for a separate PR, that's OK. Just let me know.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I will prepare a separate PR for this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing. I just wanted to prevent you from adding code if not necessary. We can merge this as-is and you can clean it up with the subsequent PR, once you're able to prove you no longer need to build/install a Python 2 package.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for info!

@jleveque jleveque merged commit 4818706 into sonic-net:master Jan 30, 2021
@vboykox
Copy link
Member Author

vboykox commented Feb 3, 2021

@jleveque please backport to 202012

lguohan pushed a commit that referenced this pull request Feb 3, 2021
To improve python3 support of berefoot's sonic_platform

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
deran1980 pushed a commit to deran1980/sonic-buildimage that referenced this pull request Feb 4, 2021
To improve python3 support of berefoot's sonic_platform

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants