Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: moorecode/PyMySQL
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 37fd1e1
Choose a base ref
...
head repository: PyMySQL/PyMySQL
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 01af30f
Choose a head ref

Commits on Dec 10, 2020

  1. Copy the full SHA
    99b703c View commit details

Commits on Jan 2, 2021

  1. Copy the full SHA
    907b453 View commit details
  2. Copy the full SHA
    4e481fa View commit details
  3. Copy the full SHA
    b2e580f View commit details
  4. Copy the full SHA
    2d440df View commit details
  5. Update README.rst

    methane authored Jan 2, 2021
    Copy the full SHA
    1489819 View commit details
  6. Copy the full SHA
    aefbdbe View commit details
  7. Copy the full SHA
    66947bf View commit details

Commits on Jan 3, 2021

  1. Copy the full SHA
    0bcb32a View commit details
  2. Update README.rst

    methane authored Jan 3, 2021
    Copy the full SHA
    8d0c6c2 View commit details
  3. Copy the full SHA
    6ec449a View commit details
  4. Copy the full SHA
    b93a87a View commit details
  5. Copy the full SHA
    f889038 View commit details
  6. Remove _socketio

    methane committed Jan 3, 2021
    Copy the full SHA
    175a3e0 View commit details
  7. Simplify

    methane committed Jan 3, 2021
    Copy the full SHA
    3299afd View commit details
  8. Update flake8 setting

    methane committed Jan 3, 2021
    Copy the full SHA
    587a596 View commit details
  9. Update flake8 setting

    methane committed Jan 3, 2021
    Copy the full SHA
    62108f5 View commit details
  10. Actions: Add lint

    methane committed Jan 3, 2021
    Copy the full SHA
    4185f7f View commit details
  11. black setup.py

    methane committed Jan 3, 2021
    Copy the full SHA
    df14c55 View commit details
  12. reformat black

    methane committed Jan 3, 2021
    Copy the full SHA
    9dc65c0 View commit details
  13. Update README

    methane committed Jan 3, 2021
    Copy the full SHA
    e28c96e View commit details
  14. Actions: Use cache for pip

    methane committed Jan 3, 2021
    Copy the full SHA
    7f44cd7 View commit details
  15. Fix circular import

    methane committed Jan 3, 2021
    Copy the full SHA
    96b7583 View commit details
  16. Actions: Wait MySQL

    methane committed Jan 3, 2021
    Copy the full SHA
    0e5afb1 View commit details
  17. Copy the full SHA
    8810ea9 View commit details
  18. Actions: fix

    methane committed Jan 3, 2021
    Copy the full SHA
    b637c37 View commit details
  19. Remove .travis.yml

    methane committed Jan 3, 2021
    Copy the full SHA
    acce32f View commit details
  20. Update tox.ini

    methane committed Jan 3, 2021
    Copy the full SHA
    27c7228 View commit details
  21. Update example.py

    methane committed Jan 3, 2021
    Copy the full SHA
    0b2dd7e View commit details
  22. Create codeql-analysis.yml

    methane authored Jan 3, 2021
    Copy the full SHA
    58b331e View commit details
  23. Cleanup (PyMySQL#921)

    * Cleanup
    
    * black
    methane authored Jan 3, 2021
    Copy the full SHA
    3481889 View commit details
  24. Copy the full SHA
    cd61e56 View commit details
  25. Add LGTM badge

    methane committed Jan 3, 2021
    Copy the full SHA
    8d3e079 View commit details
  26. remove util.py (PyMySQL#923)

    * remove util.py
    
    * black
    
    * fix
    
    * fix
    methane authored Jan 3, 2021
    Copy the full SHA
    744da2f View commit details
  27. Update docs (PyMySQL#924)

    methane authored Jan 3, 2021
    Copy the full SHA
    17a368b View commit details
  28. Update CHANGELOG

    methane committed Jan 3, 2021
    Copy the full SHA
    1a6b82d View commit details
  29. Copy the full SHA
    f9489ed View commit details

Commits on Jan 4, 2021

  1. Code cleanup (PyMySQL#927)

    * cleanup
    
    * 2to3 -f unicode
    
    * black
    methane authored Jan 4, 2021
    Copy the full SHA
    d9b67a3 View commit details
  2. Use f-string (PyMySQL#928)

    methane authored Jan 4, 2021
    Copy the full SHA
    3818ad0 View commit details
  3. code cleanup (PyMySQL#929)

    methane authored Jan 4, 2021
    Copy the full SHA
    255b5dd View commit details

Commits on Jan 5, 2021

  1. Use keyword only argument (PyMySQL#930)

    * Use keyword only argument for constructor.
    
    * Remove old password test
    methane authored Jan 5, 2021
    Copy the full SHA
    511b6a2 View commit details

Commits on Jan 6, 2021

  1. Remvoe escape_* functions from pymysql.__all__ (PyMySQL#931)

    * .travis -> ci
    
    * remove initializedb.sh
    
    * Remvoe escape functions from __all__
    
    * fix test
    
    * don't use deprecated keyword
    
    * fix tests
    
    * fix tests
    
    * black
    methane authored Jan 6, 2021
    Copy the full SHA
    f5cbb6d View commit details
  2. Copy the full SHA
    e24da41 View commit details

Commits on Jan 7, 2021

  1. Update CHANGELOG

    methane committed Jan 7, 2021
    Copy the full SHA
    66e29fb View commit details
  2. v1.0.0

    methane committed Jan 7, 2021
    Copy the full SHA
    6e5d5bd View commit details
  3. Copy the full SHA
    f65351b View commit details
  4. remove badges

    methane committed Jan 7, 2021
    Copy the full SHA
    5a02e57 View commit details
  5. Copy the full SHA
    5d1e27d View commit details
  6. Remove tox

    methane committed Jan 7, 2021
    Copy the full SHA
    7c4700b View commit details

Commits on Jan 8, 2021

  1. Use built-in unittest.mock (PyMySQL#938)

    Use built-in Python 3 unittest.mock instead of relying on mock package
    that is only necessary for ancient versions of Python.
    mgorny authored Jan 8, 2021
    Copy the full SHA
    0acaa7f View commit details
Showing with 4,086 additions and 3,227 deletions.
  1. +1 −0 .coveragerc
  2. +12 −0 .github/FUNDING.yml
  3. +66 −0 .github/workflows/django.yaml
  4. +24 −0 .github/workflows/lint.yaml
  5. +110 −0 .github/workflows/test.yaml
  6. +1 −0 .gitignore
  7. +17 −0 .readthedocs.yaml
  8. +0 −71 .travis.yml
  9. +0 −4 .travis/database.json
  10. +0 −4 .travis/docker.json
  11. +0 −54 .travis/initializedb.sh
  12. +94 −1 CHANGELOG.md
  13. +1 −1 MANIFEST.in
  14. +106 −0 README.md
  15. +0 −155 README.rst
  16. +5 −0 SECURITY.md
  17. +4 −0 ci/database.json
  18. +12 −0 ci/docker-entrypoint-initdb.d/README
  19. +7 −0 ci/docker-entrypoint-initdb.d/init.sql
  20. +2 −0 ci/docker-entrypoint-initdb.d/mariadb.sql
  21. +8 −0 ci/docker-entrypoint-initdb.d/mysql.sql
  22. +5 −0 ci/docker.json
  23. +47 −0 ci/test_mysql.py
  24. +7 −0 codecov.yml
  25. +0 −24 docs/Makefile
  26. +0 −242 docs/make.bat
  27. +2 −0 docs/requirements.txt
  28. +84 −73 docs/source/conf.py
  29. +2 −2 docs/source/index.rst
  30. +5 −9 docs/source/user/development.rst
  31. +5 −6 docs/source/user/examples.rst
  32. +4 −4 docs/source/user/installation.rst
  33. +1 −4 example.py
  34. +116 −74 pymysql/__init__.py
  35. +30 −85 pymysql/_auth.py
  36. +0 −21 pymysql/_compat.py
  37. +0 −134 pymysql/_socketio.py
  38. +177 −170 pymysql/charset.py
  39. +454 −292 pymysql/connections.py
  40. +10 −3 pymysql/constants/CLIENT.py
  41. +12 −13 pymysql/constants/COMMAND.py
  42. +62 −51 pymysql/constants/CR.py
  43. +3 −0 pymysql/constants/ER.py
  44. +0 −2 pymysql/constants/FIELD_TYPE.py
  45. +0 −1 pymysql/constants/SERVER_STATUS.py
  46. +101 −118 pymysql/converters.py
  47. +135 −109 pymysql/cursors.py
  48. +64 −21 pymysql/err.py
  49. +6 −8 pymysql/optionfile.py
  50. +78 −66 pymysql/protocol.py
  51. +0 −18 pymysql/tests/__init__.py
  52. +28 −38 pymysql/tests/base.py
  53. +33 −25 pymysql/tests/test_DictCursor.py
  54. +178 −52 pymysql/tests/test_SSCursor.py
  55. +163 −85 pymysql/tests/test_basic.py
  56. +44 −0 pymysql/tests/test_charset.py
  57. +549 −182 pymysql/tests/test_connection.py
  58. +10 −23 pymysql/tests/test_converters.py
  59. +146 −32 pymysql/tests/test_cursor.py
  60. +12 −11 pymysql/tests/test_err.py
  61. +117 −106 pymysql/tests/test_issues.py
  62. +48 −13 pymysql/tests/test_load_local.py
  63. +7 −8 pymysql/tests/test_nextset.py
  64. +7 −16 pymysql/tests/test_optionfile.py
  65. +1 −0 pymysql/tests/thirdparty/__init__.py
  66. +1 −2 pymysql/tests/thirdparty/test_MySQLdb/__init__.py
  67. +139 −124 pymysql/tests/thirdparty/test_MySQLdb/capabilities.py
  68. +405 −403 pymysql/tests/thirdparty/test_MySQLdb/dbapi20.py
  69. +43 −32 pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_capabilities.py
  70. +108 −95 pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py
  71. +31 −30 pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py
  72. +0 −13 pymysql/util.py
  73. +67 −0 pyproject.toml
  74. +7 −0 renovate.json
  75. +1 −0 requirements-dev.txt
  76. +0 −17 setup.cfg
  77. +0 −41 setup.py
  78. +61 −7 tests/test_auth.py
  79. +0 −23 tests/test_mariadb_auth.py
  80. +0 −9 tox.ini
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
branch = True
source =
pymysql
tests
omit = pymysql/tests/*
pymysql/tests/thirdparty/test_MySQLdb/*

12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: ["methane"] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: "pypi/PyMySQL" # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
66 changes: 66 additions & 0 deletions .github/workflows/django.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Django test

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

jobs:
django-test:
name: "Run Django LTS test suite"
runs-on: ubuntu-latest
# There are some known difference between MySQLdb and PyMySQL.
continue-on-error: true
env:
PIP_NO_PYTHON_VERSION_WARNING: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1
# DJANGO_VERSION: "3.2.19"
strategy:
fail-fast: false
matrix:
include:
# Django 3.2.9+ supports Python 3.10
# https://docs.djangoproject.com/ja/3.2/releases/3.2/
- django: "3.2.19"
python: "3.10"

- django: "4.2.1"
python: "3.11"

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:
python-version: ${{ matrix.python }}

- name: Install mysqlclient
run: |
#pip install mysqlclient # Use stable version
pip install .[rsa]
- name: Setup Django
run: |
sudo apt-get install libmemcached-dev
wget https://github.com/django/django/archive/${{ matrix.django }}.tar.gz
tar xf ${{ matrix.django }}.tar.gz
cp ci/test_mysql.py django-${{ matrix.django }}/tests/
cd django-${{ matrix.django }}
pip install . -r tests/requirements/py3.txt
- name: Run Django test
run: |
cd django-${{ matrix.django }}/tests/
# test_runner does not using our test_mysql.py
# We can't run whole django test suite for now.
# Run olly backends test
DJANGO_SETTINGS_MODULE=test_mysql python runtests.py backends
24 changes: 24 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint

on:
push:
branches: ["main"]
paths:
- '**.py'
pull_request:
paths:
- '**.py'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: astral-sh/ruff-action@v3

- name: format
run: ruff format --diff

- name: lint
run: ruff check --diff
110 changes: 110 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Test

on:
push:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

env:
FORCE_COLOR: 1

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- db: "mariadb:10.4"
py: "3.13"

- db: "mariadb:10.5"
py: "3.11"

- db: "mariadb:10.6"
py: "3.10"

- db: "mariadb:10.6"
py: "3.9"

- db: "mariadb:lts"
py: "3.8"

- db: "mysql:5.7"
py: "pypy-3.10"

- db: "mysql:8.0"
py: "3.13"
mysql_auth: true

- db: "mysql:8.4"
py: "3.8"
mysql_auth: true

services:
mysql:
image: "${{ matrix.db }}"
ports:
- 3306:3306
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: yes
options: "--name=mysqld"
volumes:
- /run/mysqld:/run/mysqld

steps:
- uses: actions/checkout@v4

- name: Workaround MySQL container permissions
if: startsWith(matrix.db, 'mysql')
run: |
sudo chown 999:999 /run/mysqld
/usr/bin/docker ps --all --filter status=exited --no-trunc --format "{{.ID}}" | xargs -r /usr/bin/docker start
- name: Set up Python ${{ matrix.py }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
allow-prereleases: true
cache: 'pip'
cache-dependency-path: 'requirements-dev.txt'

- name: Install dependency
run: |
pip install --upgrade -r requirements-dev.txt
- name: Set up MySQL
run: |
while :
do
sleep 1
mysql -h127.0.0.1 -uroot -e 'select version()' && break
done
mysql -h127.0.0.1 -uroot -e "SET GLOBAL local_infile=on"
mysql -h127.0.0.1 -uroot --comments < ci/docker-entrypoint-initdb.d/init.sql
mysql -h127.0.0.1 -uroot --comments < ci/docker-entrypoint-initdb.d/mysql.sql
mysql -h127.0.0.1 -uroot --comments < ci/docker-entrypoint-initdb.d/mariadb.sql
cp ci/docker.json pymysql/tests/databases.json
- name: Run test
run: |
pytest -v --cov --cov-config .coveragerc pymysql
pytest -v --cov-append --cov-config .coveragerc --doctest-modules pymysql/converters.py
- name: Run MySQL8 auth test
if: ${{ matrix.mysql_auth }}
run: |
docker cp mysqld:/var/lib/mysql/public_key.pem "${HOME}"
docker cp mysqld:/var/lib/mysql/ca.pem "${HOME}"
docker cp mysqld:/var/lib/mysql/server-cert.pem "${HOME}"
docker cp mysqld:/var/lib/mysql/client-key.pem "${HOME}"
docker cp mysqld:/var/lib/mysql/client-cert.pem "${HOME}"
pytest -v --cov-append --cov-config .coveragerc tests/test_auth.py;
- name: Upload coverage reports to Codecov
if: github.repository == 'PyMySQL/PyMySQL'
uses: codecov/codecov-action@v5
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -13,3 +13,4 @@
/pymysql/tests/databases.json
__pycache__
Pipfile.lock
pdm.lock
17 changes: 17 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.12"

python:
install:
- requirements: docs/requirements.txt

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
71 changes: 0 additions & 71 deletions .travis.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .travis/database.json

This file was deleted.

4 changes: 0 additions & 4 deletions .travis/docker.json

This file was deleted.

54 changes: 0 additions & 54 deletions .travis/initializedb.sh

This file was deleted.

Loading