Skip to content

Commit b382f13

Browse files
committed
update mysql-connector-python (pinpoint-apm#695)
* [py] python version > https://devguide.python.org/versions/ - remove python3.8 * [pinpoint-apm#693] update mysql-connector-python > pinpoint-apm#693 # Conflicts: # setup.py # setup_pypi_test.py
1 parent 7276575 commit b382f13

File tree

15 files changed

+105
-29
lines changed

15 files changed

+105
-29
lines changed

.github/workflows/main.yml

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

285288
Collector-agent:
286289
strategy:

README.md

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

3636
## Python Agent
3737

38-
> py 3.8+
38+
> py 3.9+
3939
4040
`pip install pinpointPy`
4141

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

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

testapps/django.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.8
1+
FROM python:3.12
22
WORKDIR /app/
33

44
COPY testapps/django/mysite/ /app/

testapps/fastapi.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.8
1+
FROM python:3.12
22
WORKDIR /app/
33

44
COPY testapps/fastapi/ /app/

0 commit comments

Comments
 (0)