Skip to content

Commit

Permalink
ci: release rc2
Browse files Browse the repository at this point in the history
  • Loading branch information
long2ice committed Feb 1, 2023
1 parent 4b98cf0 commit 133aee8
Show file tree
Hide file tree
Showing 8 changed files with 636 additions and 597 deletions.
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MYSQL_PASS ?= "123456"
up:
@poetry update

deps:
deps:
@poetry install

style: deps
Expand All @@ -14,7 +14,7 @@ style: deps

check: deps
@black --check $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
@pflake8 $(checkfiles)
@ruff $(checkfiles)
@bandit -x tests -r $(checkfiles)
@mypy $(checkfiles)

Expand All @@ -24,8 +24,7 @@ test: deps
clean:
@rm -rf *.so && rm -rf build && rm -rf dist && rm -rf asyncmy/*.c && rm -rf asyncmy/*.so

build:
@pip install cython
build: clean
@poetry build

benchmark: deps
Expand Down
3 changes: 2 additions & 1 deletion asyncmy/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ def sha2_rsa_encrypt(password, salt, public_key):
"""
if not _have_cryptography:
raise RuntimeError(
"'cryptography' package is required for sha256_password or caching_sha2_password auth methods"
"'cryptography' package is required for sha256_password "
"or caching_sha2_password auth methods"
)
message = _xor_password(password + b"\0", salt)
rsa_key = serialization.load_pem_public_key(public_key, default_backend())
Expand Down
18 changes: 11 additions & 7 deletions asyncmy/replication/row_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@ def rows(self):
class DeleteRowsEvent(RowsEvent):
"""This event is trigger when a row in the database is removed
For each row you have a hash with a single key: values which contain the data of the removed line.
For each row you have a hash with a single key: values which contain
the data of the removed line.
"""

def __init__(self, from_packet, event_size, table_map, ctl_connection, **kwargs):
Expand Down Expand Up @@ -589,24 +590,27 @@ async def init(self):
try:
column_schema = self.column_schemas[ordinal_pos_loc]

# only acknowledge the column definition if the iteration matches with ordinal position of
# only acknowledge the column definition if the iteration matches
# with ordinal position of
# the column. this helps in maintaining support for restricted columnar access
if i != (column_schema["ORDINAL_POSITION"] - 1):
# raise IndexError to follow the workflow of dropping columns which are not matching the
# raise IndexError to follow the workflow of dropping
# columns which are not matching the
# underlying table schema
raise IndexError

ordinal_pos_loc += 1
except IndexError:
# this a dirty hack to prevent row events containing columns which have been dropped prior
# to pymysqlreplication start, but replayed from binlog from blowing up the service.
# TODO: this does not address the issue if the column other than the last one is dropped
# this a dirty hack to prevent row events containing columns
# which have been dropped prior
# to pymysqlreplication start, but replayed from binlog
# from blowing up the service.
column_schema = {
"COLUMN_NAME": "__dropped_col_{i}__".format(i=i),
"COLLATION_NAME": None,
"CHARACTER_SET_NAME": None,
"COLUMN_COMMENT": None,
"COLUMN_TYPE": "BLOB", # we don't know what it is, so let's not do anything with it.
"COLUMN_TYPE": "BLOB",
"COLUMN_KEY": "",
}
col = Column(column_type, column_schema, self.packet)
Expand Down
2 changes: 1 addition & 1 deletion asyncmy/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__VERSION__ = "0.2.7-rc1"
__VERSION__ = "0.2.7-rc2"
1,166 changes: 598 additions & 568 deletions poetry.lock

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,39 @@ packages = [
]
readme = "README.md"
repository = "https://github.com/long2ice/asyncmy.git"
version = "0.2.7-rc1"
version = "0.2.7-rc2"

[tool.poetry.dependencies]
python = "^3.7"

[tool.poetry.dev-dependencies]
aiomysql = "*"
[tool.poetry.group.dev.dependencies]
bandit = "*"
black = "*"
cryptography = "*"
cython = "*"
flake8 = "*"
isort = "*"
mypy = "*"
rich = "*"
ruff = "*"

[tool.poetry.group.test.dependencies]
pytest = "*"
mysqlclient = "*"
pymysql = "0.8.1"
pytest = "*"
rich = "*"
pyproject-flake8 = "*"
aiomysql = "*"
pytest-asyncio = "*"
pytest-mock = "*"
pytest-xdist = "*"
cryptography = "*"
uvloop = { version = "*", markers = "sys_platform != 'win32'" }

[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0, <1.5.0", "setuptools", "cython"]
requires = ["poetry-core", "setuptools", "cython"]

[tool.black]
line-length = 100
target-version = ['py36', 'py37', 'py38', 'py39']
target-version = ['py37', 'py38', 'py39', 'py310']

[tool.pytest.ini_options]
asyncio_mode = 'auto'
Expand All @@ -52,5 +54,5 @@ asyncio_mode = 'auto'
pretty = true
ignore_missing_imports = true

[tool.flake8]
ignore = 'E501,W503,E203'
[tool.ruff]
line-length = 100
4 changes: 2 additions & 2 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from asyncmy.connection import Connection
from asyncmy.errors import OperationalError

from conftest import connection_kwargs


Expand Down Expand Up @@ -35,7 +34,8 @@ async def test_read_timeout():
async def test_transaction(connection):
await connection.begin()
await connection.query(
"""INSERT INTO test.asyncmy(`decimal`, date, datetime, `float`, string, `tinyint`) VALUES (%s,'%s','%s',%s,'%s',%s)"""
"""INSERT INTO test.asyncmy(`decimal`, date, datetime, `float`,
string, `tinyint`) VALUES (%s,'%s','%s',%s,'%s',%s)"""
% (
1,
"2020-08-08",
Expand Down
9 changes: 6 additions & 3 deletions tests/test_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ async def test_dict_cursor(connection):
async def test_insert(connection):
async with connection.cursor(cursor=DictCursor) as cursor:
rows = await cursor.execute(
"""INSERT INTO test.asyncmy(id,`decimal`, date, datetime, time, `float`, string, `tinyint`) VALUES (%s,%s,%s,%s,%s,%s,%s,%s)""",
"""INSERT INTO test.asyncmy(id,`decimal`, date, datetime, time,
`float`, string, `tinyint`) VALUES (%s,%s,%s,%s,%s,%s,%s,%s)""",
(
1,
1,
Expand Down Expand Up @@ -75,7 +76,8 @@ async def test_delete(connection):
async def test_executemany(connection):
async with connection.cursor(cursor=DictCursor) as cursor:
rows = await cursor.executemany(
"""INSERT INTO test.asyncmy(`decimal`, date, datetime, time, `float`, string, `tinyint`) VALUES (%s,%s,%s,%s,%s,%s,%s)""",
"""INSERT INTO test.asyncmy(`decimal`, date, datetime, time, `float`,
string, `tinyint`) VALUES (%s,%s,%s,%s,%s,%s,%s)""",
[
(
1,
Expand Down Expand Up @@ -124,7 +126,8 @@ class EnumValue(str, Enum):
async def test_insert_enum(connection):
async with connection.cursor(cursor=DictCursor) as cursor:
rows = await cursor.execute(
"""INSERT INTO test.asyncmy(id, `decimal`, date, datetime, time, `float`, string, `tinyint`) VALUES (%s,%s,%s,%s,%s,%s,%s,%s)""",
"""INSERT INTO test.asyncmy(id, `decimal`, date, datetime, time,
`float`, string, `tinyint`) VALUES (%s,%s,%s,%s,%s,%s,%s,%s)""",
(
-1,
1,
Expand Down

0 comments on commit 133aee8

Please sign in to comment.