Open Lx opened 5 years ago
On further reflection, the AsyncClient
might be better off in a separate PyPI package (perhaps pyptv3-asyncio
?) which can depend on pyptv3
and any asyncio
-related dependencies.
Then projects depending on AsyncClient
could specify pyptv3
and pyptv3-asyncio
as dependencies and have correct access to everything without ImportError
s.
Background
pyptv3
package offers both blocking and non-blocking clients:Client
&AsyncClient
.AsyncClient
is optional, thepyptv3
package correctly does not declareaiohttp
as an installation dependency.Problem
pyptv3
without the intention of using the non-blockingAsyncClient
, attempt to importaiohttp
still occurs.If
aiohttp
is not installed, problems arise:Expectation
aiohttp
should only be attempted ifpyptv3.AsyncClient
is imported directly.import pyptv3
, which occurs when non-blockingAsyncClient
support is not needed, should not causepyptv3.AsyncClient
to be imported.aiohttp
should remain an optional dependency as it is now.Workaround until issue is resolved
aiohttp
dependency manually alongsidepyptv3
even ifAsyncClient
support is not needed.Environment