Skip to content

Commit c4daa3a

Browse files
authored
update mysql-connector-python (#695)
* [py] python version > https://devguide.python.org/versions/ - remove python3.8 * [#693] update mysql-connector-python > #693
1 parent ad5bda5 commit c4daa3a

File tree

17 files changed

+107
-31
lines changed

17 files changed

+107
-31
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ jobs:
247247
strategy:
248248
matrix:
249249
os: [ubuntu-latest, macos-13]
250-
python-version: ["3.8", "3.9", "3.10", "3.11"]
250+
python-version: ["3.9", "3.10", "3.11","3.12","3.13"]
251251
runs-on: ${{ matrix.os }}
252252
needs: [cpp, cpp-windows]
253253
steps:
@@ -276,10 +276,13 @@ jobs:
276276
# run: docker-compose -f "testapps/compose.yaml" build python-plugins
277277
# - name: build python-plugins
278278
- name: start test environment
279-
run: ./docker-compose-linux-x86_64 -f "testapps/compose.yaml" up python-plugins --exit-code-from python-plugins
279+
run: |
280+
./docker-compose-linux-x86_64 -f "testapps/compose.yaml" up py3.9-plugins --exit-code-from py3.9-plugins
281+
./docker-compose-linux-x86_64 -f "testapps/compose.yaml" up py-plugins --exit-code-from py-plugins
282+
./docker-compose-linux-x86_64 -f "testapps/compose.yaml" up py3.11-plugins --exit-code-from py3.11-plugins
280283
- name: Stop containers
281284
# if: always()
282-
run: ./docker-compose-linux-x86_64 -f "testapps/compose.yaml" down python-plugins
285+
run: ./docker-compose-linux-x86_64 -f "testapps/compose.yaml" down py3.11-plugins py-plugins py3.9-plugins
283286

284287
Collector-agent:
285288
strategy:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Our advantage:
3939

4040
## Python Agent
4141

42-
> py 3.8+
42+
> py 3.9+
4343
4444
`pip install pinpointPy`
4545

Readme-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Pinpoint-c-agent 帮助您接入 [pinpoint-apm](https://github.com/pinpoint-apm/
3232

3333
## Python Agent
3434

35-
> py 3.8+
35+
> py 3.9+
3636
3737
`pip install pinpointPy`
3838

Readme-KR.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Pinpoint-c-agent는 [pinpoint-apm](https://github.com/pinpoint-apm/pinpoint) 모
3131

3232
## Python Agent
3333

34-
> py 3.8+
34+
> py 3.9+
3535
3636
`pip install pinpointPy`
3737

plugins/PY/pinpointPy/libs/_MysqlConnector/CMysqlPlugin.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@
1515
# ------------------------------------------------------------------------------
1616

1717
from pinpointPy import Common, Defines, pinpoint
18+
import mysql
19+
import warnings
20+
21+
#
1822

1923

2024
class CMysqlPlugin(Common.PinTrace):
2125

2226
def __init__(self, name):
27+
warnings.warn(
28+
"CMysqlPlugin is deprecated, please use MysqlPlugin instead", DeprecationWarning)
2329
super().__init__(name)
2430

2531
# -> tuple[Any, tuple[Any, ...], dict[str, Any]]:
@@ -48,4 +54,5 @@ def onException(self, traceId, e):
4854
pinpoint.add_exception(f'{e}', traceId)
4955

5056
def get_cursor_host(self, cursor):
51-
return f'{cursor._cnx.server_host}:{cursor._cnx.server_port}'
57+
# https://github.com/mysql/mysql-connector-python/blob/4fbf521f1c6c71621f882f89c0c4946c10ee13ac/mysql-connector-python/lib/mysql/connector/abstracts.py#L692
58+
return f'{cursor._connection._host}:{cursor._connection._host}'

plugins/PY/pinpointPy/libs/_MysqlConnector/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,9 @@ def monkey_patch():
5555

5656

5757
__all__ = ['monkey_patch']
58-
__version__ = '0.0.5'
58+
__version__ = '0.0.6'
5959
__author__ = '[email protected]'
60+
61+
# Changes
62+
# ## 0.0.6
63+
# - remove `CMySQLCursor` and `CMySQLCursorPrepared`

plugins/PY/requirements.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
bottle==0.12.25
2-
fastapi==0.111.0
3-
flask==3.0.0
4-
httpx==0.25.1
5-
mysql-connector-python==8.0.31
6-
pymongo==4.6.3
7-
PyMySQL==1.1.1
8-
redis==5.0.1
9-
requests==2.31.0
10-
SQLAlchemy==2.0.23
11-
starlette-context==0.3.6
12-
mysqlclient==2.2.0
1+
bottle
2+
fastapi
3+
flask
4+
httpx
5+
mysql-connector-python
6+
pymongo
7+
PyMySQL
8+
redis
9+
requests
10+
SQLAlchemy
11+
starlette-context
12+
mysqlclient
1313
grpcio
14-
grpc-interceptor==0.15.4
14+
grpc-interceptor
1515
psycopg2
1616
pinpointPy

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
Path(cwd, './common/src')]
4040

4141
setup(name='pinpointPy',
42-
version="1.3.1", # don't forget update __version__ in pinpointPy/__init__.py
42+
version="1.3.2", # don't forget update __version__ in pinpointPy/__init__.py
4343
author="cd_pinpoint members",
4444
author_email='[email protected]',
4545
license='Apache License 2.0',

setup_pypi_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
Path(cwd, './common/src')]
3838

3939
setup(name='pinpointPy',
40-
version="1.3.6", # don't forget update __version__ in pinpointPy/__init__.py
40+
version="1.3.7", # don't forget update __version__ in pinpointPy/__init__.py
4141
author="cd_pinpoint members",
4242
author_email='[email protected]',
4343
license='Apache License 2.0',

testapps/compose.yaml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,41 @@ services:
224224
ports:
225225
- 27017:27017
226226

227-
python-plugins:
227+
py3.9-plugins:
228228
build:
229-
dockerfile: testapps/python-plugins.dockerfile
229+
dockerfile: testapps/python-plugins/py3.9-plugins.dockerfile
230+
context: ../
231+
profiles:
232+
- testing
233+
depends_on:
234+
redis:
235+
condition: service_healthy
236+
httpbin:
237+
condition: service_healthy
238+
mongodb:
239+
condition: service_healthy
240+
postgres:
241+
condition: service_healthy
242+
243+
py3.11-plugins:
244+
build:
245+
dockerfile: testapps/python-plugins/py3.11-plugins.dockerfile
246+
context: ../
247+
profiles:
248+
- testing
249+
depends_on:
250+
redis:
251+
condition: service_healthy
252+
httpbin:
253+
condition: service_healthy
254+
mongodb:
255+
condition: service_healthy
256+
postgres:
257+
condition: service_healthy
258+
259+
py-plugins:
260+
build:
261+
dockerfile: testapps/python-plugins/py-plugins.dockerfile
230262
context: ../
231263
profiles:
232264
- testing

0 commit comments

Comments
 (0)