Skip to content

Remove python2 and mysql5.7 code #515

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
18 changes: 5 additions & 13 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: PyTest
on: [push, pull_request]
on: [ push, pull_request ]
env:
PYTEST_SKIP_OPTION: "not test_no_trailing_rotate_event and not test_end_log_pos and not test_query_event_latin1"
jobs:
Expand All @@ -8,10 +8,10 @@ jobs:
fail-fast: false
matrix:
include:
- {name: 'CPython 3.7', python: '3.7'}
- {name: 'CPython 3.11', python: '3.11'}
- {name: 'Pypy 3.7', python: 'pypy-3.7'}
- {name: 'Pypy 3.9', python: 'pypy-3.9'}
- { name: 'CPython 3.7', python: '3.7' }
- { name: 'CPython 3.11', python: '3.11' }
- { name: 'Pypy 3.7', python: 'pypy-3.7' }
- { name: 'Pypy 3.9', python: 'pypy-3.9' }
name: ${{ matrix.name }}
runs-on: ubuntu-latest
timeout-minutes: 3
Expand Down Expand Up @@ -46,14 +46,6 @@ jobs:
pip install .
pip install pytest

- name: Run tests for mysql-5
working-directory: pymysqlreplication/tests
run: pytest -k "$PYTEST_SKIP_OPTION" --db=mysql-5

- name: Run tests for mysql-5-ctl
working-directory: pymysqlreplication/tests
run: pytest -k "$PYTEST_SKIP_OPTION" --db=mysql-5-ctl

- name: Run tests for mysql-8
working-directory: pymysqlreplication/tests
run: pytest -k "$PYTEST_SKIP_OPTION" --db=mysql-8
Expand Down
23 changes: 1 addition & 22 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,6 @@ x-mariadb: &mariadb
--binlog-format=row

services:
percona-5.7-ctl:
<<: *mysql
image: percona:5.7
ports:
- "3307:3306"
networks:
- default

percona-5.7:
<<: *mysql
image: percona:5.7
ports:
- "3306:3306"
networks:
- default

percona-8.0:
<<: *mysql
image: percona:8.0
Expand Down Expand Up @@ -67,9 +51,6 @@ services:
dockerfile: test.Dockerfile
args:
BASE_IMAGE: python:3.11-alpine
MYSQL_5_7: percona-5.7
MYSQL_5_7_CTL: percona-5.7-ctl
MYSQL_5_7_CTL_PORT: 3306
MYSQL_8_0: percona-8.0
MYSQL_8_0_PORT: 3306
MARIADB_10_6: mariadb-10.6
Expand All @@ -83,7 +64,7 @@ services:

while :
do
if mysql -h percona-5.7 --user=root --execute "SELECT version();" 2>&1 >/dev/null && mysql -h percona-5.7-ctl --user=root --execute "SELECT version();" 2>&1 >/dev/null && mysql -h percona-8.0 --user=root --execute "SELECT version();" 2>&1 >/dev/null; then
if mysql -h percona-8.0 --user=root --execute "SELECT version();" 2>&1 >/dev/null; then
break
fi
sleep 1
Expand All @@ -96,8 +77,6 @@ services:
networks:
- default
depends_on:
- percona-5.7
- percona-5.7-ctl
- percona-8.0

networks:
Expand Down
14 changes: 4 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,17 @@ x-mariadb: &mariadb
--binlog-format=row

services:
percona-5.7:
percona-8.0:
<<: *mysql
image: percona:5.7
image: percona:8.0
ports:
- "3306:3306"

percona-5.7-ctl:
<<: *mysql
image: percona:5.7
ports:
- "3307:3306"

percona-8.0:
percona-8.0-ctl:
<<: *mysql
image: percona:8.0
ports:
- "3309:3306"
- "3307:3306"

mariadb-10.6:
<<: *mariadb
Expand Down
4 changes: 2 additions & 2 deletions pymysqlreplication/binlogstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def __checksum_enabled(self):

if result is None:
return False
var, value = result[:2]
_, value = result[:2]
if value == "NONE":
return False
return True
Expand Down Expand Up @@ -587,7 +587,7 @@ def fetchone(self):
else:
pkt = self._stream_connection._read_packet()
except pymysql.OperationalError as error:
code, message = error.args
code, _ = error.args
if code in MYSQL_EXPECTED_ERROR_CODES:
self._stream_connection.close()
self.__connected_stream = False
Expand Down
Loading