Skip to content

Commit

Permalink
Upgrade black and other test dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Feb 7, 2022
1 parent 0a55e2a commit cd9eed5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pytype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
pip install -e ".[testing]"
pip install -e ".[optional]"
# As pytype can change its behavior in newer versions, we manually upgrade it
pip install "pytype==2022.1.13"
pip install "pytype==2022.1.31"
- name: Run pytype
run: |
pytype slack_sdk/
6 changes: 5 additions & 1 deletion integration_tests/audit_logs/test_pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ def test_pagination(self):
response = None
ids = []
while call_count < 10 and (response is None or response.status_code != 429):
cursor = response.body["response_metadata"]["next_cursor"] if response is not None else None
cursor = (
response.body["response_metadata"]["next_cursor"]
if response is not None
else None
)
response = self.client.logs(action="user_login", limit=1, cursor=cursor)
ids += map(lambda v: v["id"], response.body.get("entries", []))
call_count += 1
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
"pytest-cov>=2,<3",
"codecov>=2,<3",
"flake8>=4,<5",
"black==21.12b0",
"black==22.1.0",
"psutil>=5,<6",
"databases>=0.3",
"databases>=0.5",
# used only under slack_sdk/*_store
"boto3<=2",
# TODO: Upgrade to v2
"moto<2", # For AWS tests
"moto>=3,<4", # For AWS tests
]
codegen_dependencies = [
"black==21.12b0",
"black==22.1.0",
]

needs_pytest = {"pytest", "test", "ptr"}.intersection(sys.argv)
Expand Down
2 changes: 1 addition & 1 deletion slack_sdk/rtm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ async def _wait_exponentially(self, exception, max_wait_time=300):
if hasattr(exception, "response"):
wait_time = exception.response.get("headers", {}).get(
"Retry-After",
min((2 ** self._connection_attempts) + random.random(), max_wait_time),
min((2**self._connection_attempts) + random.random(), max_wait_time),
)
self._logger.debug("Waiting %s seconds before reconnecting.", wait_time)
await asyncio.sleep(float(wait_time))
Expand Down

0 comments on commit cd9eed5

Please sign in to comment.