Skip to content

Commit b267243

Browse files
authored
CP-11806 Support Python 3.11 for Python Plugins in DVP (#537)
CP-11806 Support Python 3.11 for Python Plugins in DVP
1 parent 11da637 commit b267243

File tree

33 files changed

+369
-405
lines changed

33 files changed

+369
-405
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 4.1.0
2+
current_version = 5.0.0
33
commit = False
44
tag = False
55
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<dev>\d+))?

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ on:
1313
- release
1414

1515
jobs:
16-
pytest38:
17-
name: Test ${{ matrix.package }} on ${{ matrix.os }} using pytest (Python 3.8)
16+
pytest311:
17+
name: Test ${{ matrix.package }} on ${{ matrix.os }} using pytest (Python 3.11)
1818
runs-on: ${{ matrix.os }}
1919
strategy:
2020
max-parallel: 4
2121
matrix:
22-
python-version: [ 3.8 ]
22+
python-version: [ 3.11 ]
2323
os: [ ubuntu-latest, macos-latest, windows-latest ]
2424
package: [ common, libs, platform, tools ]
2525

.github/workflows/publish-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
strategy:
2222
matrix:
23-
python-version: [ 3.8 ]
23+
python-version: [ 3.11 ]
2424
package: [ docs ]
2525
repository: [ 'delphix/virtualization-sdk' ]
2626

.github/workflows/publish-python-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
max-parallel: 5
1919
matrix:
20-
python-version: [3.8]
20+
python-version: [3.11]
2121
package: [common, dvp, libs, platform, tools]
2222

