Skip to content

Commit

Permalink
rebase and bump httpx
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Apr 2, 2022
2 parents ec870eb + 20d24a8 commit fcb003b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
10 changes: 5 additions & 5 deletions requirements.txt
Expand Up @@ -3,21 +3,21 @@

# Testing
autoflake==1.4
black==22.1.0
black==22.3.0
coverage==6.2
databases[sqlite]==0.5.5
flake8==4.0.1
flake8==3.9.2
isort==5.10.1
mypy==0.931
mypy==0.942
types-contextvars==2.4.2
types-PyYAML==6.0.4
types-dataclasses==0.6.2
pytest==7.0.1
trio==0.19.0

# Documentation
mkdocs==1.2.3
mkdocs-material==8.1.3
mkdocs==1.3.0
mkdocs-material==8.2.8
mkautodoc==0.1.0

# Packaging
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Expand Up @@ -48,8 +48,7 @@ def get_long_description():
"jinja2",
"python-multipart",
"pyyaml",
# "httpx>=0.20.0"
"httpx @ git+https://github.com/encode/httpx.git@master",
"httpx>=0.22.0",
]
},
classifiers=[
Expand Down
7 changes: 5 additions & 2 deletions starlette/templating.py
Expand Up @@ -8,11 +8,14 @@
try:
import jinja2

# @contextfunction renamed to @pass_context in Jinja 3.0, to be removed in 3.1
# @contextfunction was renamed to @pass_context in Jinja 3.0, and was removed in 3.1
# hence we try to get pass_context (most installs will be >=3.1)
# and fall back to contextfunction,
# adding a type ignore for mypy to let us access an attribute that may not exist
if hasattr(jinja2, "pass_context"):
pass_context = jinja2.pass_context
else: # pragma: nocover
pass_context = jinja2.contextfunction
pass_context = jinja2.contextfunction # type: ignore[attr-defined]
except ImportError: # pragma: nocover
jinja2 = None # type: ignore

Expand Down

0 comments on commit fcb003b

Please sign in to comment.