mysqlx-connector-python 9.0.0__tar.gz → 9.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. mysqlx-connector-python-9.1.0/CONTRIBUTING.md +358 -0
  2. mysqlx-connector-python-9.1.0/INFO_BIN +2 -0
  3. mysqlx-connector-python-9.1.0/INFO_SRC +4 -0
  4. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/LICENSE.txt +5 -5
  5. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/README.rst +36 -2
  6. mysqlx-connector-python-9.1.0/SECURITY.md +30 -0
  7. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/tls_ciphers.py +8 -7
  8. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/version.py +1 -1
  9. mysqlx-connector-python-9.1.0/mysqlx_connector_python-9.1.0-py3.9.egg-info/PKG-INFO +184 -0
  10. {mysqlx-connector-python-9.0.0/mysqlx_connector_python-9.0.0-py3.8.egg-info → mysqlx-connector-python-9.1.0/mysqlx_connector_python-9.1.0-py3.9.egg-info}/SOURCES.txt +2 -2
  11. mysqlx-connector-python-9.0.0/CONTRIBUTING.rst +0 -343
  12. mysqlx-connector-python-9.0.0/INFO_BIN +0 -2
  13. mysqlx-connector-python-9.0.0/INFO_SRC +0 -4
  14. mysqlx-connector-python-9.0.0/mysqlx_connector_python-9.0.0-py3.8.egg-info/PKG-INFO +0 -37
  15. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/README.txt +0 -0
  16. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/__init__.py +0 -0
  17. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/authentication.py +0 -0
  18. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/charsets.py +0 -0
  19. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/connection.py +0 -0
  20. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/constants.py +0 -0
  21. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/crud.py +0 -0
  22. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/dbdoc.py +0 -0
  23. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/errorcode.py +0 -0
  24. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/errors.py +0 -0
  25. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/expr.py +0 -0
  26. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/helpers.py +0 -0
  27. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/locales/__init__.py +0 -0
  28. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/locales/eng/__init__.py +0 -0
  29. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/locales/eng/client_error.py +0 -0
  30. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/logger.py +0 -0
  31. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/protobuf/__init__.py +0 -0
  32. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/protobuf/mysqlx_connection_pb2.py +0 -0
  33. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/protobuf/mysqlx_crud_pb2.py +0 -0
  34. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/protobuf/mysqlx_cursor_pb2.py +0 -0
  35. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/protobuf/mysqlx_datatypes_pb2.py +0 -0
  36. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/protobuf/mysqlx_expect_pb2.py +0 -0
  37. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/protobuf/mysqlx_expr_pb2.py +0 -0
  38. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/protobuf/mysqlx_notice_pb2.py +0 -0
  39. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/protobuf/mysqlx_pb2.py +0 -0
  40. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/protobuf/mysqlx_prepare_pb2.py +0 -0
  41. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/protobuf/mysqlx_resultset_pb2.py +0 -0
  42. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/protobuf/mysqlx_session_pb2.py +0 -0
  43. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/protobuf/mysqlx_sql_pb2.py +0 -0
  44. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/protocol.py +0 -0
  45. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/py.typed +0 -0
  46. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/result.py +0 -0
  47. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/statement.py +0 -0
  48. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/types.py +0 -0
  49. {mysqlx-connector-python-9.0.0 → mysqlx-connector-python-9.1.0}/mysqlx/utils.py +0 -0
  50. {mysqlx-connector-python-9.0.0/mysqlx_connector_python-9.0.0-py3.8.egg-info → mysqlx-connector-python-9.1.0/mysqlx_connector_python-9.1.0-py3.9.egg-info}/dependency_links.txt +0 -0
  51. {mysqlx-connector-python-9.0.0/mysqlx_connector_python-9.0.0-py3.8.egg-info → mysqlx-connector-python-9.1.0/mysqlx_connector_python-9.1.0-py3.9.egg-info}/requires.txt +0 -0
  52. {mysqlx-connector-python-9.0.0/mysqlx_connector_python-9.0.0-py3.8.egg-info → mysqlx-connector-python-9.1.0/mysqlx_connector_python-9.1.0-py3.9.egg-info}/top_level.txt +0 -0
