Skip to content

Commit 60cfcfb

Browse files
bump versions (#5)
* bump versions * update poetry.lock * test python version bump * fix python version * fix typo * bump dependency version * bump versions * small fixes
1 parent 5bf004c commit 60cfcfb

File tree

8 files changed

+17
-13
lines changed

8 files changed

+17
-13
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ jobs:
2626

2727
- name: Run tests
2828
run: |
29-
export UPSTASH_REDIST_REST_URL="${{secrets.UPSTASH_REDIS_REST_URL}}"
30-
export UPSTASH_REDIST_REST_TOKEN="${{secrets.UPSTASH_REDIS_REST_TOKEN}}"
29+
export UPSTASH_REDIS_REST_URL="${{secrets.UPSTASH_REDIS_REST_URL}}"
30+
export UPSTASH_REDIS_REST_TOKEN="${{secrets.UPSTASH_REDIS_REST_TOKEN}}"
3131
poetry run pytest

poetry.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "upstash_ratelimit"
3-
version = "0.3.2"
3+
version = "0.3.4"
44
description = "Serverless ratelimiting package from Upstash"
55
authors = ["Zgîmbău Tudor <tudor.zgimbau@gmail.com>", "Upstash <support@upstash.com>"]
66
readme = "README.md"
@@ -10,7 +10,7 @@ packages = [{include = "upstash_ratelimit"}]
1010
python = "^3.8"
1111
pytest = "^7.3.0"
1212
pytest-asyncio = "^0.21.0"
13-
upstash-redis = "^0.13.0"
13+
upstash-redis = "^0.13.2"
1414

1515
[build-system]
1616
requires = ["poetry-core"]

tests/algorithm/limiting/test_fixed_window_limiting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_below_max() -> None:
1212
def test_above_max() -> None:
1313
fixed_window.limit("fixed_window_2")
1414

15-
sleep(1)
15+
sleep(2)
1616

1717
assert (fixed_window.limit("fixed_window_2"))["is_allowed"] is False
1818
assert (fixed_window.limit("fixed_window_2"))["is_allowed"] is False

tests/algorithm/remaining/test_token_bucket_remaining.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ def test_before_the_first_request() -> None:
1212
def test_after_the_first_request() -> None:
1313
token_bucket.limit("token_bucket_remaining_2")
1414

15+
sleep(2)
16+
1517
assert token_bucket.remaining("token_bucket_remaining_2") == 0
1618

1719

tests/asyncio/algorithm/limiting/test_async_fixed_window_limiting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async def test_below_max() -> None:
1414
async def test_above_max() -> None:
1515
await fixed_window.limit("async_fixed_window_2")
1616

17-
await sleep(1)
17+
await sleep(2)
1818

1919
assert (await fixed_window.limit("async_fixed_window_2"))["is_allowed"] is False
2020
assert (await fixed_window.limit("async_fixed_window_2"))["is_allowed"] is False

tests/asyncio/algorithm/remaining/test_async_token_bucket_remaining.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from time import sleep
44

55
token_bucket = rate_limit.token_bucket(
6-
max_number_of_tokens=1, refill_rate=1, interval=3000, unit="ms"
6+
max_number_of_tokens=1, refill_rate=1, interval=6000, unit="ms"
77
)
88

99

@@ -16,6 +16,8 @@ async def test_before_the_first_request() -> None:
1616
async def test_after_the_first_request() -> None:
1717
await token_bucket.limit("async_token_bucket_remaining_2")
1818

19+
sleep(2)
20+
1921
assert await token_bucket.remaining("async_token_bucket_remaining_2") == 0
2022

2123

upstash_ratelimit/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This is where the defaults and non-secret configuration values are stored.
22

3-
SDK: str = "py-upstash-redis@v0.13.0, py-upstash-ratelimit@v0.3.0"
3+
SDK: str = "py-upstash-redis@v0.13.1, py-upstash-ratelimit@v0.3.3"
44

55
PREFIX: str = "ratelimit"

0 commit comments

Comments
 (0)