8000 Merge branch 'main' into sanchezg/feat/cursor-as-iterator · sanchezg/PyMySQL@ec8cb09 · GitHub
[go: up one dir, main page]

Skip to content

Commit ec8cb09

Browse files
committed
Merge branch 'main' into sanchezg/feat/cursor-as-iterator
2 parents 0a16347 + 3cd76d7 commit ec8cb09

Some content is hidden

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

42 files changed

+658
-391
lines changed

.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
exclude = tests,build,.venv,docs
3+
ignore = E203,W503,E722
4+
max_line_length=129

.github/FUNDING.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# These are supported funding model platforms
22

3-
github: [methane] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
3+
github: ["methane"] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
44
patreon: # Replace with a single Patreon username
55
open_collective: # Replace with a single Open Collective username
66
ko_fi: # Replace with a single Ko-fi username
7-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
7+
tidelift: "pypi/PyMySQL" # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
88
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
99
liberapay: # Replace with a single Liberapay username
1010
issuehunt: # Replace with a single IssueHunt username

.github/workflows/codeql-analysis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ master ]
16+
branches: [ main ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ master ]
19+
branches: [ main ]
2020
schedule:
2121
- cron: '34 7 * * 2'
2222

@@ -39,7 +39,7 @@ jobs:
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v1
42+
uses: github/codeql-action/init@v2
4343
with:
4444
languages: ${{ matrix.language }}
4545
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,7 +50,7 @@ jobs:
5050
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5151
# If this step fails, then you should remove it and run the build manually (see below)
5252
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v1
53+
uses: github/codeql-action/autobuild@v2
5454

5555
# ℹ️ Command-line programs to run using the OS shell.
5656
# 📚 https://git.io/JvXDl
@@ -64,4 +64,4 @@ jobs:
6464
# make release
6565

6666
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v1
67+
uses: github/codeql-action/analyze@v2

.github/workflows/lint.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ on:
1010

1111
jobs:
1212
lint:
13-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
16-
- uses: actions/setup-python@v2
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-python@v4
17+
with:
18+
python-version: 3.x
1719
- uses: psf/black@stable
1820
with:
19-
args: ". --diff --check"
21+
options: "--check --verbose"
22+
src: "."
2023
- name: Setup flake8 annotations
2124
uses: rbialon/flake8-annotations@v1
2225
- name: flake8

.github/workflows/lock.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ name: 'Lock Threads'
22

33
on:
44
schedule:
5-
- cron: '0 0 * * *'
5+
- cron: '30 9 * * 1'
66

77
permissions:
88
issues: write
99
pull-requests: write
1010

1111
jobs:
12-
action:
12+
lock-threads:
13+
if: github.repository == 'PyMySQL/PyMySQL'
1314
runs-on: ubuntu-latest
1415
steps:
15-
- uses: dessant/lock-threads@v2
16+
- uses: dessant/lock-threads@v4
1617

.github/workflows/test.yaml

Lines changed: 42 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,39 @@ on:
44
push:
55
pull_request:
66

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
9+
cancel-in-progress: true
10+
711
jobs:
812
test:
9-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-latest
1014
strategy:
15+
fail-fast: false
1116
matrix:
1217
include:
13-
- db: "mariadb:10.0"
14-
py: "3.9"
15-
1618
- db: "mariadb:10.3"
1719
py: "3.8"
18-
mariadb_auth: true
1920

2021
- db: "mariadb:10.5"
2122
py: "3.7"
22-
mariadb_auth: true
2323

24-
- db: "mysql:5.6"
25-
py: "3.6"
24+
- db: "mariadb:10.7"
25+
py: "3.11"
26+
27+
- db: "mariadb:10.8"
28+
py: "3.9"
2629

2730
- db: "mysql:5.7"
28-
py: "pypy-3.6"
31+
py: "pypy-3.8"
2932

3033
- db: "mysql:8.0"
3134
py: "3.9"
3235
mysql_auth: true
3336

37+
- db: "mysql:8.0"
38+
py: "3.10"
39+
3440
services:
3541
mysql:
3642
image: "${{ matrix.db }}"
@@ -39,24 +45,28 @@ jobs:
3945
env:
4046
MYSQL_ALLOW_EMPTY_PASSWORD: yes
4147
options: "--name=mysqld"
48+
volumes:
49+
- /run/mysqld:/run/mysqld
4250

4351
steps:
44-
- uses: actions/checkout@v2
52+
- uses: actions/checkout@v3
53+
54+
- name: Workaround MySQL container permissions
55+
if: startsWith(matrix.db, 'mysql')
56+
run: |
57+
sudo chown 999:999 /run/mysqld
58+
/usr/bin/docker ps --all --filter status=exited --no-trunc --format "{{.ID}}" | xargs -r /usr/bin/docker start
59+
4560
- name: Set up Python ${{ matrix.py }}
46-
uses: actions/setup-python@v2
61+
uses: actions/setup-python@v4
4762
with:
4863
python-version: ${{ matrix.py }}
49-
50-
- uses: actions/cache@v2
51-
with:
52-
path: ~/.cache/pip
53-
key: ${{ runner.os }}-pip-1
54-
restore-keys: |
55-
${{ runner.os }}-pip-
64+
cache: 'pip'
65+
cache-dependency-path: 'requirements-dev.txt'
5666

