Skip to content

Commit e313784

Browse files
authored
Merge pull request #542 from SumoSourabh/CP-11887
CP-11887 Merge Python 3.11 changes to master from develop branch
2 parents 0a08915 + 76c821c commit e313784

File tree

45 files changed

+425
-437
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+425
-437
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ 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)
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 == 1.9.0",
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.

docs/docs/Best_Practices/Code_Sharing.md

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 6 additions & 3 deletions
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 18 additions & 18 deletions
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
```

0 commit comments

Comments
 (0)