2323
steps:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The latest user documentation can be found [here](https://developer.delphix.com)
1212
- macOS 10.14+, Ubuntu 16.04+, or Windows 10
1313
- Python 2.7 (vSDK 3.1.0 and earlier)
1414
- Python 3.8 (vSDK 4.0.0 and later)
15+
- Python 3.11 (vSDK 5.0.0 and later)
1516
- Java 7+
1617
- A Delphix Engine of an [appropriate version](/References/Version_Compatibility.md)
1718

common/setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ long_description_content_type: text/markdown
1212
classifiers:
1313
Development Status :: 5 - Production/Stable
1414
Programming Language :: Python
15-
Programming Language :: Python :: 3.8
15+
Programming Language :: Python :: 3.11
1616
License :: OSI Approved :: Apache Software License
1717
Operating System :: OS Independent
1818

1919
[options]
20-
requires_python: >=3.8, <3.9
20+
requires_python: >=3.11, <3.12

common/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
PYTHON_SRC = 'src/main/python'
55

66
install_requires = [
7-
"dvp-api == 1.8.0",
7+
"dvp-api == 2.0.0.dev0",
88
"six >= 1.16, < 1.17",
99
]
1010

@@ -16,5 +16,5 @@
1616
install_requires=install_requires,
1717
package_dir={'': PYTHON_SRC},
1818
packages=setuptools.find_packages(PYTHON_SRC),
19-
python_requires='>=3.8, <3.9',
19+
python_requires='>=3.11, <3.12',
2020
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.0
1+
5.0.0

docs/Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ markdown-include = "==0.8.1"
1010
mkdocs-awesome-pages-plugin = "==2.9.1"
1111

1212
[requires]
13-
python_version = "3.8"
13+
python_version = "3.11"
1414

1515
[dev-packages]

docs/Pipfile.lock

Lines changed: 320 additions & 360 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dvp/.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8.10
1+
3.11.9

dvp/setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ keywords: virtualization plugin
1414
classifiers:
1515
Development Status :: 5 - Production/Stable
1616
Programming Language :: Python
17-
Programming Language :: Python :: 3.8
17+
Programming Language :: Python :: 3.11
1818
License :: OSI Approved :: Apache Software License
1919
Operating System :: OS Independent
2020

2121
[options]
22-
requires_python: 3.8
22+
requires_python: >=3.11, <3.12

dvp/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
install_requires=install_requires,
1919
package_dir={'': PYTHON_SRC},
2020
packages=setuptools.find_packages(PYTHON_SRC),
21-
python_requires='>=3.8, <3.9',
21+
python_requires='>=3.11, <3.12',
2222
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.0
1+
5.0.0

libs/setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ long_description_content_type: text/markdown
1313
classifiers:
1414
Development Status :: 5 - Production/Stable
1515
Programming Language :: Python
16-
Programming Language :: Python :: 3.8
16+
Programming Language :: Python :: 3.11
1717
License :: OSI Approved :: Apache Software License
1818
Operating System :: OS Independent
1919

2020
[options]
21-
requires_python: >=3.8, <3.9
21+
requires_python: >=3.11, <3.12

libs/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
version = version_file.read().strip()
88

99
install_requires = [
10-
"dvp-api == 1.8.0",
10+
"dvp-api == 2.0.0.dev0",
1111
"dvp-common == {}".format(version),
1212
"six >= 1.16, < 1.17",
1313
]
@@ -17,5 +17,5 @@
1717
install_requires=install_requires,
1818
package_dir={'': PYTHON_SRC},
1919
packages=setuptools.find_packages(PYTHON_SRC),
20-
python_requires='>=3.8, <3.9',
20+
python_requires='>=3.11, <3.12',
2121
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.0
1+
5.0.0

platform/setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ long_description_content_type: text/markdown
1313
classifiers:
1414
Development Status :: 5 - Production/Stable
1515
Programming Language :: Python
16-
Programming Language :: Python :: 3.8
16+
Programming Language :: Python :: 3.11
1717
License :: OSI Approved :: Apache Software License
1818
Operating System :: OS Independent
1919

2020
[options]
21-
requires_python: >=3.8, <3.9
21+
requires_python: >=3.11, <3.12

platform/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
version = version_file.read().strip()
88

99
install_requires = [
10-
"dvp-api == 1.8.0",
10+
"dvp-api == 2.0.0.dev0",
1111
"dvp-common == {}".format(version),
1212
"six >= 1.16, < 1.17",
1313
]
@@ -17,5 +17,5 @@
1717
install_requires=install_requires,
1818
package_dir={'': PYTHON_SRC},
1919
packages=setuptools.find_packages(PYTHON_SRC),
20-
python_requires='>=3.8, <3.9',
20+
python_requires='>=3.11, <3.12',
2121
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.0
1+
5.0.0

platform/src/main/python/dlpx/virtualization/platform/import_validations.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ def _check_upgrade_args(upgrade_operations, expected_upgrade_args):
161161
# that we can iterate on.
162162
#
163163
for migration_func in attribute.values():
164-
actual = inspect.getargspec(migration_func).args
164+
if six.PY2:
165+
actual = inspect.getargspec(migration_func).args
166+
else:
167+
actual = inspect.getfullargspec(migration_func).args
165168
expected = expected_upgrade_args[attribute_name]
166169
warnings.extend(
167170
_check_args(method_name=migration_func.__name__,

tools/setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ long_description_content_type: text/markdown
1313
classifiers:
1414
Development Status :: 5 - Production/Stable
1515
Programming Language :: Python
16-
Programming Language :: Python :: 3.8
16+
Programming Language :: Python :: 3.11
1717
License :: OSI Approved :: Apache Software License
1818
Operating System :: OS Independent
1919

2020
[options]
2121
include_package_data = True
22-
requires_python: 3.8
22+
requires_python: >=3.11, <3.12
2323

2424
[options.entry_points]
2525
console_scripts =

tools/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@
3939
install_requires=install_requires,
4040
package_dir={'': PYTHON_SRC},
4141
packages=setuptools.find_packages(PYTHON_SRC),
42-
python_requires='>=3.8, <3.9',
42+
python_requires='>=3.11, <3.12',
4343
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.0
1+
5.0.0

tools/src/main/python/dlpx/virtualization/_internal/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ def delphix_sdk(verbose, quiet):
9595
# will be printed to the console until this is executed.
9696
#
9797
logging_util.add_console_handler(console_logging_level)
98-
if sys.version_info[:2] != (3, 8):
98+
if sys.version_info[:2] != (3, 11):
9999
raise exceptions.UserError(
100100
'Python version check failed.'
101-
'Supported versions are 2.7.x and 3.8.x, found {}'
101+
'Supported version is 3.11.x, found {}'
102102
.format(sys.version_info))
103103

104104

tools/src/main/python/dlpx/virtualization/_internal/commands/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def prepare_upload_artifact(plugin_config_content, src_dir, schemas, manifest):
221221
# set default value of locale to en-us
222222
'defaultLocale':
223223
plugin_config_content.get('defaultLocale', LOCALE_DEFAULT),
224-
# set default value of language to PYTHON38
224+
# set default value of language to PYTHON311
225225
'language':
226226
plugin_config_content['language'],
227227
'hostTypes':

tools/src/main/python/dlpx/virtualization/_internal/commands/initialize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def _get_default_plugin_config(plugin_id, ingestion_strategy, name,
237237
default_build_number = to_bytes(default_build_number)
238238
config = OrderedDict([('id', plugin_id),
239239
('name', name),
240-
('language', 'PYTHON38'), ('hostTypes', ['UNIX']),
240+
('language', 'PYTHON311'), ('hostTypes', ['UNIX']),
241241
('pluginType', ingestion_strategy),
242242
('entryPoint', entry_point),
243243
('srcDir', src_dir_path),

tools/src/main/python/dlpx/virtualization/_internal/plugin_validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def __validate_plugin_config_content(self):
131131
schemaFile: the file containing defined schemas in the plugin
132132
manualDiscovery whether or not manual discovery is supported
133133
pluginType whether the plugin is DIRECT or STAGED
134-
language language of the source code(ex: PYTHON38 for python3.8)
134+
language language of the source code(ex: PYTHON311 for python3.11)
135135
136136
Args:
137137
plugin_config_content (dict): A dictionary representing a plugin

tools/src/main/python/dlpx/virtualization/_internal/validation_schemas/plugin_config_schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
"language": {
4040
"type": "string",
41-
"enum": ["PYTHON38"]
41+
"enum": ["PYTHON311"]
4242
},
4343
"rootSquashEnabled": {
4444
"type": "boolean"

tools/src/test/python/dlpx/virtualization/_internal/commands/test_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ def test_plugin_bad_language(mock_generate_python, plugin_config_file,
554554
build.build(plugin_config_file, artifact_file, False, False)
555555

556556
message = err_info.value.message
557-
assert "'BAD_LANGUAGE' is not one of ['PYTHON38']" in message
557+
assert "'BAD_LANGUAGE' is not one of ['PYTHON311']" in message
558558

559559
assert not mock_generate_python.called
560560

tools/src/test/python/dlpx/virtualization/_internal/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def external_version():
254254

255255
@pytest.fixture
256256
def language():
257-
return 'PYTHON38'
257+
return 'PYTHON311'
258258

259259

260260
@pytest.fixture
@@ -663,7 +663,7 @@ def artifact_content(engine_api, virtual_source_definition,
663663
'name': 'python_vfiles',
664664
'externalVersion': '2.0.0',
665665
'defaultLocale': 'en-us',
666-
'language': 'PYTHON38',
666+
'language': 'PYTHON311',
667667
'hostTypes': ['UNIX'],
668668
'entryPoint': 'python_vfiles:vfiles',
669669
'buildApi': package_util.get_build_api_version(),

tools/src/test/python/dlpx/virtualization/_internal/test_package_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
from dlpx.virtualization._internal import package_util
99

10-
DVP_VERSION = '4.1.0'
11-
DVP_API_VERSION = '1.8.0'
10+
DVP_VERSION = '5.0.0'
11+
DVP_API_VERSION = '2.0.0'
1212

1313

1414
class TestPackageUtil:

tools/src/test/python/dlpx/virtualization/_internal/test_plugin_importer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def test_plugin_info_warn_mode(mock_import, mock_relative_path,
233233
plugin_module_content):
234234
plugin_config_content = OrderedDict([
235235
('id', str(uuid.uuid4())), ('name', 'staged'),
236-
('version', '0.1.0'), ('language', 'PYTHON38'),
236+
('version', '0.1.0'), ('language', 'PYTHON311'),
237237
('hostTypes', ['UNIX']), ('pluginType', 'STAGED'),
238238
('manualDiscovery', True),
239239
('entryPoint', 'staged_plugin:staged'),
@@ -287,7 +287,7 @@ def test_import_error(mock_file_util, plugin_config_file,
287287
@staticmethod
288288
@pytest.mark.parametrize(
289289
'entry_point,expected_error',
290-
[('bad_syntax:plugin', "SDK Error: invalid syntax")])
290+
[('bad_syntax:plugin', "SDK Error: expected ':'")])
291291
@mock.patch('dlpx.virtualization._internal.file_util.get_src_dir_path')
292292
def test_bad_syntax(mock_file_util, plugin_config_file,
293293
fake_src_dir, expected_error):

0 commit comments

Comments
 (0)