Accepting request 940334 from home:bnavigator:branches:devel:languages:python
- Don't use the same command name as conflicting libproxy: Use `proxy-py` instead of `proxy`. (Cannot use `proxy.py` due to import problems). Add proxy.py-command.patch OBS-URL: https://build.opensuse.org/request/show/940334 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-proxy.py?expand=0&rev=2
This commit is contained in:
parent
12d7bd4663
commit
94b3030df3
143
proxy.py-command.patch
Normal file
143
proxy.py-command.patch
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
Index: proxy.py-2.3.1/README.md
|
||||||
|
===================================================================
|
||||||
|
--- proxy.py-2.3.1.orig/README.md
|
||||||
|
+++ proxy.py-2.3.1/README.md
|
||||||
|
@@ -231,14 +231,14 @@ or from GitHub `master` branch
|
||||||
|
## From command line when installed using PIP
|
||||||
|
|
||||||
|
When `proxy.py` is installed using `pip`,
|
||||||
|
-an executable named `proxy` is placed under your `$PATH`.
|
||||||
|
+an executable named `proxy-py` is placed under your `$PATH`.
|
||||||
|
|
||||||
|
#### Run it
|
||||||
|
|
||||||
|
-Simply type `proxy` on command line to start it with default configuration.
|
||||||
|
+Simply type `proxy-py` on command line to start it with default configuration.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
-❯ proxy
|
||||||
|
+❯ proxy-py
|
||||||
|
...[redacted]... - Loaded plugin proxy.http_proxy.HttpProxyPlugin
|
||||||
|
...[redacted]... - Starting 8 workers
|
||||||
|
...[redacted]... - Started server on ::1:8899
|
||||||
|
@@ -268,7 +268,7 @@ All the logs above are `INFO` level logs
|
||||||
|
Lets start `proxy.py` with `DEBUG` level logging:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
-❯ proxy --log-level d
|
||||||
|
+❯ proxy-py --log-level d
|
||||||
|
...[redacted]... - Open file descriptor soft limit set to 1024
|
||||||
|
...[redacted]... - Loaded plugin proxy.http_proxy.HttpProxyPlugin
|
||||||
|
...[redacted]... - Started 8 workers
|
||||||
|
@@ -286,7 +286,7 @@ See [flags](#flags) for full list of ava
|
||||||
|
## From command line using repo source
|
||||||
|
|
||||||
|
If you are trying to run `proxy.py` from source code,
|
||||||
|
-there is no binary file named `proxy` in the source code.
|
||||||
|
+there is no binary file named `proxy-py` in the source code.
|
||||||
|
|
||||||
|
To start `proxy.py` from source code follow these instructions:
|
||||||
|
|
||||||
|
@@ -362,7 +362,7 @@ Add support for short links in your favo
|
||||||
|
Start `proxy.py` as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
-❯ proxy \
|
||||||
|
+❯ proxy-py \
|
||||||
|
--plugins proxy.plugin.ShortLinkPlugin
|
||||||
|
```
|
||||||
|
|
||||||
|
@@ -391,7 +391,7 @@ Modifies POST request body before sendin
|
||||||
|
Start `proxy.py` as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
-❯ proxy \
|
||||||
|
+❯ proxy-py \
|
||||||
|
--plugins proxy.plugin.ModifyPostDataPlugin
|
||||||
|
```
|
||||||
|
|
||||||
|
@@ -445,7 +445,7 @@ without need of an actual upstream REST
|
||||||
|
Start `proxy.py` as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
-❯ proxy \
|
||||||
|
+❯ proxy-py \
|
||||||
|
--plugins proxy.plugin.ProposedRestApiPlugin
|
||||||
|
```
|
||||||
|
|
||||||
|
@@ -476,7 +476,7 @@ also running on `8899` port.
|
||||||
|
Start `proxy.py` and enable inbuilt web server:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
-❯ proxy \
|
||||||
|
+❯ proxy-py \
|
||||||
|
--enable-web-server \
|
||||||
|
--plugins proxy.plugin.RedirectToCustomServerPlugin
|
||||||
|
```
|
||||||
|
@@ -510,7 +510,7 @@ By default, plugin drops traffic for `go
|
||||||
|
Start `proxy.py` as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
-❯ proxy \
|
||||||
|
+❯ proxy-py \
|
||||||
|
--plugins proxy.plugin.FilterByUpstreamHostPlugin
|
||||||
|
```
|
||||||
|
|
||||||
|
@@ -619,7 +619,7 @@ Modifies upstream server responses.
|
||||||
|
Start `proxy.py` as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
-❯ proxy \
|
||||||
|
+❯ proxy-py \
|
||||||
|
--plugins proxy.plugin.ManInTheMiddlePlugin
|
||||||
|
```
|
||||||
|
|
||||||
|
@@ -804,7 +804,7 @@ make https-certificates
|
||||||
|
Start `proxy.py` as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
-❯ proxy \
|
||||||
|
+❯ proxy-py \
|
||||||
|
--cert-file https-cert.pem \
|
||||||
|
--key-file https-key.pem
|
||||||
|
```
|
||||||
|
@@ -853,7 +853,7 @@ Lets also enable `CacheResponsePlugin` s
|
||||||
|
response from the server. Start `proxy.py` as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
-❯ proxy \
|
||||||
|
+❯ proxy-py \
|
||||||
|
--plugins proxy.plugin.CacheResponsesPlugin \
|
||||||
|
--ca-key-file ca-key.pem \
|
||||||
|
--ca-cert-file ca-cert.pem \
|
||||||
|
@@ -1052,7 +1052,7 @@ Start `proxy.py` as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ # On localhost
|
||||||
|
-❯ proxy --enable-tunnel \
|
||||||
|
+❯ proxy-py --enable-tunnel \
|
||||||
|
--tunnel-username username \
|
||||||
|
--tunnel-hostname ip.address.or.domain.name \
|
||||||
|
--tunnel-port 22 \
|
||||||
|
@@ -1669,7 +1669,7 @@ few obvious ones include:
|
||||||
|
# Flags
|
||||||
|
|
||||||
|
```bash
|
||||||
|
-❯ proxy -h
|
||||||
|
+❯ proxy-py -h
|
||||||
|
usage: proxy [-h] [--threadless] [--backlog BACKLOG] [--enable-events]
|
||||||
|
[--hostname HOSTNAME] [--port PORT] [--num-workers NUM_WORKERS]
|
||||||
|
[--client-recvbuf-size CLIENT_RECVBUF_SIZE] [--key-file KEY_FILE]
|
||||||
|
Index: proxy.py-2.3.1/setup.py
|
||||||
|
===================================================================
|
||||||
|
--- proxy.py-2.3.1.orig/setup.py
|
||||||
|
+++ proxy.py-2.3.1/setup.py
|
||||||
|
@@ -40,7 +40,7 @@ if __name__ == '__main__':
|
||||||
|
install_requires=open('requirements.txt', 'r').read().strip().split(),
|
||||||
|
entry_points={
|
||||||
|
'console_scripts': [
|
||||||
|
- 'proxy = proxy:entry_point'
|
||||||
|
+ 'proxy-py = proxy:entry_point'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
classifiers=[
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Dec 13 17:33:03 UTC 2021 - Ben Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
- Don't use the same command name as conflicting libproxy:
|
||||||
|
Use `proxy-py` instead of `proxy`. (Cannot use `proxy.py` due to
|
||||||
|
import problems). Add proxy.py-command.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sat Dec 11 19:50:52 UTC 2021 - Ben Greiner <code@bnavigator.de>
|
Sat Dec 11 19:50:52 UTC 2021 - Ben Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
@ -26,12 +26,14 @@ License: BSD-3-Clause
|
|||||||
URL: https://github.com/abhinavsingh/proxy.py
|
URL: https://github.com/abhinavsingh/proxy.py
|
||||||
# PyPI sdist does not have tests, use Github source
|
# PyPI sdist does not have tests, use Github source
|
||||||
Source: https://github.com/abhinavsingh/proxy.py/archive/refs/tags/v%{version}.tar.gz#/proxy.py-%{version}-gh.tar.gz
|
Source: https://github.com/abhinavsingh/proxy.py/archive/refs/tags/v%{version}.tar.gz#/proxy.py-%{version}-gh.tar.gz
|
||||||
|
# PATCH-FIX-OPENSUSE proxy.py-command.patch -- deconflict with libproxy, code@bnavigator.de
|
||||||
|
Patch0: proxy.py-command.patch
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-typing-extensions >= 3.7.4.3
|
Requires: python-typing-extensions >= 3.7.4.3
|
||||||
Requires(post): update-alternatives
|
Requires(post): update-alternatives
|
||||||
Requires(postun): update-alternatives
|
Requires(postun):update-alternatives
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
# SECTION test requirements
|
# SECTION test requirements
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
@ -44,30 +46,32 @@ BuildRequires: openssl
|
|||||||
Fast, Lightweight, Pluggable, TLS interception capable proxy server
|
Fast, Lightweight, Pluggable, TLS interception capable proxy server
|
||||||
focused on Network monitoring, controls & Application development, testing, debugging.
|
focused on Network monitoring, controls & Application development, testing, debugging.
|
||||||
|
|
||||||
|
Note: On SUSE distributions, the command is installed as proxy-py not as proxy.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n proxy.py-%{version}
|
%autosetup -p1 -n proxy.py-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%python_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%python_install
|
%python_install
|
||||||
%python_clone -a %{buildroot}%{_bindir}/proxy
|
%python_clone -a %{buildroot}%{_bindir}/proxy-py
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%pytest
|
%pytest
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%python_install_alternative proxy
|
%python_install_alternative proxy-py
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
%python_uninstall_alternative proxy
|
%python_uninstall_alternative proxy-py
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%python_alternative %{_bindir}/proxy
|
%python_alternative %{_bindir}/proxy-py
|
||||||
%{python_sitelib}/proxy
|
%{python_sitelib}/proxy
|
||||||
%{python_sitelib}/proxy.py-%{version}*-info
|
%{python_sitelib}/proxy.py-%{version}*-info
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user