From 83b530c445777f6399ca2bcfbad76955b17ec090 Mon Sep 17 00:00:00 2001 From: isra17 Date: Mon, 1 May 2023 11:29:08 -0400 Subject: [PATCH] Fix for python3.11 --- .github/workflows/main.yml | 24 ++++++++++++------------ mitmproxy/contentviews/grpc.py | 2 +- setup.py | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cbe19b3654..af6ac43378 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v2 with: - python-version: '3.10' + python-version: '3.11' - run: pip install tox - run: tox -e flake8 filename-matching: @@ -35,7 +35,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v2 with: - python-version: '3.10' + python-version: '3.11' - run: pip install tox - run: tox -e filename_matching mypy: @@ -46,7 +46,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v2 with: - python-version: '3.10' + python-version: '3.11' - run: pip install tox - run: tox -e mypy individual-coverage: @@ -67,11 +67,11 @@ jobs: matrix: include: - os: ubuntu-latest - py: "3.10" + py: "3.11" - os: windows-latest - py: "3.10" + py: "3.11" - os: macos-latest - py: "3.10" + py: "3.11" - os: ubuntu-latest py: 3.9 runs-on: ${{ matrix.os }} @@ -90,9 +90,9 @@ jobs: - name: Run tox -e py (without internet) run: | # install dependencies (requires internet connectivity) - tox -e py --notest + tox -e py --notest # run tests with loopback only. We need to sudo for unshare, which means we need an absolute path for tox. - sudo unshare --net -- sh -c "ip link set lo up; $(which tox) -e py" + sudo unshare --net -- sh -c "ip link set lo up; $(which tox) -e py" if: matrix.os == 'ubuntu-latest' - uses: codecov/codecov-action@a1ed4b322b4b38cb846afb5a0ebfa17086917d27 # mirrored below and at https://github.com/mitmproxy/mitmproxy/settings/actions @@ -124,7 +124,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-python@v2 with: - python-version: '3.10' + python-version: '3.11' - if: matrix.platform == 'windows' uses: actions/cache@v2 with: @@ -175,7 +175,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v2 with: - python-version: '3.10' + python-version: '3.11' - run: | wget -q https://github.com/gohugoio/hugo/releases/download/v0.92.1/hugo_extended_0.92.1_Linux-64bit.deb echo "a9440adfd3ecce40089def287dee4e42ffae252ba08c77d1ac575b880a079ce6 hugo_extended_0.92.1_Linux-64bit.deb" | sha256sum -c @@ -211,7 +211,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v2 with: - python-version: '3.10' + python-version: '3.11' - uses: actions/download-artifact@v2 with: name: binaries.linux @@ -245,7 +245,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v2 with: - python-version: '3.10' + python-version: '3.11' - run: sudo apt-get update - run: sudo apt-get install -y twine awscli - uses: actions/download-artifact@v2 diff --git a/mitmproxy/contentviews/grpc.py b/mitmproxy/contentviews/grpc.py index a5ef99708f..5c73220c83 100644 --- a/mitmproxy/contentviews/grpc.py +++ b/mitmproxy/contentviews/grpc.py @@ -951,7 +951,7 @@ def format_grpc( @dataclass class ViewConfig: - parser_options: ProtoParser.ParserOptions = ProtoParser.ParserOptions() + parser_options: ProtoParser.ParserOptions = field(default_factory=ProtoParser.ParserOptions) parser_rules: list[ProtoParser.ParserRule] = field(default_factory=list) diff --git a/setup.py b/setup.py index 4e149c4d87..54365ff853 100644 --- a/setup.py +++ b/setup.py @@ -106,7 +106,7 @@ "hypothesis>=5.8,<7", "parver>=0.1,<2.0", "pdoc>=4.0.0", - "pyinstaller==5.1", + "pyinstaller>=5.1", "pytest-asyncio>=0.17.0,<0.19", "pytest-cov>=2.7.1,<3.1", "pytest-timeout>=1.3.3,<2.2",