5767
- name: Install dependency
5868
run: |
59-
pip install -U cryptography PyNaCl pytest pytest-cov coveralls
69+
pip install --upgrade -r requirements-dev.txt
6070
6171
- name: Set up MySQL
6272
run: |
@@ -66,15 +76,15 @@ jobs:
6676
mysql -h127.0.0.1 -uroot -e 'select version()' && break
6777
done
6878
mysql -h127.0.0.1 -uroot -e "SET GLOBAL local_infile=on"
69-
mysql -h127.0.0.1 -uroot -e 'create database test1 DEFAULT CHARACTER SET utf8mb4'
70-
mysql -h127.0.0.1 -uroot -e 'create database test2 DEFAULT CHARACTER SET utf8mb4'
71-
mysql -h127.0.0.1 -uroot -e "create user test2 identified ${WITH_PLUGIN} by 'some password'; grant all on test2.* to test2;"
72-
mysql -h127.0.0.1 -uroot -e "create user test2@localhost identified ${WITH_PLUGIN} by 'some password'; grant all on test2.* to test2@localhost;"
79+
mysql -h127.0.0.1 -uroot --comments < ci/docker-entrypoint-initdb.d/init.sql
80+
mysql -h127.0.0.1 -uroot --comments < ci/docker-entrypoint-initdb.d/mysql.sql
81+
mysql -h127.0.0.1 -uroot --comments < ci/docker-entrypoint-initdb.d/mariadb.sql
7382
cp ci/docker.json pymysql/tests/databases.json
7483
7584
- name: Run test
7685
run: |
7786
pytest -v --cov --cov-config .coveragerc pymysql
87+
pytest -v --cov-append --cov-config .coveragerc --doctest-modules pymysql/converters.py
7888
7989
- name: Run MySQL8 auth test
8090
if: ${{ matrix.mysql_auth }}
@@ -84,49 +94,30 @@ jobs:
8494
docker cp mysqld:/var/lib/mysql/server-cert.pem "${HOME}"
8595
docker cp mysqld:/var/lib/mysql/client-key.pem "${HOME}"
8696
docker cp mysqld:/var/lib/mysql/client-cert.pem "${HOME}"
87-
mysql -uroot -h127.0.0.1 -e '
88-
CREATE USER
89-
user_sha256 IDENTIFIED WITH "sha256_password" BY "pass_sha256_01234567890123456789",
90-
nopass_sha256 IDENTIFIED WITH "sha256_password",
91-
user_caching_sha2 IDENTIFIED WITH "caching_sha2_password" BY "pass_caching_sha2_01234567890123456789",
92-
nopass_caching_sha2 IDENTIFIED WITH "caching_sha2_password"
93-
PASSWORD EXPIRE NEVER;
94-
GRANT RELOAD ON *.* TO user_caching_sha2;'
9597
pytest -v --cov --cov-config .coveragerc tests/test_auth.py;
9698
97-
- name: Run MariaDB auth test
98-
if: ${{ matrix.mariadb_auth }}
99-
run: |
100-
mysql -uroot -h127.0.0.1 -e '
101-
INSTALL SONAME "auth_ed25519";
102-
CREATE FUNCTION ed25519_password RETURNS STRING SONAME "auth_ed25519.so";'
103-
# we need to pass the hashed password manually until 10.4, so hide it here
104-
mysql -uroot -h127.0.0.1 -sNe "SELECT CONCAT('CREATE USER nopass_ed25519 IDENTIFIED VIA ed25519 USING \"',ed25519_password(\"\"),'\";');" | mysql -uroot -h127.0.0.1
105-
mysql -uroot -h127.0.0.1 -sNe "SELECT CONCAT('CREATE USER user_ed25519 IDENTIFIED VIA ed25519 USING \"',ed25519_password(\"pass_ed25519\"),'\";');" | mysql -uroot -h127.0.0.1
106-
pytest -v --cov --cov-config .coveragerc tests/test_mariadb_auth.py
107-
10899
- name: Report coverage
100+
if: github.repository == 'PyMySQL/PyMySQL'
109101
run: coveralls --service=github
110102
env:
111103
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112104
COVERALLS_FLAG_NAME: ${{ matrix.py }}-${{ matrix.db }}
113105
COVERALLS_PARALLEL: true
114106

115107
coveralls:
108+
if: github.repository == 'PyMySQL/PyMySQL'
116109
name: Finish coveralls
117-
runs-on: ubuntu-20.04
110+
runs-on: ubuntu-latest
118111
needs: test
119112
steps:
120-
- uses: actions/setup-python@v2
121-
with:
122-
python-version: 3.9
113+
- name: requirements.
114+
run: |
115+
echo coveralls > requirements.txt
123116
124-
- uses: actions/cache@v2
117+
- uses: actions/setup-python@v4
125118
with:
126-
path: ~/.cache/pip
127-
key: finish-pip-1
128-
restore-keys: |
129-
finish-pip-
119+
python-version: '3.x'
120+
cache: 'pip'
130121

131122
- name: Finished
132123
run: |

CHANGELOG.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changes
22

3+
## v1.1.0
4+
5+
Release date: TBD
6+
7+
* Fixed SSCursor raising OperationalError for query timeouts on wrong statement (#1032)
8+
* Exposed `Cursor.warning_count` to check for warnings without additional query (#1056)
9+
10+
11+
## v1.0.3
12+
13+
Release date: TBD
14+
15+
* Dropped support of end of life MySQL version 5.6
16+
* Dropped support of end of life MariaDB versions below 10.3
17+
* Dropped support of end of life Python version 3.6
18+
19+
320
## v1.0.2
421

522
Release date: 2021-01-09
@@ -195,7 +212,7 @@ Release date: 2016-08-30
195212
Release date: 2016-07-29
196213

197214
* Fix SELECT JSON type cause UnicodeError
198-
* Avoid float convertion while parsing microseconds
215+
* Avoid float conversion while parsing microseconds
199216
* Warning has number
200217
* SSCursor supports warnings
201218

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include README.rst 38A6 LICENSE CHANGELOG.md
1+
include README.md LICENSE CHANGELOG.md

0 commit comments

Comments
 (0)
0