CP-6007 Futurize vSDK - Stage 2
CP-6009 Add to_str and to_byte helpers
CP-6010 Add Github Action(s) to run vSDK unit tests in py3
CP-6250 Remove tools from py2.7 unit tests in github actions
Context:
This diff introduces Python3.8 support for the Delphix vSDK.
What does this mean for plugin authors?
The Delphix Engine will continue to accept Python2.7-based plugin uploads.
The Delphix Engine will also accept Python3.8-based plugin uploads
dvp may only be installed and used with Python 3.8
What exactly is in this diff?
futurize --stage2 was run and I then manually cleaned up some of its changes. For example it wraps any instance of <dict object>.[keys|values|items]() with list(), which is not always necessary and should in some situations have the potential to be slower (though in truth it shouldn't be a significant slowdown for our use cases)
We've added common to_bytes and to_str functions which work with python 2 and 3 and handles a number of data types.
These helpers are used throughout the SDK to ensure data is converted properly just after entering and before leaving the program.
Updated our pre-commit actions to run the following 4 jobs against the same matrix of platforms
Python 2.7 unit tests
Packages: common, libs, platform
Python 3.8 unit tests
Packages: common, libs, platform, tools
Python 2.7 linting
Packages: common, libs, platform
Python 3.8 linting
Packages: common, libs, platform, tools
Note: I kept both 2.7 and 3.8 linting with the thought that it could help us catch code that is not both py2 and py3 compatible, when it should be
Note: common, libs, and platform were not being linted prior to this diff, so there are a handful of simple formatting fixes throughout the diff as well.
Fixed a lot of unit tests to account for moderate changes in many messages/exceptions that come with the switch to python3. When we eventually deprecate py2 support we can simply go through and remove all the if six.PY2: ... else: lines from the relevant test files.
Updated dvp/setup.cfg to require Python 3.8
Testing
qa-gate and qa-toolkits changes must be made before we can automate py3 plugin testing. These changes are in progress. However py2 still looks good, and manual testing with py3 looks good so far as well.
Testing with new PY38 qa-appdata-toolkits plugins looks good. Continuing on automation.
CP-6007 Futurize vSDK - Stage 2 CP-6009 Add to_str and to_byte helpers CP-6010 Add Github Action(s) to run vSDK unit tests in py3 CP-6250 Remove
tools
from py2.7 unit tests in github actionsContext:
This diff introduces Python3.8 support for the Delphix vSDK.
What does this mean for plugin authors?
dvp
may only be installed and used with Python 3.8What exactly is in this diff?
futurize --stage2
was run and I then manually cleaned up some of its changes. For example it wraps any instance of<dict object>.[keys|values|items]()
withlist()
, which is not always necessary and should in some situations have the potential to be slower (though in truth it shouldn't be a significant slowdown for our use cases)to_bytes
andto_str
functions which work with python 2 and 3 and handles a number of data types.common
,libs
,platform
common
,libs
,platform
,tools
common
,libs
,platform
common
,libs
,platform
,tools
common
,libs
, andplatform
were not being linted prior to this diff, so there are a handful of simple formatting fixes throughout the diff as well.if six.PY2: ... else:
lines from the relevant test files.dvp/setup.cfg
to require Python 3.8Testing
qa-gate and qa-toolkits changes must be made before we can automate py3 plugin testing. These changes are in progress. However py2 still looks good, and manual testing with py3 looks good so far as well.
Testing with new PY38 qa-appdata-toolkits plugins looks good. Continuing on automation.
All the pre-commit actions have passed.