Skip to content

Commit 97fe182

Browse files
authored
CP-11849 Update developer.delphix.com with support for Python 3.11 (#538)
* CP-11849 Update developer.delphix.com with support for Python 3.11
1 parent 5e5ab54 commit 97fe182

16 files changed

+59
-35
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The latest user documentation can be found [here](https://developer.delphix.com)
1111

1212
- macOS 10.14+, Ubuntu 16.04+, or Windows 10
1313
- Python 2.7 (vSDK 3.1.0 and earlier)
14-
- Python 3.8 (vSDK 4.0.0 and later)
14+
- Python 3.8 (vSDK 4.1.0 and earlier)
1515
- Python 3.11 (vSDK 5.0.0 and later)
1616
- Java 7+
1717
- A Delphix Engine of an [appropriate version](/References/Version_Compatibility.md)

common/setup.py

+1-1
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.9.0.dev0",
7+
"dvp-api == 1.9.0",
88
"six >= 1.16, < 1.17",
99
]
1010

docs/docs/Best_Practices/Code_Sharing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All Python modules inside of `srcDir` can be imported just as they would be if the plugin was executing locally. When a plugin operation is executed `srcDir` is the current working directory so all imports need to be relative to `srcDir` regardless of the path of the module doing the import.
44

5-
Please refer to Python's [documentation on modules](https://docs.python.org/3.8/tutorial/modules.html#modules) to learn more about modules and imports.
5+
Please refer to Python's [documentation on modules](https://docs.python.org/3.11/tutorial/modules.html#modules) to learn more about modules and imports.
66

77
## Example
88

docs/docs/Best_Practices/Managing_Scripts_For_Remote_Execution.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ To execute a PowerShell or Bash script or Expect script on a remote host, you mu
44

55
[pkgutil](https://docs.python.org/2/library/pkgutil.html) is part of the standard Python library. The method that is applicable to resources is [pkgutil.get_data](https://docs.python.org/2/library/pkgutil.html#pkgutil.get_data).
66

7-
When developing a plugin in Python3, it is instead suggested to use the newer `importlib.resources`. This package is part of the standard Python 3 library. The method that is applicable to resources is [resources.read_text](https://docs.python.org/3.8/library/importlib.html#importlib.resources.read_text), which accepts the same arguments as `pkgutil.get_data`.
7+
When developing a plugin in Python3, it is instead suggested to use the newer `importlib.resources`. This package is part of the standard Python 3 library. The method that is applicable to resources is [resources.read_text](https://docs.python.org/3.11/library/importlib.resources.html#importlib.resources.read_text), which accepts the same arguments as `pkgutil.get_data`.
88

99
### Basic Usage
1010

@@ -106,7 +106,7 @@ The contents of `src/resources/platform/get_date.sh` can be retrieved with:
106106
script_content = pkgutil.get_data('resources.platform', 'get_date.sh')
107107
```
108108

109-
In a Python 3.8 plugin, the suggested approach is:
109+
In a Python 3.8 and Python 3.11 plugin, the suggested approach is:
110110

111111
```python
112112
script_content = resources.read_text('resources.platform', 'get_date.sh')

docs/docs/Getting_Started.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ The platform and libs modules expose objects and methods needed to develop a plu
1313

1414
- macOS 10.14+, Ubuntu 16.04+, or Windows 10
1515
- Python 2.7 (vSDK 3.1.0 and earlier)
16-
- Python 3.8 (vSDK 4.0.0 and later)
16+
- Python 3.8 (vSDK 4.1.0 and earlier)
17+
- Python 3.11 (vSDK 5.0.0 and later)
1718
- Java 7+
1819
- A Delphix Engine of an [appropriate version](References/Version_Compatibility.md)
1920
- An active internet connection to download packages from [PyPI](https://pypi.org/)
@@ -33,11 +34,13 @@ $ pip install dvp
3334

3435
If using vSDK 3.1.0 or earlier, the virtual environment needs to use Python 2.7.
3536

36-
If using vSDK 4.0.0 or earlier, the virtual environment needs to use Python 3.8.
37+
If using vSDK 4.1.0 or earlier, the virtual environment needs to use Python 3.8.
38+
39+
If using vSDK 5.0.0 or later, the virtual environment needs to use Python 3.11.
3740

3841
This is configured when creating the virtualenv:
3942

40-
```$ virtualenv -p /path/to/python2.7/binary ENV``` or ```$ virtualenv -p /path/to/python3.8/binary ENV```
43+
```$ virtualenv -p /path/to/python2.7/binary ENV``` or ```$ virtualenv -p /path/to/python3.8/binary ENV``` or ```$ virtualenv -p /path/to/python3.11/binary ENV```
4144

4245
To install a specific version of the SDK run:
4346

docs/docs/References/Logging.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ The Virtualization Platform keeps plugin-specific log files. A plugin can, at an
66

77
## Overview
88

9-
The Virtualization Platform integrates with Python's built-in [logging framework](https://docs.python.org/3.8/library/logging.html). A special [Handler](https://docs.python.org/3.8/library/logging.html#handler-objects) is exposed by the platform at `dlpx.virtualization.libs.PlatformHandler`. This handler needs to be added to the Python logger your plugin creates. Logging statements made through Python's logging framework will then be routed to the platform.
9+
The Virtualization Platform integrates with Python's built-in [logging framework](https://docs.python.org/3.11/library/logging.html). A special [Handler](https://docs.python.org/3.11/library/logging.html#handler-objects) is exposed by the platform at `dlpx.virtualization.libs.PlatformHandler`. This handler needs to be added to the Python logger your plugin creates. Logging statements made through Python's logging framework will then be routed to the platform.
1010

1111
## Basic Setup
12-
Below is the absolute minimum needed to setup logging for the platform. Please refer to Python's [logging documentation](https://docs.python.org/3.8/library/logging.html) and the [example below](#example) to better understand how it can be customized.
12+
Below is the absolute minimum needed to setup logging for the platform. Please refer to Python's [logging documentation](https://docs.python.org/3.11/library/logging.html) and the [example below](#example) to better understand how it can be customized.
1313

1414
```python
1515
import logging
@@ -40,7 +40,7 @@ logger.setLevel(logging.DEBUG)
4040
There is a limit to how much data can be stored within a log message. See [Message Limits](../Best_Practices/Message_Limits.md) for details.
4141

4242
## Usage
43-
Once the `PlatformHandler` has been added to the logger, logging is done with Python's [Logger](https://docs.python.org/3.8/library/logging.html#logger-objects) object. Below is a simple example including the basic setup code used above:
43+
Once the `PlatformHandler` has been added to the logger, logging is done with Python's [Logger](https://docs.python.org/3.11/library/logging.html#logger-objects) object. Below is a simple example including the basic setup code used above:
4444

4545
```python
4646
import logging
@@ -181,7 +181,7 @@ Download a support bundle by going to **Help** > **Support Logs** and select **
181181

182182
## Logging Levels
183183

184-
Python has a number of [preset logging levels](https://docs.python.org/3.8/library/logging.html#logging-levels) and allows for custom ones as well. Since logging on the Virtualization Platform uses the `logging` framework, log statements of all levels are supported.
184+
Python has a number of [preset logging levels](https://docs.python.org/3.11/library/logging.html#logging-levels) and allows for custom ones as well. Since logging on the Virtualization Platform uses the `logging` framework, log statements of all levels are supported.
185185

186186
However, the Virtualization Platform will map all logging levels into three files: `debug.log`, `info.log`, and `error.log` in the following way:
187187

docs/docs/References/Platform_Libraries.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ response = libs.run_bash(connection, command)
111111
# Execute script on remote host
112112
response = libs.run_bash(direct_source.connection, script_content)
113113
```
114-
###### Python 3.8 recommended approach
114+
###### Python 3.8 and Python 3.11 recommended approach
115115
```python
116116

117117
from importlib import resources

docs/docs/References/Plugin_Config.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ The name of the file can be specified during the build. By default, the build lo
55

66
## Fields
77

8-
|Field Name|Required|Type|Description|
9-
|----------|:------:|:--:|-----------|
10-
|id|Y|string|The unique id of the plugin in a valid UUID format.|
11-
|name|N|string|The display name of the plugin. This will be used in the UI. If it is not specified name will be equal to id.|
12-
|externalVersion|N|string|The plugin's [external version](../Versioning_And_Upgrade/Versioning.md#external-version). This is a freeform string. If it is not supplied, the build number is used as an external version.
13-
|buildNumber|Y|string|The plugin's [build number](../Versioning_And_Upgrade/Versioning.md#build-number). This string must conform to the format described [here](../Versioning_And_Upgrade/Versioning.md#build-number-format-rules).
14-
|hostTypes|Y|list|The host type that the plugin supports. Either `UNIX` or `WINDOWS`.|
15-
|schemaFile|Y|string|The path to the JSON file that contains the [plugin's schema definitions](Schemas.md).<br><br>This path can be absolute or relative to the directory containing the plugin config file.|
16-
|srcDir|Y|string|The path to the directory that contains the source code for the plugin. During execution of a plugin operation, this directory will be the current working directory of the Python interpreter. Any modules or resources defined outside of this directory will be inaccessible at runtime.<br><br>This path can be absolute or relative to the directory containing the plugin config file.|
17-
|entryPoint|Y|string|A fully qualified Python symbol that points to the `dlpx.virtualization.platform.Plugin` object that defines the plugin.<br><br>It must be in the form `importable.module:object_name` where `importable.module` is in `srcDir`.|
18-
|manualDiscovery|N|boolean|True if the plugin supports manual discovery of source config objects. The default value is `true`.|
19-
|pluginType|Y|enum|The ingestion strategy of the plugin. Can be either `STAGED` or `DIRECT`.|
20-
|language|Y|enum|Must be `PYTHON38`.|
21-
|defaultLocale|N|enum|The locale to be used by the plugin if the Delphix user does not specify one. Plugin messages will be displayed in this locale by default. The default value is `en-us`.|
22-
|rootSquashEnabled|N|boolean|This dictates whether "root squash" is enabled on NFS mounts for the plugin (i.e. whether the `root` user on remote hosts has access to the NFS mounts). Setting this to `false` allows processes usually run as `root`, like Docker daemons, access to the NFS mounts. The default value is `true`. This field only applies to Unix hosts.|
23-
|extendedStartStopHooks|N|boolean|This controls whether the user's pre-start and post-start hooks will run during enable operations (and, likewise, whether pre-stop and post-stop hooks will run during disable operations). The default value is `false`.|
8+
|Field Name|Required|Type| Description |
9+
|----------|:------:|:--:|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
10+
|id|Y|string| The unique id of the plugin in a valid UUID format. |
11+
|name|N|string| The display name of the plugin. This will be used in the UI. If it is not specified name will be equal to id. |
12+
|externalVersion|N|string| The plugin's [external version](../Versioning_And_Upgrade/Versioning.md#external-version). This is a freeform string. If it is not supplied, the build number is used as an external version.
13+
|buildNumber|Y|string| The plugin's [build number](../Versioning_And_Upgrade/Versioning.md#build-number). This string must conform to the format described [here](../Versioning_And_Upgrade/Versioning.md#build-number-format-rules).
14+
|hostTypes|Y|list| The host type that the plugin supports. Either `UNIX` or `WINDOWS`. |
15+
|schemaFile|Y|string| The path to the JSON file that contains the [plugin's schema definitions](Schemas.md).<br><br>This path can be absolute or relative to the directory containing the plugin config file. |
16+
|srcDir|Y|string| The path to the directory that contains the source code for the plugin. During execution of a plugin operation, this directory will be the current working directory of the Python interpreter. Any modules or resources defined outside of this directory will be inaccessible at runtime.<br><br>This path can be absolute or relative to the directory containing the plugin config file. |
17+
|entryPoint|Y|string| A fully qualified Python symbol that points to the `dlpx.virtualization.platform.Plugin` object that defines the plugin.<br><br>It must be in the form `importable.module:object_name` where `importable.module` is in `srcDir`. |
18+
|manualDiscovery|N|boolean| True if the plugin supports manual discovery of source config objects. The default value is `true`. |
19+
|pluginType|Y|enum| The ingestion strategy of the plugin. Can be either `STAGED` or `DIRECT`. |
20+
|language|Y|enum| Must be `PYTHON311`. |
21+
|defaultLocale|N|enum| The locale to be used by the plugin if the Delphix user does not specify one. Plugin messages will be displayed in this locale by default. The default value is `en-us`. |
22+
|rootSquashEnabled|N|boolean| This dictates whether "root squash" is enabled on NFS mounts for the plugin (i.e. whether the `root` user on remote hosts has access to the NFS mounts). Setting this to `false` allows processes usually run as `root`, like Docker daemons, access to the NFS mounts. The default value is `true`. This field only applies to Unix hosts. |
23+
|extendedStartStopHooks|N|boolean| This controls whether the user's pre-start and post-start hooks will run during enable operations (and, likewise, whether pre-stop and post-stop hooks will run during disable operations). The default value is `false`. |
2424

2525
## Example
2626
Assume the following basic plugin structure:
@@ -52,7 +52,7 @@ entryPoint: mongo_runner:mongodb
5252
srcDir: src/
5353
schemaFile: schema.json
5454
pluginType: DIRECT
55-
language: PYTHON38
55+
language: PYTHON311
5656
buildNumber: 0.1.0
5757
```
5858
This is a valid plugin config for the plugin with `manualDiscovery` set to `false` and an `externalVersion` set:
@@ -67,7 +67,7 @@ srcDir: src/
6767
schemaFile: schema.json
6868
manualDiscovery: false
6969
pluginType: DIRECT
70-
language: PYTHON38
70+
language: PYTHON311
7171
externalVersion: "MongoDB 1.0"
7272
buildNumber: "1"
7373
```

docs/docs/References/Version_Compatibility.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
| vSDK Version | Earliest Supported DE Version | Latest Supported DE Version |
66
|------------------------------------------|:-----------------------------:|:-----------------------------------------------------------------:|
7+
| [5.0.0](../Release_Notes/5.0.0/5.0.0.md) | 29.0.0.0 | [Latest Release](https://cd.delphix.com/docs/latest/new-features) |
78
| [4.1.0](../Release_Notes/4.1.0/4.1.0.md) | 12.0.0.0 | [Latest Release](https://cd.delphix.com/docs/latest/new-features) |
89
| [4.0.5](../Release_Notes/4.0.5/4.0.5.md) | 6.0.16.0 | [Latest Release](https://cd.delphix.com/docs/latest/new-features) |
910
| [4.0.2](../Release_Notes/4.0.2/4.0.2.md) | 6.0.12.0 | [Latest Release](https://cd.delphix.com/docs/latest/new-features) |
@@ -18,6 +19,7 @@
1819

1920
| vSDK Version | Python Version |
2021
|------------------------------------------|:--------------:|
22+
| [5.0.0](../Release_Notes/5.0.0/5.0.0.md) | 3.11 |
2123
| [4.1.0](../Release_Notes/4.1.0/4.1.0.md) | 3.8 |
2224
| [4.0.5](../Release_Notes/4.0.5/4.0.5.md) | 3.8 |
2325
| [4.0.2](../Release_Notes/4.0.2/4.0.2.md) | 3.8 |

docs/docs/Release_Notes/.pages

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
arrange:
2+
- 5.0.0
23
- 4.1.0
34
- 4.0.5
45
- 4.0.2

docs/docs/Release_Notes/5.0.0/.pages

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
arrange:
2+
- 5.0.0.md
3+
- 5.0.0_Breaking_Changes.md
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Release - v5.0.0
2+
3+
To install or upgrade the SDK, refer to instructions [here](../../Getting_Started.md#installation).
4+
5+
## New & Improved
6+
7+
* Added support for plugins written in Python 3.11.
8+
9+
## Breaking Changes
10+
11+
* The CLI now requires Python 3.11 for installation and usage.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Breaking Changes - v.5.0.0
2+
3+
## New Language Requirement
4+
The vSDK now requires Python 3.11.

docs/mkdocs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
site_name: Delphix Virtualization SDK 4.1.0
1+
site_name: Delphix Virtualization SDK 5.0.0
22

33
repo_name: Delphix Virtualization SDK
44
repo_url: https://github.com/delphix/virtualization-sdk/
@@ -20,7 +20,7 @@ theme:
2020
- content.code.copy
2121
- content.code.annotate
2222

23-
copyright: Copyright &copy; 2023 Delphix Corp.
23+
copyright: Copyright &copy; 2024 Delphix Corp.
2424

2525
extra:
2626
analytics:

libs/setup.py

+1-1
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.9.0.dev0",
10+
"dvp-api == 1.9.0",
1111
"dvp-common == {}".format(version),
1212
"six >= 1.16, < 1.17",
1313
]

platform/setup.py

+1-1
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.9.0.dev0",
10+
"dvp-api == 1.9.0",
1111
"dvp-common == {}".format(version),
1212
"six >= 1.16, < 1.17",
1313
]

0 commit comments

Comments
 (0)