Skip to content

Commit 177689c

Browse files
abhinavsinghpre-commit-ci[bot]dependabot[bot]
authored
v2.4.0rc6 (#964)
* Remove menubar (#930) Remove `menubar` * Use `128 KB` as default value for `DEFAULT_BUFFER_SIZE` (#926) * Add `TlsInterception` acceptance test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Generate CA cert if not available * Fix lint and tests * Fix args * Remove acceptance tests for now Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * pip prod(deps): bump wheel from 0.37.0 to 0.37.1 (#934) Bumps [wheel](https://github.com/pypa/wheel) from 0.37.0 to 0.37.1. - [Release notes](https://github.com/pypa/wheel/releases) - [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst) - [Commits](pypa/wheel@0.37.0...0.37.1) --- updated-dependencies: - dependency-name: wheel dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * npm: bump jasmine from 3.10.0 to 4.0.0 in /dashboard (#933) Bumps [jasmine](https://github.com/jasmine/jasmine-npm) from 3.10.0 to 4.0.0. - [Release notes](https://github.com/jasmine/jasmine-npm/releases) - [Commits](jasmine/jasmine-npm@v3.10.0...v4.0.0) --- updated-dependencies: - dependency-name: jasmine dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * npm: bump ws from 8.3.0 to 8.4.0 in /dashboard (#936) Bumps [ws](https://github.com/websockets/ws) from 8.3.0 to 8.4.0. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](websockets/ws@8.3.0...8.4.0) --- updated-dependencies: - dependency-name: ws dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * pip prod(deps): bump types-paramiko from 2.8.4 to 2.8.6 (#937) Bumps [types-paramiko](https://github.com/python/typeshed) from 2.8.4 to 2.8.6. - [Release notes](https://github.com/python/typeshed/releases) - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-paramiko dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Abhinav Singh <[email protected]> * `DescriptorsHandlerMixin` and `Descriptors`, `SelectableEvents` types (#938) * Add `Descriptors` type * Add a `DescriptorsHandlerMixin` class used throughout the http framework * Remove dependency upon `HasFileno` ie `typing_extension` too * Define `SelectableEvents` type * Fix doc * Blank line * Remove dep on `typing-extensions` * Discover base plugin class * await on now async handlers * Fix doc spell * Add `--port-file` flag (#942) * Add `--port-file` flag * Use `--port-file` flag for integration tests using `get_available_port` * Use temp dir * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix `base_klass` variable related lint issues * Fix main tests * Fix integration * Use timeout when terminating proc * Skip integration on win instead of xmark Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Expose `UpstreamConnectionPool` to web & proxy plugins (#946) * Expose conn pool to plugins * Fix reusable state handling * Separate `release` and `retain` methods * Fix conn pool tests * Fix tests * npm: bump chrome-devtools-frontend in /dashboard (#949) Bumps [chrome-devtools-frontend](https://github.com/ChromeDevTools/devtools-frontend) from 1.0.952865 to 1.0.956881. - [Release notes](https://github.com/ChromeDevTools/devtools-frontend/releases) - [Changelog](https://github.com/ChromeDevTools/devtools-frontend/blob/main/docs/release_management.md) - [Commits](https://github.com/ChromeDevTools/devtools-frontend/commits) --- updated-dependencies: - dependency-name: chrome-devtools-frontend dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * pip prod(deps): bump sphinxcontrib-towncrier from 0.2.0a0 to 0.2.1a0 (#941) Bumps [sphinxcontrib-towncrier](https://github.com/sphinx-contrib/sphinxcontrib-towncrier) from 0.2.0a0 to 0.2.1a0. - [Release notes](https://github.com/sphinx-contrib/sphinxcontrib-towncrier/releases) - [Commits](sphinx-contrib/sphinxcontrib-towncrier@v0.2.0a0...v0.2.1a0) --- updated-dependencies: - dependency-name: sphinxcontrib-towncrier dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Abhinav Singh <[email protected]> * `isort` everything except lib (for now) (#952) * isort the tests folder * Carry over changes from #672 * Disable pre-commit * Revert flake8 config change * isort examples too * pip prod(deps): bump httpx from 0.20.0 to 0.21.3 (#951) Bumps [httpx](https://github.com/encode/httpx) from 0.20.0 to 0.21.3. - [Release notes](https://github.com/encode/httpx/releases) - [Changelog](https://github.com/encode/httpx/blob/master/CHANGELOG.md) - [Commits](encode/httpx@0.20.0...0.21.3) --- updated-dependencies: - dependency-name: httpx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Abhinav Singh <[email protected]> * Decouple transport framework from dashboard plugin (#953) * Decouple transport framework from dashboard plugin * Move `InspectTrafficPlugin` within `http.inspector` module * Avoid exporting plugins within `__init__.py` files * Use `/transport/` prefix to avoid #945 conflict issue * Add todo * Build containers in parallel and pre-check (#954) * Build containers in parallel and pre-check * Fix loop in workflow * Test container needs build * Invoke `WebSocketTransportBasePlugin` connected and disconnected callbacks (#956) * [HttpProtocolHandler] Handle invalid request parsing exceptions (#957) * Handle invalid request parsing exception when raised, log the bytes for later inspection * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * npm: bump jasmine-ts from 0.3.0 to 0.4.0 in /dashboard (#958) Bumps [jasmine-ts](https://github.com/svi3c/jasmine-ts) from 0.3.0 to 0.4.0. - [Release notes](https://github.com/svi3c/jasmine-ts/releases) - [Changelog](https://github.com/svi3c/jasmine-ts/blob/master/CHANGELOG.md) - [Commits](https://github.com/svi3c/jasmine-ts/commits/v0.4.0) --- updated-dependencies: - dependency-name: jasmine-ts dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Ignore `utf-8` decoding errors within event core (#961) * [WebServer] Refactor routing to allow same path for websocket and web requests (#962) * Switch to WS * Refactor * Ignore utf-8 decode error during logging (#966) * On-demand `TlsInterception` capability, driven by plugins (#965) * Add `TlsInterceptionPropertyMixin` * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add `do_intercept` hook * call super init * No super from mixin as it is followed by abc? * type ignore * spell Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * [WebServer] Fix routing (#968) * Fix web server routing * Fix mypy * pip prod(deps): bump furo from 2021.11.23 to 2022.1.2 (#959) Bumps [furo](https://github.com/pradyunsg/furo) from 2021.11.23 to 2022.1.2. - [Release notes](https://github.com/pradyunsg/furo/releases) - [Changelog](https://github.com/pradyunsg/furo/blob/main/docs/changelog.md) - [Commits](pradyunsg/furo@2021.11.23...2022.01.02) --- updated-dependencies: - dependency-name: furo dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Abhinav Singh <[email protected]> * pip prod(deps): bump paramiko from 2.9.1 to 2.9.2 (#970) Bumps [paramiko](https://github.com/paramiko/paramiko) from 2.9.1 to 2.9.2. - [Release notes](https://github.com/paramiko/paramiko/releases) - [Changelog](https://github.com/paramiko/paramiko/blob/main/NEWS) - [Commits](paramiko/paramiko@2.9.1...2.9.2) --- updated-dependencies: - dependency-name: paramiko dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Abhinav Singh <[email protected]> * Test submodule and refactor (#971) * Refactor tests into submodules * isort tests * Add malicious request headers test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Handle `OSError` on shutdown & `TimeoutError` on recv (#974) * Expect `TimeoutError` during `recv` * Expect `OSError` during socket shutdown, can happen if other end has already closed the socket * pip prod(deps): bump mypy from 0.920 to 0.931 (#976) Bumps [mypy](https://github.com/python/mypy) from 0.920 to 0.931. - [Release notes](https://github.com/python/mypy/releases) - [Commits](python/mypy@v0.920...v0.931) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * npm: bump @types/jquery from 3.5.4 to 3.5.13 in /dashboard (#975) Bumps [@types/jquery](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jquery) from 3.5.4 to 3.5.13. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jquery) --- updated-dependencies: - dependency-name: "@types/jquery" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Abhinav Singh <[email protected]> * Refactor into separate `Work` module (#977) * work module * Fix imports * String based typing for multiprocessing.synchronize * Fix `test_accepts_client_from_server_socket` * Move staticmethod outside of threadless pool class * Fix doc build * Fix test mock * mp grouped together * pylint happy * import only for type checking * doc build * wrong import order * Type fixes (#979) * Type fixes * Type fix * Py class role * unused any import * [TlsInterception] GHA integration tests (#981) * Add TLS interception integration tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixture to gen certificate once for the `test_integration` module * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use https endpoints in tls interception tests * Fix modify post data integration test * Only start 3 acceptor & 3 workers during integration run * disable chunk response Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * npm: bump typescript from 3.9.7 to 4.5.4 in /dashboard (#982) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.9.7 to 4.5.4. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](microsoft/TypeScript@v3.9.7...v4.5.4) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * pip prod(deps): bump types-paramiko from 2.8.6 to 2.8.9 (#983) Bumps [types-paramiko](https://github.com/python/typeshed) from 2.8.6 to 2.8.9. - [Release notes](https://github.com/python/typeshed/releases) - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-paramiko dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Pass separate `--ca-cert-dir` flag for parallel TLS interception tests (#984) * Pass separate `--ca-cert-dir` flag for parallel TLS interception tests * Temp disable `test_modify_post_response_integration` * mock ca cert dir * Is threaded an issue with TLS interception? * Disable modify chunk response for python < 3.10 * Disable modify chunk response for python < 3.10 * [TlsInterception] Fix broken `ChunkedResponsePlugin` for `Python < 3.10` (#986) * Add TLS interception integration tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix CI * unused * Well 3.9 just worked locally * Dispatching empty byte to client results in OSError for Python < 3.10 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Uncomment old integration tests Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Add `# pragma: no cover` for unnecessary code (#987) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 parents 111ec38 + 38eab69 commit 177689c

File tree

150 files changed

+2164
-2856
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+2164
-2856
lines changed

.deepsource.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ test_patterns = [
77

88
exclude_patterns = [
99
"helper/**",
10-
"menubar/**"
1110
]
1211

1312
[[analyzers]]

.github/workflows/test-library.yml

Lines changed: 171 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,66 @@ jobs:
540540
flags: pytest, GHA, Python ${{ matrix.python }}, ${{ runner.os }}
541541
verbose: true
542542

543+
test-container:
544+
runs-on: Ubuntu-latest
545+
permissions:
546+
packages: write
547+
if: success()
548+
needs:
549+
- pre-setup # transitive, for accessing settings
550+
- build
551+
name: 🐳 Build & Test
552+
strategy:
553+
fail-fast: false
554+
steps:
555+
- name: Checkout
556+
uses: actions/checkout@v2
557+
with:
558+
ref: ${{ github.event.inputs.release-commitish }}
559+
- name: Download all the dists
560+
uses: actions/download-artifact@v2
561+
with:
562+
name: python-package-distributions
563+
path: dist/
564+
- name: Set up Docker Buildx
565+
id: buildx
566+
uses: docker/setup-buildx-action@v1
567+
# See https://github.com/docker/buildx/issues/850#issuecomment-996408167
568+
with:
569+
version: v0.7.0
570+
buildkitd-flags: --debug
571+
config: .github/buildkitd.toml
572+
install: true
573+
- name: Enable Multiarch # This slows down arm build by 4-5x
574+
run: |
575+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
576+
- name: Create builder
577+
run: |
578+
docker buildx create --name proxypybuilder
579+
docker buildx use proxypybuilder
580+
docker buildx inspect
581+
docker buildx ls
582+
- name: Build, run & test container
583+
run: >-
584+
CONTAINER_TAG="abhinavsingh/proxy.py:${{
585+
needs.pre-setup.outputs.container-version
586+
}}";
587+
docker buildx build
588+
--load
589+
--build-arg PROXYPY_PKG_PATH='dist/${{
590+
needs.pre-setup.outputs.wheel-artifact-name
591+
}}'
592+
-t $CONTAINER_TAG .
593+
&&
594+
docker run
595+
-d
596+
-p 8899:8899
597+
$CONTAINER_TAG
598+
--hostname 0.0.0.0
599+
--enable-web-server
600+
&&
601+
./tests/integration/test_integration.sh 8899
602+
543603
analyze:
544604
runs-on: ubuntu-latest
545605
name: 🛡️ Analyze
@@ -672,34 +732,15 @@ jobs:
672732
make ca-certificates
673733
python3 -m proxy --version
674734
675-
check: # This job does nothing and is only used for the branch protection
676-
if: always()
677-
678-
needs:
679-
- analyze
680-
- test
681-
- lint
682-
- dashboard
683-
- brew
684-
- developer
685-
686-
runs-on: Ubuntu-latest
687-
688-
steps:
689-
- name: Decide whether the needed jobs succeeded or failed
690-
uses: re-actors/alls-green@release/v1
691-
with:
692-
jobs: ${{ toJSON(needs) }}
693-
694-
docker:
735+
ghcr-latest:
695736
runs-on: Ubuntu-latest
696737
permissions:
697738
packages: write
698739
if: success()
699740
needs:
700-
- check
741+
- test-container
701742
- pre-setup # transitive, for accessing settings
702-
name: 🐳 containerize
743+
name: 🐳 ghcr:latest
703744
strategy:
704745
fail-fast: false
705746
steps:
@@ -736,26 +777,6 @@ jobs:
736777
docker buildx use proxypybuilder
737778
docker buildx inspect
738779
docker buildx ls
739-
- name: Build, run & test container
740-
run: >-
741-
CONTAINER_TAG="abhinavsingh/proxy.py:${{
742-
needs.pre-setup.outputs.container-version
743-
}}";
744-
docker buildx build
745-
--load
746-
--build-arg PROXYPY_PKG_PATH='dist/${{
747-
needs.pre-setup.outputs.wheel-artifact-name
748-
}}'
749-
-t $CONTAINER_TAG .
750-
&&
751-
docker run
752-
-d
753-
-p 8899:8899
754-
$CONTAINER_TAG
755-
--hostname 0.0.0.0
756-
--enable-web-server
757-
&&
758-
./tests/integration/test_integration.sh 8899
759780
- name: Push to GHCR
760781
run: >-
761782
REGISTRY_URL="ghcr.io/abhinavsingh/proxy.py";
@@ -794,6 +815,52 @@ jobs:
794815
needs.pre-setup.outputs.wheel-artifact-name
795816
}}'
796817
-t $LATEST_TAG .
818+
819+
ghcr-openssl:
820+
runs-on: Ubuntu-latest
821+
permissions:
822+
packages: write
823+
if: success()
824+
needs:
825+
- test-container
826+
- pre-setup # transitive, for accessing settings
827+
name: 🐳 ghcr:openssl
828+
strategy:
829+
fail-fast: false
830+
steps:
831+
- name: Checkout
832+
uses: actions/checkout@v2
833+
with:
834+
ref: ${{ github.event.inputs.release-commitish }}
835+
- name: Download all the dists
836+
uses: actions/download-artifact@v2
837+
with:
838+
name: python-package-distributions
839+
path: dist/
840+
- name: Login to GHCR
841+
uses: docker/login-action@v1
842+
with:
843+
registry: ghcr.io
844+
username: ${{ github.actor }}
845+
password: ${{ secrets.GITHUB_TOKEN }}
846+
- name: Set up Docker Buildx
847+
id: buildx
848+
uses: docker/setup-buildx-action@v1
849+
# See https://github.com/docker/buildx/issues/850#issuecomment-996408167
850+
with:
851+
version: v0.7.0
852+
buildkitd-flags: --debug
853+
config: .github/buildkitd.toml
854+
install: true
855+
- name: Enable Multiarch # This slows down arm build by 4-5x
856+
run: |
857+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
858+
- name: Create builder
859+
run: |
860+
docker buildx create --name proxypybuilder
861+
docker buildx use proxypybuilder
862+
docker buildx inspect
863+
docker buildx ls
797864
- name: Push openssl to GHCR
798865
run: >-
799866
REGISTRY_URL="ghcr.io/abhinavsingh/proxy.py";
@@ -830,6 +897,46 @@ jobs:
830897
needs.pre-setup.outputs.wheel-artifact-name
831898
}}'
832899
-t $LATEST_TAG .
900+
901+
docker-latest:
902+
runs-on: Ubuntu-latest
903+
permissions:
904+
packages: write
905+
if: success()
906+
needs:
907+
- test-container
908+
- pre-setup # transitive, for accessing settings
909+
name: 🐳 docker:latest
910+
strategy:
911+
fail-fast: false
912+
steps:
913+
- name: Checkout
914+
uses: actions/checkout@v2
915+
with:
916+
ref: ${{ github.event.inputs.release-commitish }}
917+
- name: Download all the dists
918+
uses: actions/download-artifact@v2
919+
with:
920+
name: python-package-distributions
921+
path: dist/
922+
- name: Set up Docker Buildx
923+
id: buildx
924+
uses: docker/setup-buildx-action@v1
925+
# See https://github.com/docker/buildx/issues/850#issuecomment-996408167
926+
with:
927+
version: v0.7.0
928+
buildkitd-flags: --debug
929+
config: .github/buildkitd.toml
930+
install: true
931+
- name: Enable Multiarch # This slows down arm build by 4-5x
932+
run: |
933+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
934+
- name: Create builder
935+
run: |
936+
docker buildx create --name proxypybuilder
937+
docker buildx use proxypybuilder
938+
docker buildx inspect
939+
docker buildx ls
833940
- name: Login to DockerHub
834941
uses: docker/login-action@v1
835942
with:
@@ -853,6 +960,28 @@ jobs:
853960
}}'
854961
-t $CONTAINER_TAG .
855962
963+
check: # This job does nothing and is only used for the branch protection
964+
if: always()
965+
966+
needs:
967+
- analyze
968+
- test
969+
- lint
970+
- dashboard
971+
- brew
972+
- developer
973+
- ghcr-latest
974+
- ghcr-openssl
975+
- docker-latest
976+
977+
runs-on: Ubuntu-latest
978+
979+
steps:
980+
- name: Decide whether the needed jobs succeeded or failed
981+
uses: re-actors/alls-green@release/v1
982+
with:
983+
jobs: ${{ toJSON(needs) }}
984+
856985
publish-pypi:
857986
name: Publish 🐍📦 ${{ needs.pre-setup.outputs.git-tag }} to PyPI
858987
needs:

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,4 @@ htmlcov
3131
dist
3232
build
3333

34-
proxy/public
3534
profile.svg

.isort.cfg

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# https://github.com/timothycrosley/isort/wiki/isort-Settings
2+
[settings]
3+
default_section = THIRDPARTY
4+
# force_to_top=file1.py,file2.py
5+
# forced_separate = django.contrib,django.utils
6+
include_trailing_comma = true
7+
indent = 4
8+
known_first_party = proxy
9+
# known_future_library = future,pies
10+
# known_standard_library = std,std2
11+
known_testing = pytest,unittest
12+
length_sort = 1
13+
# Should be: 80 - 1
14+
line_length = 79
15+
lines_after_imports = 2
16+
# https://pycqa.github.io/isort/docs/configuration/multi_line_output_modes.html
17+
# NOTE: Another mode could be "5" for grouping multiple "import from" under
18+
# NOTE: a single instruction.
19+
multi_line_output = 5
20+
no_lines_before = LOCALFOLDER
21+
sections=FUTURE,STDLIB,TESTING,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
22+
# skip=file3.py,file4.py
23+
use_parentheses = true
24+
verbose = true

.pre-commit-config.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
- --py36-plus
99

1010
# - repo: https://github.com/timothycrosley/isort.git
11-
# rev: 5.4.2
11+
# rev: 5.10.0
1212
# hooks:
1313
# - id: isort
1414
# args:
@@ -63,13 +63,6 @@ repos:
6363
src/core/plugins/inspect_traffic\.json|
6464
static/bootstrap-4\.3\.1\.min\.(cs|j)s
6565
)|
66-
menubar/proxy\.py/(
67-
Assets\.xcassets/(
68-
AppIcon\.appiconset/|
69-
StatusBarButtonImage\.imageset/|
70-
)|
71-
Preview\sContent/Preview\sAssets\.xcassets/
72-
)Contents\.json|
7366
requirements-release\.txt
7467
$
7568
- id: requirements-txt-fixer

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
".venv*/**/*.py",
3434
"venv*/**/*.py",
3535
"docs/**/*.py",
36-
"helper/**/*.py",
37-
"menubar/**/*.py"
36+
"helper/**/*.py"
3837
],
3938
"python.linting.pylintEnabled": true,
4039
"python.linting.pylintArgs": ["--generate-members"],

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ exclude ProxyPy.png
22
exclude Dashboard.png
33
exclude shortlink.gif
44
prune dashboard
5-
prune menubar

Makefile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ HTTPS_CERT_FILE_PATH := https-cert.pem
1212
HTTPS_CSR_FILE_PATH := https-csr.pem
1313
HTTPS_SIGNED_CERT_FILE_PATH := https-signed-cert.pem
1414

15-
CA_KEY_FILE_PATH := ca-key.pem
16-
CA_CERT_FILE_PATH := ca-cert.pem
17-
CA_SIGNING_KEY_FILE_PATH := ca-signing-key.pem
15+
CA_CERT_SUFFIX :=
16+
CA_KEY_FILE_PATH := ca-key$(CA_CERT_SUFFIX).pem
17+
CA_CERT_FILE_PATH := ca-cert$(CA_CERT_SUFFIX).pem
18+
CA_SIGNING_KEY_FILE_PATH := ca-signing-key$(CA_CERT_SUFFIX).pem
1819

1920
# Dummy invalid hardcoded value
2021
PROXYPY_PKG_PATH := dist/proxy.py.whl
@@ -28,7 +29,7 @@ endif
2829

2930
.PHONY: all https-certificates sign-https-certificates ca-certificates
3031
.PHONY: lib-check lib-clean lib-test lib-package lib-coverage lib-lint lib-pytest
31-
.PHONY: lib-release-test lib-release lib-profile lib-doc
32+
.PHONY: lib-release-test lib-release lib-profile lib-doc lib-pre-commit
3233
.PHONY: lib-dep lib-flake8 lib-mypy lib-speedscope container-buildx-all-platforms
3334
.PHONY: container container-run container-release container-build container-buildx
3435
.PHONY: devtools dashboard dashboard-clean container-without-openssl
@@ -91,16 +92,21 @@ lib-clean:
9192
rm -rf proxy.py.egg-info
9293
rm -rf .pytest_cache
9394
rm -rf .hypothesis
95+
# Doc RST files are cached and can cause issues
96+
# See https://github.com/abhinavsingh/proxy.py/issues/642#issuecomment-1003444578
97+
rm docs/pkg/*.rst
9498

9599
lib-dep:
96100
pip install --upgrade pip && \
97101
pip install \
98-
-r requirements.txt \
99102
-r requirements-testing.txt \
100103
-r requirements-release.txt \
101104
-r requirements-tunnel.txt && \
102105
pip install "setuptools>=42"
103106

107+
lib-pre-commit:
108+
python -m pre_commit run --hook-stage manual --all-files -v
109+
104110
lib-lint:
105111
python -m tox -e lint
106112

0 commit comments

Comments
 (0)