Skip to content

Commit

Permalink
Merge pull request #8 from bbc/feat/pipenv
Browse files Browse the repository at this point in the history
Uses pipenv to manage deps
  • Loading branch information
moschopsuk committed Nov 13, 2018
2 parents 7b24c80 + df8c11d commit 0bf3c52
Show file tree
Hide file tree
Showing 4 changed files with 344 additions and 16 deletions.
21 changes: 21 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
pyyaml = "*"
gbulb = "*"
sanic = "*"
websockets = "~=5.0.0"
pytest = "*"
pillow = "*"
pygobject = "*"
vext = "*"
psutil = "*"
gobject = "*"

[dev-packages]

[requires]
python_version = "3.6"
298 changes: 298 additions & 0 deletions Pipfile.lock

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

3 changes: 1 addition & 2 deletions brave/outputs/webrtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ def on_message(bus, message):
t = message.type
if t == Gst.MessageType.ELEMENT:
if message.get_structure().get_name() == 'level':
s = message.get_structure()
channels = len(s['peak'])
channels = len(message.get_structure().get_value('peak'))
data = []

for i in range(0, channels):
Expand Down
38 changes: 24 additions & 14 deletions docs/install_macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,34 @@ This explains how to install Brave on macOS.

First up, make sure you have Homebrew.

## Installing Python
## Installing Dependancies

You need 3.6 or higher!
Brave uses from of the newier features of Python. As such we recomend python 3.6 (or higher).

It's worth confirming that the pip matches the version you've installed:
### Managing Dependencies

```
pip --version
# Make sure it says "(python 3.6)" (or higher)
```
Brave uses [Pipeenv](https://packaging.python.org/tutorials/managing-dependencies/#managing-dependencies) to manage an isolate its dependencies

Now the Python libraries:
If not installed please install using:

```
pip install pyyaml gbulb sanic websockets pytest pillow
```
`pip install --user pipenv` or `pip3 install --user pipenv`

If your python was installed by brew please use `brew install pipenv`

`pipenv install`

### Errors while installing

Brave uses python-gst which requires the uses of GI. This can be a little tricky to working on OSX with a virtual enviroment. To get around this we can use vext. It requires the libary `libffi`.

Install the libary
`brew install libffi`

Add the location to the env.
`export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"`

Try running the install process again.
`pipenv install`

## Installing gstreamer

Expand All @@ -45,6 +57,4 @@ brew install gst-libav gst-python

Try it out

```
./brave.py
```
`pipenv run python3 brave.py`

0 comments on commit 0bf3c52

Please sign in to comment.