@@ -0,0 +1,358 @@
1
+ # Contributing Guidelines
2
+
3
+ We love getting feedback from our users. Bugs and code contributions are great forms of feedback and we thank you for any bugs you report or code you contribute.
4
+
5
+ ## Reporting Issues
6
+
7
+ Before reporting a new bug, please check [Bugs List](https://bugs.mysql.com/search.php) to see if a similar bug already exists.
8
+
9
+ Bug reports should be as complete as possible. Please try and include the following:
10
+
11
+ * Complete steps to reproduce the issue.
12
+ * Any information about platform and environment that could be specific to the bug.
13
+ * Specific version of the product you are using.
14
+ * Specific version of the server being used.
15
+ * Sample code to help reproduce the issue if possible.
16
+
17
+ ## Contributing Code
18
+
19
+ Contributing to this project is easy. You just need to follow these steps.
20
+
21
+ * Make sure you have a user account at [MySQL Bug Report page](https://bugs.mysql.com). You will need to reference this user account when you submit your Oracle Contributor Agreement (a.k.a. OCA).
22
+ * Sign the Oracle Contributor Agreement. You can find instructions for doing that at the [OCA Page](https://oca.opensource.oracle.com/).
23
+ * Develop your pull request. Make sure you are aware of the [environment requirements](https://dev.mysql.com/doc/dev/connector-python/requirements.html) for the project.
24
+ * Validate your pull request by including tests that sufficiently cover the functionality you are adding.
25
+ * Verify that the entire test suite passes with your code applied.
26
+ * Submit your pull request. While you can submit the pull request via [GitHub](https://github.com/mysql/mysql-connector-python/pulls), you can also submit it directly via [MySQL Bug Report page](https://bugs.mysql.com).
27
+
28
+ Thanks again for your wish to contribute to MySQL. We truly believe in the principles of open source development and appreciate any contributions to our projects.
29
+
30
+ ## Setting Up a Development Environment
31
+
32
+ The following tips provide all the technical directions you should follow when writing code and before actually submitting your contribution.
33
+
34
+ * Make sure you have the necessary [prerequisites](https://dev.mysql.com/doc/dev/connector-python/installation.html#prerequisites) for building the project and [Pylint](https://www.pylint.org/) for static code analysis.
35
+
36
+ * Clone MySQL Connector/Python
37
+
38
+ ```bash
39
+ shell> git clone https://github.com/mysql/mysql-connector-python.git
40
+ ```
41
+
42
+ ## Coding Style
43
+
44
+ Please follow the MySQL Connector/Python coding standards when contributing with code.
45
+
46
+ All files should be formatted using the [black](https://github.com/psf/black) auto-formatter and [isort](https://pycqa.github.io/isort/). This will be run by [pre-commit](https://pre-commit.com) if it's configured.
47
+
48
+ For C files, the [PEP 7](https://peps.python.org/pep-0007/) should be followed. A ```.clang-format``` configuration is included in the source, so you can manually format the code using the [clang-format](https://clang.llvm.org/docs/ClangFormat.html) tool.
49
+
50
+ ## Pre-commit Checks
51
+
52
+ MySQL Connector/Python comes with a pre-commit config file, which manages Git pre-commit hooks. These hooks are useful for identifing issues before committing code.
53
+
54
+ To use the pre-commit hooks, you first need to install the [pre-commit](https://pre-commit.com) package and then the git hooks:
55
+ ```bash
56
+ shell> python -m pip install pre-commit
57
+ shell> pre-commit install
58
+ ```
59
+
60
+ The first time pre-commit runs, it will automatically download, install, and run the hooks. Running the hooks for the first time may be slow, but subsequent checks will be significantly faster.
61
+
62
+ Now, pre-commit will run on every commit.
63
+
64
+ ## Running `mysql-connector-python` Tests
65
+
66
+ Any code you contribute needs to pass our test suite. Please follow these steps to run our tests and validate your contributed code.
67
+
68
+ Run the entire test suite:
69
+
70
+ ```bash
71
+ shell> python unittests.py --with-mysql=<mysql-dir> --with-mysql-capi=<mysql-capi-dir>
72
+ ```
73
+
74
+ Example:
75
+
76
+ ```bash
77
+ shell> python unittests.py --with-mysql=/usr/local/mysql --with-mysql-capi=/usr/local/mysql
78
+ ```
79
+
80
+ The tests can be configured to be launched using an external server or bootstrapping it. The former is preferred (we'll assume so moving forward).
81
+
82
+ As you can see, there are several parameters that can be injected into the `unittests` module. The parameters shown above are optional, or a must if you want to run the tests with the *C extension* enabled for the `mysql.connector` module.
83
+
84
+ The `with-mysql-capi` flag is needed to build the `C extension` of `mysql.connector`.
85
+
86
+ Additionally, there are parameters or flags that can be provided to set values to be used when connecting to the server:
87
+
88
+ * **user**: the value stored by the environment variable `MYSQL_USER` is used (if set), otherwise, `root` is used by default.
89
+ * **password**: the value of `MYSQL_PASSWORD` is used (if set), otherwise, `empty_string` is used by default.
90
+ * **port**: the value of `MYSQL_PORT` is used (if set), otherwise, `3306` is used by default.
91
+ * **host**: the value of `MYSQL_HOST` is used (if set), otherwise, `127.0.0.1` (localhost) is used by default.
92
+
93
+ The previous defaults conform to the standard or default configuration implemented by the MySQL server. Actually, there are many more flags available, you can explore them via `python unittests.py --help`.
94
+
95
+ There are two core flags you can use to control the unit tests selection:
96
+
97
+ 1. **-t** which is a shortcut for **--test**. This command executes one test module provided the module name::
98
+
99
+ ```bash
100
+ $ python unittests.py --use-external-server --verbosity 2 --password=$MYPASS -t cext_cursor
101
+ ```
102
+
103
+ 2. **-T** which is a shortcut for **--one-test**. This command executes a particular test following a finer-grained syntax such as `<module>[.<class>[.<method>]]`:
104
+
105
+ ```bash
106
+ $ python unittests.py --use-external-server --verbosity 2 --password=$MYPASS -T tests.test_bugs.BugOra16660356
107
+ $ python unittests.py --use-external-server --verbosity 2 --password=$MYPASS -T tests.test_bugs.BugOra17041240.test_cursor_new
108
+ ```
109
+
110
+ If you do not provide any flag regarding *control of the unit tests selection*, all available test modules will be run. Some of the available test modules are:
111
+
112
+ - abstracts
113
+ - authentication
114
+ - bugs
115
+ - cext_api
116
+ - cext_cursor
117
+ - connection
118
+ - constants
119
+ - conversion
120
+ - cursor
121
+ - errors
122
+ - mysql_datatypes
123
+ - network
124
+ - optionfiles
125
+ - pooling
126
+ - protocol
127
+ - qa_bug16217743
128
+ - qa_caching_sha2_password
129
+ - utils
130
+
131
+ The list is not complete, but you can deduce and find more module names by inspecting the **tests** folder and its subfolders.
132
+
133
+
134
+ # Running `mysqlx-connector-python` Tests
135
+
136
+ Any code you contribute needs to pass our test suite. Please follow these steps to run our tests and validate your contributed code.
137
+
138
+ Run the entire test suite:
139
+
140
+ ```bash
141
+ shell> python unittests.py --with-mysql=<mysql-dir> --with-protobuf-include-dir=<protobuf-include-dir> --with-protobuf-lib-dir=<protobuf-lib-dir> --with-protoc=<protoc-binary>
142
+ ```
143
+
144
+ Example:
145
+
146
+ ```bash
147
+ shell> python unittests.py --with-mysql=/usr/local/mysql --with-protobuf-include-dir=/usr/local/protobuf/include --with-protobuf-lib-dir=/usr/local/protobuf/lib --with-protoc=/usr/local/protobuf/bin/protoc
148
+ ```
149
+
150
+ The tests can be configured to be launched using an external server or bootstrapping it. The former is preferred (we'll assume so moving forward).
151
+
152
+ As you can see, there are several parameters that can be injected into the `unittests` module. The parameters shown above are optional, or a must if you want to run the tests with the *C extension* enabled for the `mysqlx` module.
153
+
154
+ The `protobuf` flags are needed to build the `C extension` of `mysqlx`.
155
+
156
+ Additionally, there are parameters or flags that can be provided to set values to be used when connecting to the server:
157
+
158
+ * **user**: the value stored by the environment variable `MYSQL_USER` is used (if set), otherwise, `root` is used by default.
159
+ * **password**: the value of `MYSQL_PASSWORD` is used (if set), otherwise, `empty_string` is used by default.
160
+ * **mysqlx-port**: the value of `MYSQLX_PORT` is used (if set), otherwise, `33060` is used by default.
161
+ * **host**: the value of `MYSQL_HOST` is used (if set), otherwise, `127.0.0.1` (localhost) is used by default.
162
+
163
+ The previous defaults conform to the standard or default configuration implemented by the MySQL server. Actually, there are many more flags available, you can explore them via `python unittests.py --help`.
164
+
165
+ There are two core flags you can use to control the unit tests selection:
166
+
167
+ 1. **-t** which is a shortcut for **--test**. This command executes one test module provided the module name::
168
+
169
+ ```bash
170
+ $ python unittests.py --use-external-server --verbosity 2 --password=$MYPASS -t mysqlx_connection
171
+ ```
172
+
173
+ 2. **-T** which is a shortcut for **--one-test**. This command executes a particular test following a finer-grained syntax such as `<module>[.<class>[.<method>]]`:
174
+
175
+ ```bash
176
+ $ python unittests.py --use-external-server --verbosity 2 --password=$MYPASS -T tests.test_mysqlx_crud.MySQLxDbDocTests
177
+ $ python unittests.py --use-external-server --verbosity 2 --password=$MYPASS -T tests.test_mysqlx_crud.MySQLxDbDocTests.test_dbdoc_creation
178
+ ```
179
+
180
+ If you do not provide any flag regarding *control of the unit tests selection*, all available test modules will be run. Some of the available test modules are:
181
+
182
+ - mysql_datatypes
183
+ - mysqlx_connection
184
+ - mysqlx_crud
185
+ - mysqlx_errorcode
186
+ - mysqlx_pooling
187
+
188
+ The list is not complete, but you can deduce and find more module names by inspecting the **tests** folder and its subfolders.
189
+
190
+
191
+ ## Running `mysql-connector-python` Tests using a Docker Container
192
+
193
+ For **Linux** and **macOS** users, there is a script that builds and runs a Docker container which then executes the test suite (*the C extension is built and enabled only if explicitly instructed*). This means no external dependency, apart from a running MySQL server, is needed.
194
+
195
+ The script uses the environment variables described previously and introduces a few new ones. These are mostly meant to be used for configuring the Docker container itself. They allow to specify the path to a *Oracle Linux* engine image, the network proxy setup, the URL of the PyPI repository to use and whether you want the **C-EXT** enabled or not.
196
+
197
+ * `BASE_IMAGE` (**container-registry.oracle.com/os/oraclelinux:9-slim** by default)
198
+ * `HTTP_PROXY` (value of the environment variable in the host by default)
199
+ * `HTTPS_PROXY` (value of the environment variable in the host by default)
200
+ * `NO_PROXY` (value of the environment variable in the host by default)
201
+ * `PYPI_REPOSITORY` (https://pypi.org/pypi by default)
202
+ * `MYSQL_CEXT` (used to control the building of the **connector.mysql** C-EXT. If set to ``true`` or ``yes``, the extension is built, otherwise it is not)
203
+ * `MYSQL_SOCKET` (described below)
204
+
205
+ There is one additional environment variable called `TEST_PATTERN` which can be used to provide a string or a regular expression that is applied for filtering one or more matching unit tests to execute.
206
+
207
+ For instance, if you want to run the test module named *cursor* you'd be using:
208
+
209
+ ```bash
210
+ $ TEST_PATTERN='cursor' MYSQL_PASSWORD='s3cr3t' ./tests/docker/runner.sh
211
+ ```
212
+
213
+ Similarly, if you want to run all tests including the pattern *con* you'd be issuing:
214
+
215
+ ```bash
216
+ $ TEST_PATTERN='.*con.*' MYSQL_PASSWORD='s3cr3t' ./tests/docker/runner.sh
217
+ ```
218
+
219
+ If you want to run **connector.mysql** tests related to the C-EXT functionality you could use:
220
+
221
+ ```bash
222
+ $ MYSQL_CEXT='true' TEST_PATTERN='cext.*' MYSQL_PASSWORD='s3cr3t' ./tests/docker/runner.sh
223
+ ```
224
+
225
+ In the examples above, a standard MySQL server configuration is assumed, that's the reason the values for `MYSQL_HOST`, `MYSQL_USER` or `MYSQL_PORT` weren't specified.
226
+
227
+ For **Windows** users, you can set up a suitable environment to run bash scripts by installing [Git Bash](https://git-scm.com/), and using the console it provides instead of the natives *PowerShell* or *CMD*.
228
+
229
+ Similar to when the tests run on a local environment, the `MYSQL_HOST` variable is only relevant for the functional tests.
230
+
231
+ On **Linux**, the variable is optional and the Docker container will run using the "host" network mode whilst tests assume the MySQL server is listening on `localhost`.
232
+
233
+ On **macOS** and **Windows**, since containers run on a virtual machine, host loopback addresses are not reachable. In that case, the `MYSQL_HOST` variable is required and should specify the hostname or IP address of the MySQL server. Optionally, you can use `host.docker.internal` as `MYSQL_HOST` if you want to connect to a server hosted locally [reference](https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach).
234
+
235
+ Due to some [know limitations](https://github.com/docker/for-mac/issues/483) on the macOS Docker architecture, Unix socket tests can only run on Linux. In that case, if the `MYSQL_SOCKET` variable is explicitly specified, a shared volume between the host and the container will be created as a mount point from the socket file path in the host and an internal container directory specified as a volume, where the socket file path becomes available.
236
+
237
+ That being said, the following are some examples of possible use cases:
238
+
239
+ * Running the test modules whose name follows the pattern `c.*` from a mac whose IP is `232.188.98.520`, and the password for `root` is `s3cr3t`. Classic protocol is listening on port `3306`:
240
+
241
+ ```bash
242
+ $ TEST_PATTERN='c.*' MYSQL_HOST='192.168.68.111' MYSQL_PASSWORD='s3cr3t' ./tests/docker/runner.sh
243
+ ```
244
+
245
+ * Running the whole test suite from Linux with MySQL user account `docker`, and password `s3cr3t`. Classic protocol is listening on port `3308`:
246
+
247
+ ```bash
248
+ $ MYSQL_PORT='3308' MYSQL_USER='docker' MYSQL_PASSWORD='s3cr3t' ./tests/docker/runner.sh
249
+ ```
250
+
251
+ * Same setup as before but with the **connector.mysql** C-EXT enabled:
252
+
253
+ ```bash
254
+ $ MYSQL_CEXT='true' MYSQL_PORT='3308' MYSQL_USER='docker' MYSQL_PASSWORD='s3cr3t' ./tests/docker/runner.sh
255
+ ```
256
+
257
+
258
+ ## Running `mysqlx-connector-python` Tests using a Docker Container
259
+
260
+ For **Linux** and **macOS** users, there is a script that builds and runs a Docker container which then executes the test suite (*the C extension is built and enabled only if explicitly instructed*). This means no external dependency, apart from a running MySQL server, is needed.
261
+
262
+ The script uses the environment variables described previously and introduces a few new ones. These are mostly meant to be used for configuring the Docker container itself. They allow to specify the path to a *Oracle Linux* engine image, the network proxy setup, the URL of the PyPI repository to use and whether you want the **C-EXT** enabled or not.
263
+
264
+ * `BASE_IMAGE` (**container-registry.oracle.com/os/oraclelinux:9-slim** by default)
265
+ * `HTTP_PROXY` (value of the environment variable in the host by default)
266
+ * `HTTPS_PROXY` (value of the environment variable in the host by default)
267
+ * `NO_PROXY` (value of the environment variable in the host by default)
268
+ * `PYPI_REPOSITORY` (https://pypi.org/pypi by default)
269
+ * `MYSQLX_CEXT` (used to control the building of the **mysqlx** C-EXT. If set to `true` or `yes`, the extension is built, otherwise it is not)
270
+ * `MYSQL_SOCKET` (described below)
271
+
272
+ There is one additional environment variable called `TEST_PATTERN` which can be used to provide a string or a regular expression that is applied for filtering one or more matching unit tests to execute.
273
+
274
+ For instance, if you want to run the test module named *cursor* you'd be using::
275
+
276
+ ```bash
277
+ $ TEST_PATTERN='mysqlx_connection' MYSQL_PASSWORD='s3cr3t' ./tests/docker/runner.sh
278
+ ```
279
+
280
+ Similarly, if you want to run all tests including the pattern *con* you'd be issuing:
281
+
282
+ ```bash
283
+ $ TEST_PATTERN='.*con.*' MYSQL_PASSWORD='s3cr3t' ./tests/docker/runner.sh
284
+ ```
285
+
286
+ If you want to run **mysqlx** tests with the C-EXT enabled:
287
+
288
+ ```bash
289
+ $ MYSQLX_CEXT='true' TEST_PATTERN='mysqlx_crud' MYSQL_PASSWORD='s3cr3t' ./tests/docker/runner.sh
290
+ ```
291
+
292
+
293
+ In the examples above, a standard MySQL server configuration is assumed, that's the reason the values for `MYSQL_HOST`, `MYSQL_USER` or `MYSQLX_PORT` weren't specified.
294
+
295
+ For **Windows** users, you can set up a suitable environment to run bash scripts by installing [Git Bash](https://git-scm.com/), and using the console it provides instead of the natives *PowerShell* or *CMD*.
296
+
297
+ Similar to when the tests run on a local environment, the `MYSQL_HOST` variable is only relevant for the functional tests.
298
+
299
+ On **Linux**, the variable is optional and the Docker container will run using the "host" network mode whilst tests assume the MySQL server is listening on `localhost`.
300
+
301
+ On **macOS** and **Windows**, since containers run on a virtual machine, host loopback addresses are not reachable. In that case, the `MYSQL_HOST` variable is required and should specify the hostname or IP address of the MySQL server. Optionally, you can use `host.docker.internal` as `MYSQL_HOST` if you want to connect to a server hosted locally [reference](https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach).
302
+
303
+ Due to some `know limitations <https://github.com/docker/for-mac/issues/483>`_ on the macOS Docker architecture, Unix socket tests can only run on Linux. In that case, if the ``MYSQL_SOCKET`` variable is explicitly specified, a shared volume between the host and the container will be created as a mount point from the socket file path in the host and an internal container directory specified as a volume, where the socket file path becomes available.
304
+
305
+ That being said, the following there are some examples of possible use cases:
306
+
307
+ * Running the test modules whose name follows the pattern `c.*` from a mac whose IP is `232.188.98.520`, and the password for `root` is `s3cr3t`. XDevAPI protocol listening on port `33060`:
308
+
309
+ ```bash
310
+ $ TEST_PATTERN='c.*' MYSQL_HOST='192.168.68.111' MYSQL_PASSWORD='s3cr3t' ./tests/docker/runner.sh
311
+ ```
312
+
313
+ * Running the *mysqlx_crud* test module from Linux with MySQL user account `root`, and password `empty_string`. XDevAPI protocol listening on port `33070`:
314
+
315
+ ```bash
316
+ $ MYSQLX_PORT='33070' TEST_PATTERN='mysqlx_crud' ./tests/docker/runner.sh
317
+ ```
318
+
319
+
320
+ ## Test Coverage
321
+
322
+ When submitting a patch that introduces changes to the source code, you need to make sure that those changes are be accompanied by a proper set of tests that cover 100% of the affected code paths. This is easily auditable by generating proper test coverage HTML and stdout reports using the following commands:
323
+
324
+ 1) Install the [coverage.py](https://github.com/nedbat/coveragepy) package using the following command:
325
+
326
+ ```bash
327
+ shell> python -m pip install coverage
328
+ ```
329
+
330
+ 2) Use coverage run to run your test suite (assuming `mysql-connector-python`) and gather data:
331
+
332
+ ```bash
333
+ shell> coverage run unittests.py --with-mysql=<mysql-dir> --with-mysql-capi=<mysql-capi-dir>
334
+ ```
335
+
336
+ 3) Use `coverage report` to report on the results:
337
+
338
+ ```bash
339
+ shell> coverage report -m
340
+ ```
341
+
342
+ 4) For a nicer presentation, use ``coverage html`` to get annotated HTML listings, The HTML will be generated in `build/coverage_html`:
343
+
344
+ ```bash
345
+ shell> coverage html
346
+ ```
347
+
348
+ ## Getting Help
349
+
350
+ If you need help or just want to get in touch with us, please use the following resources:
351
+
352
+ - [MySQL Connector/Python Developer Guide](https://dev.mysql.com/doc/connector-python/en/)
353
+ - [MySQL Connector/Python X DevAPI Reference](https://dev.mysql.com/doc/dev/connector-python/)
354
+ - [MySQL Connector/Python Forum](http://forums.mysql.com/list.php?50)
355
+ - [MySQL Public Bug Tracker](https://bugs.mysql.com)
356
+ - [Slack](https://mysqlcommunity.slack.com) ([Sign-up](https://lefred.be/mysql-community-on-slack/) is required if you do not have an Oracle account)
357
+ - [Stack Overflow](https://stackoverflow.com/questions/tagged/mysql-connector-python)
358
+ - [InsideMySQL.com Connectors Blog](https://insidemysql.com/category/mysql-development/connectors/)
@@ -0,0 +1,2 @@
1
+ build-date: 2024-09-27 12:52:58
2
+ os-info: Linux-5.15.0-209.161.7.2.el8uek.x86_64-x86_64-with-glibc2.28
@@ -0,0 +1,4 @@
1
+ version: 9.1.0
2
+ branch: release/9.1.0
3
+ commit: 4fbf521f1c6c71621f882f89c0c4946c10ee13ac
4
+ short: 4fbf521
@@ -1,6 +1,6 @@
1
1
  Licensing Information User Manual
2
2
 
3
- MySQL Connector/Python 9.0.0 Community
3
+ MySQL Connector/Python 9.1.0 Community
4
4
  __________________________________________________________________
5
5
 
6
6
  Introduction
@@ -8,18 +8,18 @@ Introduction
8
8
  This License Information User Manual contains Oracle's product license
9
9
  and other licensing information, including licensing information for
10
10
  third-party software which may be included in this distribution of
11
- MySQL Connector/Python 9.0.0 Community.
11
+ MySQL Connector/Python 9.1.0 Community.
12
12
 
13
- Last updated: May 2024
13
+ Last updated: September 2024
14
14
 
15
15
  Licensing Information
16
16
 
17
- This release of MySQL Connector/Python 9.0.0 Community is brought to
17
+ This release of MySQL Connector/Python 9.1.0 Community is brought to
18
18
  you by the MySQL team at Oracle. This software is released under
19
19
  version 2 of the GNU General Public License (GPLv2), as set forth
20
20
  below, with the following additional permissions:
21
21
 
22
- This distribution of MySQL Connector/Python 9.0.0 Community is designed
22
+ This distribution of MySQL Connector/Python 9.1.0 Community is designed
23
23
  to work with certain software (including but not limited to OpenSSL)
24
24
  that is licensed under separate terms, as designated in a particular
25
25
  file or component or in the license documentation. Without limiting
@@ -8,15 +8,22 @@ MySQL Connector/Python
8
8
  .. image:: https://img.shields.io/pypi/l/mysql-connector-python.svg
9
9
  :target: https://pypi.org/project/mysql-connector-python/
10
10
 
11
+ .. === <mysql> ====
11
12
  MySQL Connector/Python enables Python programs to access MySQL databases, using
12
13
  an API that is compliant with the `Python Database API Specification v2.0
13
14
  (PEP 249) <https://www.python.org/dev/peps/pep-0249/>`_ - We refer to it as the
14
15
  `Classic API <https://dev.mysql.com/doc/connector-python/en/connector-python-reference.html>`_.
15
16
 
17
+ .. === </mysql> ====
18
+
19
+ .. === <mysqlx> [repl("It also", "MySQL Connector/Python")] ===
16
20
  It also contains an implementation of the `XDevAPI <https://dev.mysql.com/doc/x-devapi-userguide/en>`_
17
21
  - An Application Programming Interface for working with the `MySQL Document Store
18
22
  <https://dev.mysql.com/doc/refman/en/document-store.html>`_.
19
23
 
24
+ .. === </mysqlx> ===
25
+
26
+ .. === <mysql> [repl("* `XDevAPI <https://dev.mysql.com/doc/x-devapi-userguide/en>`_", "")] ====
20
27
  Features
21
28
  --------
22
29
 
@@ -25,6 +32,8 @@ Features
25
32
  * `Telemetry <https://dev.mysql.com/doc/connector-python/en/connector-python-opentelemetry.html>`_
26
33
  * `XDevAPI <https://dev.mysql.com/doc/x-devapi-userguide/en>`_
27
34
 
35
+ .. === </mysql> ====
36
+
28
37
 
29
38
  Installation
30
39
  ------------
@@ -35,13 +44,17 @@ Make sure you have a recent `pip <https://pip.pypa.io/>`_ version installed
35
44
  on your system. If your system already has ``pip`` installed, you might need
36
45
  to update it. Or you can use the `standalone pip installer <https://pip.pypa.io/en/latest/installation/>`_.
37
46
 
47
+ .. === <mysql> [repl("The *classic API* can be installed via pip as follows:", "")] ===
38
48
  The *classic API* can be installed via pip as follows:
39
49
 
40
50
  .. code-block:: bash
41
51
 
42
52
  $ pip install mysql-connector-python
43
53
 
44
- , similarly, the *XDevAPI* can be installed with:
54
+ .. === </mysql> ====
55
+
56
+ .. === <mysqlx> [repl("similarly, the *XDevAPI* can be installed with:", "")] ===
57
+ similarly, the *XDevAPI* can be installed with:
45
58
 
46
59
  .. code-block:: bash
47
60
 
@@ -50,6 +63,9 @@ The *classic API* can be installed via pip as follows:
50
63
  Please refer to the `installation tutorial <https://dev.mysql.com/doc/dev/connector-python/installation.html>`_
51
64
  for installation alternatives of the XDevAPI.
52
65
 
66
+ .. === </mysqlx> ===
67
+
68
+
53
69
  ++++++++++++++++++++
54
70
  Installation Options
55
71
  ++++++++++++++++++++
@@ -57,11 +73,15 @@ Installation Options
57
73
  Connector packages included in MySQL Connector/Python allow you to install
58
74
  optional dependencies to unleash certain functionalities.
59
75
 
76
+ .. === <mysql> ===
60
77
  .. code-block:: bash
61
78
 
62
79
  # 3rd party packages to unleash the telemetry functionality are installed
63
80
  $ pip install mysql-connector-python[telemetry]
64
81
 
82
+ .. === </mysql> ===
83
+
84
+ .. === <mysqlx> [repl("similarly, for the XDevAPI:", "")] ===
65
85
  similarly, for the XDevAPI:
66
86
 
67
87
  .. code-block:: bash
@@ -69,10 +89,13 @@ similarly, for the XDevAPI:
69
89
  # 3rd party packages to unleash the compression functionality are installed
70
90
  $ pip install mysqlx-connector-python[compression]
71
91
 
92
+ .. === </mysqlx> ===
93
+
72
94
  This installation option can be seen as a shortcut to install all the
73
95
  dependencies needed by a particular feature. Mind that this is optional
74
96
  and you are free to install the required dependencies by yourself.
75
97
 
98
+ .. === <mysql> [repl("Options for the Classic connector:", "Available options:")] ===
76
99
  Options for the Classic connector:
77
100
 
78
101
  * dns-srv
@@ -80,12 +103,17 @@ Options for the Classic connector:
80
103
  * fido2
81
104
  * telemetry
82
105
 
106
+ .. === </mysql> ===
107
+
108
+ .. === <mysqlx> [repl("Options for the XDevAPI connector:", "Available options:")] ===
83
109
  Options for the XDevAPI connector:
84
110
 
85
111
  * dns-srv
86
112
  * compression
87
113
 
114
+ .. === </mysqlx> ===
88
115
 
116
+ .. === <mysql> [repl("Classic", "Sample Code"), repl("-------", "-----------")] ===
89
117
  Classic
90
118
  -------
91
119
 
@@ -113,7 +141,9 @@ Classic
113
141
  # Close connection
114
142
  cnx.close()
115
143
 
144
+ .. === </mysql> ===
116
145
 
146
+ .. === <mysqlx> [repl("XDevAPI", "Sample Code"), repl("-------", "-----------")] ===
117
147
  XDevAPI
118
148
  -------
119
149
 
@@ -145,7 +175,9 @@ XDevAPI
145
175
  # Close session
146
176
  session.close()
147
177
 
178
+ .. === </mysqlx> ===
148
179
 
180
+ .. === <both> [repl-mysql("- `MySQL Connector/Python X DevAPI Reference <https://dev.mysql.com/doc/dev/connector-python/>`_", ""), repl-mysqlx("- `MySQL Connector/Python Developer Guide <https://dev.mysql.com/doc/connector-python/en/>`_", "")] ===
149
181
  Additional Resources
150
182
  --------------------
151
183
 
@@ -157,12 +189,14 @@ Additional Resources
157
189
  - `Stack Overflow <https://stackoverflow.com/questions/tagged/mysql-connector-python>`_
158
190
  - `Oracle Blogs <https://blogs.oracle.com/search.html?q=connector-python>`_
159
191
 
192
+ .. === </both> ===
193
+
160
194
 
161
195
  Contributing
162
196
  ------------
163
197
 
164
198
  There are a few ways to contribute to the Connector/Python code. Please refer
165
- to the `contributing guidelines <CONTRIBUTING.rst>`_ for additional information.
199
+ to the `contributing guidelines <CONTRIBUTING.md>`_ for additional information.
166
200
 
167
201
 
168
202
  License
@@ -0,0 +1,30 @@
1
+ # Reporting security vulnerabilities
2
+
3
+ Oracle values the independent security research community and believes that
4
+ responsible disclosure of security vulnerabilities helps us ensure the security
5
+ and privacy of all our users.
6
+
7
+ Please do NOT raise a GitHub Issue to report a security vulnerability. If you
8
+ believe you have found a security vulnerability, please submit a report to
9
+ secalert_us@oracle.com preferably with a proof of concept. Please review
10
+ some additional information on how to report security vulnerabilities to Oracle
11
+ (see https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html)
12
+ We encourage people who contact Oracle Security to use email encryption using
13
+ our encryption key (see https://www.oracle.com/security-alerts/encryptionkey.html)
14
+
15
+ We ask that you do not use other channels or contact the project maintainers
16
+ directly.
17
+
18
+ # Security updates, alerts and bulletins
19
+
20
+ Security updates will be released on a regular cadence. Many of our projects
21
+ will typically release security fixes in conjunction with the Oracle Critical Patch
22
+ Update program. Additional information, including past advisories, is available on our
23
+ security alerts page at https://www.oracle.com/security-alerts/
24
+
25
+ # Security-related information
26
+
27
+ We will provide security related information such as a threat model, considerations
28
+ for secure use, or any known security issues in our documentation. Please note
29
+ that labs and sample code are intended to demonstrate a concept and may not be
30
+ sufficiently hardened for production use.
@@ -29,11 +29,12 @@
29
29
  """TLS ciphersuites and versions."""
30
30
 
31
31
  # Generated from the OSSA cipher list
32
- # version: 3.3
33
- # date: 2024-01-10
32
+ # version: 3.4
33
+ # date: 2024-04-11
34
34
 
35
35
  from typing import Dict, List
36
36
 
37
+
37
38
  APPROVED_TLS_VERSIONS: List[str] = ["TLSv1.2", "TLSv1.3"]
38
39
  """Approved TLS versions."""
39
40
 
@@ -61,11 +62,6 @@ APPROVED_TLS_CIPHERSUITES: Dict[str, Dict[str, str]] = {
61
62
  "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256": "ECDHE-RSA-CHACHA20-POLY1305",
62
63
  "TLS_ECDHE_ECDSA_WITH_AES_256_CCM": "ECDHE-ECDSA-AES256-CCM",
63
64
  "TLS_ECDHE_ECDSA_WITH_AES_128_CCM": "ECDHE-ECDSA-AES128-CCM",
64
- "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256": "DHE-RSA-AES128-GCM-SHA256",
65
- "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384": "DHE-RSA-AES256-GCM-SHA384",
66
- "TLS_DHE_RSA_WITH_AES_256_CCM": "DHE-RSA-AES256-CCM",
67
- "TLS_DHE_RSA_WITH_AES_128_CCM": "DHE-RSA-AES128-CCM",
68
- "TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256": "DHE-RSA-CHACHA20-POLY1305",
69
65
  },
70
66
  "TLSv1.3": {
71
67
  "TLS_AES_128_GCM_SHA256": "TLS_AES_128_GCM_SHA256",
@@ -79,6 +75,11 @@ APPROVED_TLS_CIPHERSUITES: Dict[str, Dict[str, str]] = {
79
75
 
80
76
  DEPRECATED_TLS_CIPHERSUITES: Dict[str, Dict[str, str]] = {
81
77
  "TLSv1.2": {
78
+ "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256": "DHE-RSA-AES128-GCM-SHA256",
79
+ "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384": "DHE-RSA-AES256-GCM-SHA384",
80
+ "TLS_DHE_RSA_WITH_AES_256_CCM": "DHE-RSA-AES256-CCM",
81
+ "TLS_DHE_RSA_WITH_AES_128_CCM": "DHE-RSA-AES128-CCM",
82
+ "TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256": "DHE-RSA-CHACHA20-POLY1305",
82
83
  "TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8": "ECDHE-ECDSA-AES256-CCM8",
83
84
  "TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8": "ECDHE-ECDSA-AES128-CCM8",
84
85
  "TLS_DHE_RSA_WITH_AES_256_CCM_8": "DHE-RSA-AES256-CCM8",
@@ -32,7 +32,7 @@ The file version.py gets installed and is available after installation
32
32
  as mysqlx.version.
33
33
  """
34
34
 
35
- VERSION = (9, 0, 0, "", 1)
35
+ VERSION = (9, 1, 0, "", 1)
36
36
 
37
37
  # pylint: disable=consider-using-f-string
38
38
  if VERSION[3] and VERSION[4]: