Skip to content

Commit

Permalink
Merge pull request #1207 from abhinavsingh/develop
Browse files Browse the repository at this point in the history
v2.4.4rc1
  • Loading branch information
abhinavsingh authored Jun 28, 2022
2 parents f4e480b + 25939d3 commit 4248a1f
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 53 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/test-library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -658,27 +658,27 @@ jobs:
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

brew:
runs-on: ${{ matrix.os }}-latest
name: 🍺 🐍${{ matrix.python }} @ ${{ matrix.os }}
strategy:
matrix:
os: [macOS]
python: ['3.10']
# max-parallel: 1
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Brew
run: |
brew install ./helper/homebrew/develop/proxy.rb
- name: Verify
run: |
proxy -h
# brew:
# runs-on: ${{ matrix.os }}-latest
# name: 🍺 🐍${{ matrix.python }} @ ${{ matrix.os }}
# strategy:
# matrix:
# os: [macOS]
# python: ['3.10']
# # max-parallel: 1
# fail-fast: false
# steps:
# - uses: actions/checkout@v3
# - name: Setup Python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python }}
# - name: Brew
# run: |
# brew install ./helper/homebrew/develop/proxy.rb
# - name: Verify
# run: |
# proxy -h

dashboard:
runs-on: ${{ matrix.os }}-latest
Expand Down Expand Up @@ -969,7 +969,7 @@ jobs:
- test
- lint
- dashboard
- brew
# - brew
- developer
- ghcr-latest
- ghcr-openssl
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ repos:
additional_dependencies:
- paramiko == 2.11.0
- types-paramiko == 2.7.3
- types-requests==2.27.30
- cryptography==36.0.2; python_version <= '3.6'
- types-setuptools == 57.4.2
args:
Expand Down
44 changes: 22 additions & 22 deletions dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^5.0.0",
"http-server": "^14.1.0",
"jasmine": "^4.1.0",
"jasmine": "^4.2.0",
"jasmine-ts": "^0.4.0",
"jquery": "^3.6.0",
"js-cookie": "^3.0.1",
Expand All @@ -49,7 +49,7 @@
"rollup-plugin-javascript-obfuscator": "^1.0.4",
"rollup-plugin-typescript": "^1.0.1",
"ts-node": "^10.8.0",
"typescript": "^4.5.4",
"typescript": "^4.7.3",
"ws": "^8.6.0"
}
}
2 changes: 1 addition & 1 deletion proxy/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


SYS_PLATFORM = platform.system()
IS_WINDOWS = SYS_PLATFORM == 'Windows'
IS_WINDOWS = SYS_PLATFORM.lower() in ('windows', 'cygwin')


def _env_threadless_compliant() -> bool:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ requires = [
"setuptools",

# Plugins
"setuptools-scm[toml] >= 6",
"setuptools-scm-git-archive >= 1.1",
"setuptools-scm[toml]>=6,!=7.0.0,!=7.0.1,!=7.0.2",
"setuptools-scm-git-archive>=1.1",
]
build-backend = "setuptools.build_meta"

Expand Down
2 changes: 1 addition & 1 deletion requirements-release.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
setuptools-scm == 6.3.2
twine==3.7.1
twine==3.8.0
4 changes: 3 additions & 1 deletion requirements-testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ h2==4.1.0
hpack==4.0.0
hyperframe==6.0.1
pre-commit==2.16.0
types-setuptools==57.4.10
# Types
types-requests==2.28.0
types-setuptools==57.4.17
2 changes: 1 addition & 1 deletion requirements-tunnel.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
paramiko==2.11.0
types-paramiko==2.8.9
types-paramiko==2.11.0
cryptography==36.0.2; python_version <= '3.6'
24 changes: 23 additions & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
import unittest
from unittest import mock

from proxy.proxy import main, entry_point
import requests

from proxy.proxy import Proxy, main, entry_point
from proxy.common.utils import bytes_
from proxy.core.work.fd import RemoteFdExecutor
from proxy.common.constants import ( # noqa: WPS450
Expand Down Expand Up @@ -368,3 +370,23 @@ def test_enable_ssh_tunnel(
mock_ssh_tunnel_listener.return_value.shutdown.assert_called_once()
# shutdown will internally call stop port forward
mock_ssh_tunnel_listener.return_value.stop_port_forward.assert_not_called()


class TestProxyContextManager(unittest.TestCase):

def test_proxy_context_manager(self) -> None:
with Proxy(port=8888, num_acceptors=1):
response = requests.get(
'http://httpbin.org/get', proxies={
'http': 'http://127.0.0.1:8888',
'https': 'http://127.0.0.1:8888',
},
)
self.assertEqual(response.status_code, 200)
response = requests.get(
'https://httpbin.org/get', proxies={
'http': 'http://127.0.0.1:8888',
'https': 'http://127.0.0.1:8888',
},
)
self.assertEqual(response.status_code, 200)

0 comments on commit 4248a1f

Please sign in to comment.