Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

async w/ python 3.8 compatibility sans warnings #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kapilt
Copy link

@kapilt kapilt commented Feb 18, 2020

this closes #10 by using async syntax that doesn't trigger warnings.

this pr also removes from travis the versions of python3 that are end of life'd (3.3, 3.4) adds the newer ones (3.7, 3.8) and increments the version (post0->post1) for release to pypi.

@kapilt kapilt requested a review from RazerM February 18, 2020 20:16
@smthfrmn
Copy link

smthfrmn commented May 6, 2020

@RazerM can you look into this PR? I would like to have the update as well

@daggy1234
Copy link

With 3.9 this would be great. I also have another issue with

https://mystb.in/RepresentativeBestApplications.apache

Would love a fix!

@dhimmel
Copy link

dhimmel commented Oct 31, 2020

Thanks @kapilt for this update. Really hoping @RazerM sees this and can review/merge/release.

@musicinmybrain
Copy link

This seems to still work correctly in a development version of Python 3.11, in which the warned-about asyncio.coroutine decorator is actually removed.

@gshuflin
Copy link

gshuflin commented Apr 7, 2022

Any movement on this issue? I see that pypi/support#954 resuled in @gear4s being added as a maintainer by @RazerM . I'd like to use this library and it would help me out if this PR could get merged and a new PyPi release happen.

@gear4s
Copy link
Collaborator

gear4s commented Apr 7, 2022

Any movement on this issue? I see that pypi/support#954 resuled in @gear4s being added as a maintainer by @RazerM . I'd like to use this library and it would help me out if this PR could get merged and a new PyPi release happen.

I will review and test this week, if all's good I will merge.

@gshuflin
Copy link

gshuflin commented Apr 7, 2022

Any movement on this issue? I see that pypa/pypi-support#954 resuled in @gear4s being added as a maintainer by @RazerM . I'd like to use this library and it would help me out if this PR could get merged and a new PyPi release happen.

I will review and test this week, if all's good I will merge.

Awesome, looking forward to seeing this merged.

@gshuflin
Copy link

@gear4s have you had a chance to review and test this yet?

@gear4s
Copy link
Collaborator

gear4s commented Apr 13, 2022

@gear4s have you had a chance to review and test this yet?

Not yet - I've dedicated some time Saturday to do this. Work is beating me right now unfortunately

@gshuflin
Copy link

gshuflin commented May 4, 2022

@gear4s did you ever have a chance to try this?

@MilesCranmer
Copy link

MilesCranmer commented Nov 6, 2022

This is officially removed in Python 3.11 so dependent packages are now breaking. Please merge asap.

e.g., the entirety of snakemake: https://github.com/snakemake/snakemake is now breaking on Python 3.11.

cc @RazerM

@MilesCranmer
Copy link

FWIW @gshuflin I patched my local version with this PR and it works fine. But merging would be preferred so users don't encounter the same error.

@dhimmel
Copy link

dhimmel commented Nov 6, 2022

@gear4s would be great to have this merged and released now that projects that use ratelimiter are stuck from upgrading to Python 3.11

@uburuntu
Copy link

Hello folks, it's kinda self-promoting, but since this repo was not updated since 2018 consider using https://github.com/uburuntu/throttler for async cases -- it has pretty close syntax and is a bit more efficient.

Migration for context managers

from ratelimiter import RateLimiter

rate_limiter = RateLimiter(max_calls=10, period=1)
with rate_limiter:
    do_something()

from throttler import Throttler

rate_limiter = Throttler(rate_limit=10, period=1)
async with rate_limiter:
    await do_something()

https://github.com/uburuntu/throttler#simple-example

Migration for decorators

from ratelimiter import RateLimiter

@RateLimiter(max_calls=10, period=1)
def do_something():
    pass

from throttler import throttle

@throttle(rate_limit=10, period=1)
async def do_something():
    pass

https://github.com/uburuntu/throttler#throttler-and-throttlersimultaneous

Migration example

snakemake/snakemake#1958

@RazerM
Copy link
Owner

RazerM commented Nov 22, 2022

I use and recommend rush

@RazerM
Copy link
Owner

RazerM commented Nov 22, 2022

P.S. See #17

@jayaddison jayaddison mentioned this pull request Jan 5, 2023
aldo-o added a commit to aldo-o/ratelimiter that referenced this pull request Jul 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix warning that coroutine decorator is deprecated since Python 3.8