Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses pipenv to manage deps #8

Merged
merged 3 commits into from
Nov 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`