Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:

- name: Install dependencies
run: uv sync --extra dev
- name: Lint with flake8
run: uv run flake8
- name: Lint with ruff
run: uv run ruff check
2 changes: 1 addition & 1 deletion ably/util/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def get_default_params(params=None):
if not key:
raise ValueError("Crypto.get_default_params: a key is required")

if type(key) == str:
if isinstance(key, str):
key = base64.b64decode(key)

cipher_params = CipherParams(algorithm=algorithm, secret_key=key, iv=iv, mode=mode)
Expand Down
20 changes: 18 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ vcdiff = ["vcdiff-decoder>=0.1.0,<0.2.0"]
dev = [
"pytest>=7.1,<8.0",
"mock>=4.0.3,<5.0.0",
"pep8-naming>=0.4.1,<0.5.0",
"pytest-cov>=2.4,<3.0",
"flake8>=3.9.2,<4.0.0",
"ruff>=0.14.0,<1.0.0",
"pytest-xdist>=1.15,<2.0",
"respx>=0.20.0,<0.21.0; python_version=='3.7'",
"respx>=0.22.0,<0.23.0; python_version>='3.8'",
Expand Down Expand Up @@ -79,3 +78,20 @@ timeout = 30
name = "experimental"
url = "https://test.pypi.org/simple/"
explicit = true

[tool.ruff]
line-length = 115
extend-exclude = [
"ably/sync",
"test/ably/sync",
]

[tool.ruff.lint]
# Enable Pyflakes (F), pycodestyle (E, W), and pep8-naming (N)
select = ["E", "W", "F", "N"]
ignore = [
"N818", # exception name should end in 'Error'
]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # imported but unused
9 changes: 0 additions & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
[coverage:run]
branch=True

[flake8]
max-line-length = 115
ignore = W503, W504, N818
per-file-ignores =
# imported but unused
__init__.py: F401
# Exclude virtual environment check
exclude = .venv,venv,env,.env,.git,__pycache__,.pytest_cache,build,dist,*.egg-info,ably/sync,test/ably/sync

[tool:pytest]
#log_level = DEBUG
2 changes: 1 addition & 1 deletion test/ably/rest/restchannelpublish_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ async def check_data():
async def check_history():
history = await channel.history()
message = history.items[0]
return message.data == expected_value and type(message.data) == type_mapping[expected_type]
return message.data == expected_value and isinstance(message.data, type_mapping[expected_type])

await assert_waiter(check_history)

Expand Down
83 changes: 28 additions & 55 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.