Skip to content

Commit

Permalink
Packaging (#210)
Browse files Browse the repository at this point in the history
* Move docker installation steps above

* Try brewing with virtualenv

* depends on python

* Update homebrew formula for stable release

* Just test brewing on latest python
  • Loading branch information
abhinavsingh committed Dec 2, 2019
1 parent 4713ad6 commit 54d2a1c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 48 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-brew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
strategy:
matrix:
os: [macOS]
python: [3.5, 3.6, 3.7, 3.8]
max-parallel: 4
python: [3.8]
max-parallel: 1
fail-fast: false
steps:
- uses: actions/checkout@v1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
.coverage
.coverage.*
.idea
Expand Down
40 changes: 19 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ Table of Contents
* [Using PIP](#using-pip)
* [Stable version](#stable-version-with-pip)
* [Development version](#development-version-with-pip)
* [Using Docker](#using-docker)
* [Stable version](#stable-version-from-docker-hub)
* [Development version](#build-development-version-locally)
* [Using HomeBrew](#using-homebrew)
* [Stable version](#stable-version-with-homebrew)
* [Development version](#development-version-with-homebrew)
* [Using Docker](#using-docker)
* [Start proxy.py](#start-proxypy)
* [From command line when installed using PIP](#from-command-line-when-installed-using-pip)
* [Run it](#run-it)
* [Understanding logs](#understanding-logs)
* [Enable DEBUG logging](#enable-debug-logging)
* [From command line using repo source](#from-command-line-using-repo-source)
* [Docker Image](#docker-image)
* [Stable version](#stable-version-from-docker-hub)
* [Development version](#build-development-version-locally)
* [Customize Startup Flags](#customize-startup-flags)
* [Plugin Examples](#plugin-examples)
* [HTTP Proxy Plugins](#http-proxy-plugins)
Expand Down Expand Up @@ -174,6 +174,22 @@ or from GitHub `master` branch

$ pip install git+https://github.com/abhinavsingh/proxy.py.git@develop

## Using Docker

#### Stable Version from Docker Hub

$ docker run -it -p 8899:8899 --rm abhinavsingh/proxy.py:latest

#### Build Development Version Locally

$ git clone https://github.com/abhinavsingh/proxy.py.git
$ cd proxy.py
$ make container
$ docker run -it -p 8899:8899 --rm abhinavsingh/proxy.py:latest

[![WARNING](https://img.shields.io/static/v1?label=MacOS&message=warning&color=red)](https://github.com/moby/vpnkit/issues/469)
`docker` image is currently broken on `macOS` due to incompatibility with [vpnkit](https://github.com/moby/vpnkit/issues/469).

## Using HomeBrew

### Stable Version with HomeBrew
Expand All @@ -184,10 +200,6 @@ or from GitHub `master` branch

$ brew install https://raw.githubusercontent.com/abhinavsingh/proxy.py/develop/homebrew/develop/proxy.rb

## Using Docker

For `Docker` installation see [Docker Image](#docker-image).

Start proxy.py
==============

Expand Down Expand Up @@ -291,17 +303,6 @@ if you plan to work with `proxy.py` source code.

## Docker image

#### Stable Version from Docker Hub

$ docker run -it -p 8899:8899 --rm abhinavsingh/proxy.py:latest

#### Build Development Version Locally

$ git clone https://github.com/abhinavsingh/proxy.py.git
$ cd proxy.py
$ make container
$ docker run -it -p 8899:8899 --rm abhinavsingh/proxy.py:latest

#### Customize startup flags

By default `docker` binary is started with IPv4 networking flags:
Expand All @@ -316,9 +317,6 @@ For example, to check `proxy.py` version within Docker image:
--rm abhinavsingh/proxy.py:latest \
-v

[![WARNING](https://img.shields.io/static/v1?label=MacOS&message=warning&color=red)](https://github.com/moby/vpnkit/issues/469)
`docker` image is currently broken on `macOS` due to incompatibility with [vpnkit](https://github.com/moby/vpnkit/issues/469).

Plugin Examples
===============

Expand Down
17 changes: 4 additions & 13 deletions homebrew/develop/proxy.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
class Proxy < Formula
include Language::Python::Virtualenv

desc "⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging."
homepage "https://github.com/abhinavsingh/proxy.py"
url "https://github.com/abhinavsingh/proxy.py/archive/develop.zip"
version "HEAD"
version "develop"

depends_on "python"

Expand All @@ -13,17 +15,6 @@ class Proxy < Formula
end

def install
xy = Language::Python.major_minor_version "python3"

ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python#{xy}/site-packages"
resource("typing-extensions").stage do
system "python3", *Language::Python.setup_install_args(libexec/"vendor")
end

ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python#{xy}/site-packages"
system "python3", *Language::Python.setup_install_args(libexec)

bin.install Dir[libexec/"bin/*"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
virtualenv_install_with_resources
end
end
15 changes: 3 additions & 12 deletions homebrew/stable/proxy.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class Proxy < Formula
include Language::Python::Virtualenv

desc "⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging."
homepage "https://github.com/abhinavsingh/proxy.py"
Expand All @@ -13,17 +15,6 @@ class Proxy < Formula
end

def install
xy = Language::Python.major_minor_version "python3"

ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python#{xy}/site-packages"
resource("typing-extensions").stage do
system "python3", *Language::Python.setup_install_args(libexec/"vendor")
end

ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python#{xy}/site-packages"
system "python3", *Language::Python.setup_install_args(libexec)

bin.install Dir[libexec/"bin/*"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
virtualenv_install_with_resources
end
end

0 comments on commit 54d2a1c

Please sign in to comment.