Skip to content

Commit

Permalink
Minor fixes and refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
gavin-aguiar committed Nov 20, 2024
1 parent dace0ca commit 23c1824
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 18 deletions.
15 changes: 3 additions & 12 deletions azure/functions/_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
import types
import typing

import werkzeug.datastructures
from werkzeug import formparser as _wk_parser
from werkzeug import http as _wk_http
from werkzeug.datastructures import Headers, FileStorage, MultiDict
from werkzeug.datastructures import Headers, FileStorage, MultiDict, ImmutableMultiDict

from . import _abc

Expand Down Expand Up @@ -217,23 +216,15 @@ def get_json(self) -> typing.Any:
def _parse_form_data(self):
if self.__form_parsed:
return
"""
stream_factory: TStreamFactory | None = None,
max_form_memory_size: int | None = None,
max_content_length: int | None = None,
cls: type[MultiDict[str, t.Any]] | None = None,
silent: bool = True,
*,
max_form_parts: int | None = None,
"""

body = self.get_body()
content_type = self.headers.get('Content-Type', '')
content_length = len(body)
mimetype, options = _wk_http.parse_options_header(content_type)
parser = _wk_parser.FormDataParser(
_wk_parser.default_stream_factory, max_form_memory_size=None,
max_content_length=None,
cls=werkzeug.datastructures.ImmutableMultiDict
cls=ImmutableMultiDict
)

body_stream = io.BytesIO(body)
Expand Down
2 changes: 0 additions & 2 deletions eng/templates/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
python --version
displayName: 'Check python version'
- bash: |
python -m venv .env
.env\Scripts\Activate.ps1
python -m pip install -U pip
python -m pip install build
python -m build
Expand Down
2 changes: 0 additions & 2 deletions eng/templates/jobs/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ jobs:
python --version
displayName: 'Check python version'
- bash: |
python -m venv .env
.env\Scripts\Activate.ps1
python -m pip install -U pip
python -m pip install build
python -m build
Expand Down
4 changes: 2 additions & 2 deletions eng/templates/official/jobs/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
displayName: 'Check python version'
- bash: |
python -m pip install -U pip
pip install twine wheel
python setup.py sdist bdist_wheel
python -m pip install build
python -m build
displayName: 'Build Python SDK'
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ classifiers = [
'License :: OSI Approved :: MIT License',
'Intended Audience :: Developers',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
Expand Down

0 comments on commit 23c1824

Please sign in to comment.