Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Connection.py #713

Open
wants to merge 86 commits into
base: sqla
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
8b92077
Action: Run Django tests (#519)
methane Oct 20, 2021
6ebc1a1
Fix typos (#520)
kianmeng Nov 17, 2021
5340191
2.1.0
methane Nov 17, 2021
2316313
Add __module__ attributes to exception classes. (#523)
methane Jan 10, 2022
9729618
Create SECURITY.md
methane Apr 15, 2022
c1c812a
Fix out of range bug (#538)
methane Apr 17, 2022
6979a47
Fix docstring for _mysql.connect (#540)
Llewyllen Jun 2, 2022
aafdec8
Action: Update Windows wheel build (#541)
methane Jun 22, 2022
78caa9e
v2.1.1
methane Jun 22, 2022
684dcbf
Actions: Drop Python 3.6 and add 3.11-dev (#542)
methane Jun 22, 2022
dac24e7
Update metadata
methane Jun 22, 2022
f5a2f3d
docs: fix simple typo, portible -> portable (#547)
timgates42 Aug 5, 2022
d288d3e
Update python_requires to 3.7+ (#543)
gopackgo90 Sep 19, 2022
8f0cbac
Raise ProgrammingError on -inf (#557)
methane Sep 20, 2022
6f5fca0
swap 3.11-dev for 3.11 in CI (#561)
joshuadavidthomas Oct 28, 2022
0914c8c
Add CodeQL workflow for GitHub code scanning (#565)
lgtm-com[bot] Nov 10, 2022
da4c072
Add .readthedocs.yaml
methane Jan 17, 2023
589740a
RTD: Use Python 3.8
methane Jan 17, 2023
cc1b042
RTD: Use ubuntu-22.04
methane Jan 17, 2023
b419bea
RTD: Fix yaml
methane Jan 17, 2023
58465cf
ER_BAD_NULL should be IntegrityError. (#579)
methane Mar 13, 2023
17c4e46
Update security policy.
methane Mar 31, 2023
d065827
Update windows build workflow (#585)
methane May 7, 2023
14538b2
Use pkg-config instead of mysql_config (#586)
methane May 9, 2023
aed1dd2
Remove uneeded code. (#512)
methane May 9, 2023
df52e23
Add collation option (#564)
vsalvino May 9, 2023
c56fc43
Start 2.2.0 development (#587)
methane May 9, 2023
418b68d
Action: Use Ruff (#588)
methane May 9, 2023
1f906e6
Run pyupgrade --py38-plus (#590)
methane May 9, 2023
d2c07e8
Update workflows (#593)
methane May 9, 2023
869fe10
Update Django test workflow (#594)
methane May 9, 2023
1f4fb4d
CI: Update codeql build. (#595)
methane May 9, 2023
b7255d3
Improved exception handling when importing the module (#596)
piglei May 10, 2023
cbd894c
CI: Fix django workflow (#597)
methane May 10, 2023
89c1e0f
Use pyproject.toml (#598)
methane May 15, 2023
9953e50
Add Cursor.mogrify(). (#477)
May 15, 2023
abb139b
Support ssl_mode setting with mariadb client (#475)
thereisnosun May 15, 2023
0220f42
Use src-layout. (#600)
methane May 15, 2023
a2e9706
Discard results without converting them into Python objects. (#601)
methane May 16, 2023
3517eb7
Fix sphinx warnings (#602)
methane May 17, 2023
3d6b8c9
Release GIL during result.discard() (#604)
methane May 18, 2023
62f0645
Fix executemany with binary prefix (#605)
methane May 18, 2023
44d0f7a
CI: Fix Django test (#606)
methane May 18, 2023
b162ddd
Fix Connection.escape() with Unicode input (#608)
methane May 18, 2023
ba85984
Update README.md
methane May 18, 2023
398208f
Fix mariadbclient SSL support (#609)
mschoettle May 18, 2023
5dfab4d
CI: Update Django test workflow (#610)
methane May 18, 2023
640fe6d
Release v2.2.0rc1 (#607)
methane May 19, 2023
d48c852
CI: Fix Windows wheel build workflow
methane May 19, 2023
c650aa0
CI: Use MariaDB (#611)
methane May 20, 2023
d05a00e
ci: Run django test after our test (#612)
methane May 20, 2023
ae1a098
Configure Renovate (#616)
renovate[bot] Jun 21, 2023
1e14055
Release v2.2.0 (#618)
methane Jun 22, 2023
eb5cb3d
Add build dependency for `pkg-config` to README (#621)
hamarituc Jun 22, 2023
df302ff
Add discussion template
methane Jun 22, 2023
020f040
Add issue template config
methane Jun 22, 2023
1b29c60
Update bugreport issue template
methane Jun 22, 2023
4f2a839
update issue config
methane Jun 22, 2023
807933e
Support pkg-config libmariadb (#631)
methane Jun 29, 2023
1468dce
Update README.md (#633)
raceybe Jun 30, 2023
8878212
Move issue report to discussions
methane Jul 1, 2023
fc6b9da
fix templates
methane Jul 1, 2023
a72b7aa
ci: add Python 3.12 in test matrix (#644)
stegayet Aug 21, 2023
91c0428
Update actions/checkout action to v4 (#654)
renovate[bot] Sep 12, 2023
0d0fff7
Do not use MYSQL_OPT_RECONNECT as possible. (#664)
methane Nov 13, 2023
cb236e9
add bash syntax highlighting to `README.md` (#665)
Benjamin-Loison Nov 13, 2023
2e86cce
use sphinx-rtd-theme (#668)
methane Nov 15, 2023
3805b28
docs: Improve portability of brew prefix (#667)
davemcphee Nov 15, 2023
f82dac3
chore(deps): update dependency sphinx-rtd-theme to v2 (#671)
renovate[bot] Nov 28, 2023
16017b7
chore(deps): update actions/setup-python action to v5 (#674)
renovate[bot] Dec 7, 2023
6831bc2
win: update mariadb connector/c to 3.3.8 (#676)
methane Dec 8, 2023
d82d0fd
Release v2.2.1 (#679)
methane Dec 13, 2023
f67ad12
chore(deps): update github/codeql-action action to v3 (#680)
renovate[bot] Dec 14, 2023
a2212b3
chore(deps): update actions/upload-artifact action to v4 (#681)
renovate[bot] Dec 15, 2023
e2a908b
update actions/cache action to v4 (#684)
renovate[bot] Jan 18, 2024
9e3b00f
chore(deps): update codecov/codecov-action action to v4 (#689)
renovate[bot] Feb 1, 2024
720b804
Support MySQL 8.3 (#690)
methane Feb 3, 2024
2570ad4
use ruff for formatter (#691)
methane Feb 4, 2024
8b032d1
doc: add link to README (#692)
methane Feb 4, 2024
ace8b25
deprecate APIs deprecated in MySQL 8
methane Feb 4, 2024
7c199a9
release 2.2.2 (#693)
methane Feb 4, 2024
b34f8ef
fix build issue introduced in 2.2.2 (#696)
methane Feb 4, 2024
1fa31fd
release 2.2.3 (#697)
methane Feb 4, 2024
a7e3887
Support `ssl=True` (#700)
methane Feb 8, 2024
9fd238b
release 2.2.4 (#701)
methane Feb 8, 2024
2c9e78d
Update connections.py
Ishanv5 Mar 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/DISCUSSION_TEMPLATE/build-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
title: "[Build] "
body:
- type: input
id: os
attributes:
label: What OS and which version do you use?
description: |
e.g.
- Windows 11
- macOS 13.4
- Ubuntu 22.04

- type: textarea
id: libmysqlclient
attributes:
label: How did you installed mysql client library?
description: |
e.g.
- `apt-get install libmysqlclient-dev`
- `brew install mysql-client`
- `brew install mysql`
render: bash

- type: textarea
id: pkgconfig-output
attributes:
label: Output from `pkg-config --cflags --libs mysqlclient`
description: If you are using mariadbclient, run `pkg-config --cflags --libs mariadb` instead.
render: bash

- type: input
id: mysqlclient-install
attributes:
label: How did you tried to install mysqlclient?
description: |
e.g.
- `pip install mysqlclient`
- `poetry add mysqlclient`

- type: textarea
id: mysqlclient-error
attributes:
label: Output of building mysqlclient
description: not only error message. full log from start installing mysqlclient.
render: bash




93 changes: 93 additions & 0 deletions .github/DISCUSSION_TEMPLATE/issue-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
body:
- type: markdown
attributes:
value: |
Failed to buid? [Use this form](https://github.com/PyMySQL/mysqlclient/discussions/new?category=build-issue).

We don't use this issue tracker to help users.
Please use this tracker only when you are sure about it is an issue of this software.

If you had trouble, please ask it on some user community.

- [Python Discord](https://www.pythondiscord.com/)
For general Python questions, including developing application using MySQL.

- [MySQL Community Slack](https://lefred.be/mysql-community-on-slack/)
For general MySQL questions.

- [mysqlclient Discuss](https://github.com/PyMySQL/mysqlclient/discussions)
For mysqlclient specific topics.

- type: textarea
id: describe
attributes:
label: Describe the bug
description: "A **clear and concise** description of what the bug is."

- type: textarea
id: environments
attributes:
label: Environment
description: |
- Server and version (e.g. MySQL 8.0.33, MariaDB 10.11.4)
- OS (e.g. Windows 11, Ubuntu 22.04, macOS 13.4.1)
- Python version

- type: input
id: libmysqlclient
attributes:
label: How did you install libmysqlclient libraries?
description: |
e.g. brew install mysql-cleint, brew install mariadb, apt-get install libmysqlclient-dev

- type: input
id: mysqlclient-version
attributes:
label: What version of mysqlclient do you use?

- type: markdown
attributes:
value: |
## Complete step to reproduce.
#
Do not expect maintainer complement any piece of code, schema, and data need to reproduce.
You need to provide **COMPLETE** step to reproduce.

It is very recommended to use Docker to start MySQL server.
Maintainer can not use your Database to reproduce your issue.

**If you write only little code snippet, maintainer may close your issue
without any comment.**

- type: textarea
id: reproduce-docker
attributes:
label: Docker command to start MySQL server
render: bash
description: e.g. `docker run -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -p 3306:3306 --rm --name mysql mysql:8.0`

- type: textarea
id: reproduce-code
attributes:
label: Minimum but complete code to reproduce
render: python
value: |
# Write Python code here.
import MySQLdb

conn = MySQLdb.connect(host='127.0.0.1', port=3306, user='root')
...

- type: textarea
id: reproduce-schema
attributes:
label: Schema and initial data required to reproduce.
render: sql
value: |
-- Write SQL here.
-- e.g. CREATE TABLE ...

- type: textarea
id: reproduce-other
attributes:
label: Commands, and any other step required to reproduce your issue.
58 changes: 0 additions & 58 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
contact_links:
- name: Failed to build
about: Ask help for build error.
url: "https://github.com/PyMySQL/mysqlclient/discussions/new?category=build-issue"

- name: Report issue
about: Found bug?
url: "https://github.com/PyMySQL/mysqlclient/discussions/new?category=issue-report"

- name: Ask question
about: Ask other questions.
url: "https://github.com/PyMySQL/mysqlclient/discussions/new?category=q-a"
20 changes: 9 additions & 11 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
name: Lint

on: [push, pull_request]
on:
push:
branches: ["main"]
pull_request:

jobs:
lint:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@stable
- name: Setup flake8 annotations
uses: rbialon/flake8-annotations@v1
- name: flake8
run: |
pip install flake8
flake8 --ignore=E203,E501,W503 --max-line-length=88 .
- uses: actions/checkout@v4
- run: pipx install ruff
- run: ruff check src/
- run: ruff format src/
105 changes: 83 additions & 22 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,109 @@ name: Test

on:
push:
branches: ["main"]
pull_request:

jobs:
build:
runs-on: ubuntu-20.04
test:
runs-on: ubuntu-latest
env:
PIP_NO_PYTHON_VERSION_WARNING: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
include:
- python-version: "3.11"
mariadb: 1
steps:
- name: Start MySQL
- if: ${{ matrix.mariadb }}
name: Start MariaDB
# https://github.com/actions/runner-images/blob/9d9b3a110dfc98100cdd09cb2c957b9a768e2979/images/linux/scripts/installers/mysql.sh#L10-L13
run: |
docker pull mariadb:10.11
docker run -d -e MARIADB_ROOT_PASSWORD=root -p 3306:3306 --rm --name mariadb mariadb:10.11
sudo apt-get -y install libmariadb-dev
mysql --version
mysql -uroot -proot -h127.0.0.1 -e "CREATE DATABASE mysqldb_test"

- if: ${{ !matrix.mariadb }}
name: Start MySQL
run: |
sudo systemctl start mysql.service
mysql --version
mysql -uroot -proot -e "CREATE DATABASE mysqldb_test"

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-1
restore-keys: |
${{ runner.os }}-pip-

- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "requirements.txt"
allow-prereleases: true

- name: Install dependencies
env:
PIP_NO_PYTHON_VERSION_WARNING: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1
- name: Install mysqlclient
run: |
pip install -U coverage pytest pytest-cov
python setup.py develop
pip install -v .

- name: Install test dependencies
run: |
pip install -r requirements.txt

- name: Run tests
env:
TESTDB: actions.cnf
run: |
pytest --cov=MySQLdb tests

- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4

django-test:
name: "Run Django LTS test suite"
needs: test
runs-on: ubuntu-latest
env:
PIP_NO_PYTHON_VERSION_WARNING: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1
DJANGO_VERSION: "3.2.19"
steps:
- name: Start MySQL
run: |
sudo systemctl start mysql.service
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot -proot mysql
mysql -uroot -proot -e "set global innodb_flush_log_at_trx_commit=0;"
mysql -uroot -proot -e "CREATE USER 'scott'@'%' IDENTIFIED BY 'tiger'; GRANT ALL ON *.* TO scott;"
mysql -uroot -proot -e "CREATE DATABASE django_default; CREATE DATABASE django_other;"

- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
# Django 3.2.9+ supports Python 3.10
# https://docs.djangoproject.com/ja/3.2/releases/3.2/
python-version: "3.10"
cache: "pip"
cache-dependency-path: "ci/django-requirements.txt"

- name: Install mysqlclient
run: |
#pip install -r requirements.txt
#pip install mysqlclient # Use stable version
pip install .

- name: Setup Django
run: |
sudo apt-get install libmemcached-dev
wget https://github.com/django/django/archive/${DJANGO_VERSION}.tar.gz
tar xf ${DJANGO_VERSION}.tar.gz
cp ci/test_mysql.py django-${DJANGO_VERSION}/tests/
cd django-${DJANGO_VERSION}
pip install . -r tests/requirements/py3.txt

- name: Run Django test
run: |
cd django-${DJANGO_VERSION}/tests/
PYTHONPATH=.. python3 ./runtests.py --settings=test_mysql
Loading
Loading