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
8 changes: 7 additions & 1 deletion httpcore/_async/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
try:
from .http2 import AsyncHTTP2Connection
except ImportError: # pragma: nocover
pass

class AsyncHTTP2Connection: # type: ignore
def __init__(self, *args, **kwargs) -> None: # type: ignore
raise RuntimeError(
"Attempted to use http2 support, but the `h2` package is not "
"installed. Use 'pip install httpcore[http2]'."
)


__all__ = [
Expand Down
8 changes: 7 additions & 1 deletion httpcore/_sync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
try:
from .http2 import HTTP2Connection
except ImportError: # pragma: nocover
pass

class HTTP2Connection: # type: ignore
def __init__(self, *args, **kwargs) -> None: # type: ignore
raise RuntimeError(
"Attempted to use http2 support, but the `h2` package is not "
"installed. Use 'pip install httpcore[http2]'."
)


__all__ = [
Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ def get_packages(package):
packages=get_packages("httpcore"),
include_package_data=True,
zip_safe=False,
install_requires=["h11>=0.11,<0.13", "sniffio==1.*", "anyio==3.*"],
install_requires=[
"h11>=0.11,<0.13",
"sniffio==1.*",
"anyio==3.*",
"certifi",
],
extras_require={
"http2": ["h2>=3,<5"],
},
Expand Down