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

*: python3 support #459

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ishidawataru
Copy link
Contributor

Signed-off-by: Wataru Ishida ishida@nel-america.com

- What I did

Support install sonic-utilities python package with python3

- How I did it

  • fix invalid syntax in python3
  • use click.echo() instead of print

- How to verify it

$ python3 setup.py install

- Previous command output (if the output of a command-line utility has changed)

- New command output (if the output of a command-line utility has changed)

-->

Signed-off-by: Wataru Ishida <ishida@nel-america.com>
@ishidawataru
Copy link
Contributor Author

EOL of Python 2.7 is 2020.

Are there any blocking items to use Python3 in sonic-utilities?

Copy link
Contributor

@jleveque jleveque left a comment

Choose a reason for hiding this comment

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

Thanks for this effort!

However, you will also need to make sure all files under the scripts/ directory are also Python 3-compliant. Most if not all of these scripts do not import Click. For these files, you can replace print statements with the print() function and add the following import: from __future__ import print_function. I'm sure there are also other incompatibilities beyond the print statement, as well. This change will need to be tested thoroughly.

@lguohan
Copy link
Contributor

lguohan commented Feb 15, 2019

retest this please

@ishidawataru
Copy link
Contributor Author

@jleveque Thanks for your comment. I can take a look into scripts/ directory too.

This change will need to be tested thoroughly.

Any suggestion on how to add Python3 testing in the CI?
Where can I find the Jenkins scripts (e.g. build_sonic_utilities.sh ) which are used for the CI?

@jleveque
Copy link
Contributor

@ishidawataru: If you look at the Jenkins job configuration again, you will see the build_sonic_utilities.sh script is generated there using cat <<EOF > build_sonic_utilities.sh.

Unfortunately, we do not currently have a test suite for sonic_utilities. This is needed, and has been backlogged. If you would like to help design a testing framework, it would be appreciated!

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.

None yet

4 participants