8000 Support virtualenv by dnephin · Pull Request #10 · Yelp/ybinlogp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

Support virtualenv #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
dist/
build/
logs/
.tox
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ flakes:
test: tests

tests: all
LD_LIBRARY_PATH=build \
PYTHONPATH=src \
testify --summary --exclude-suite=disabled --verbose tests
tox

clean:
make -C build clean
Expand Down
8 changes: 7 additions & 1 deletion src/ybinlogp/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@

log = logging.getLogger('ybinlogp')

library = ctypes.CDLL("libybinlogp.so.1", use_errno=True)
try:
library = ctypes.CDLL("libybinlogp.so.1", use_errno=True)
except OSError:
import os.path
from distutils.sysconfig import get_python_lib
path = os.path.join(get_python_lib(), '../../libybinlogp.so.1')
library = ctypes.CDLL(os.path.abspath(path), use_errno=True)


class EventStruct(ctypes.Structure):
Expand Down
21 changes: 21 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[tox]
envlist = py26, py27

[testenv]
deps =
testify
flake8
commands =
testify --summary --exclude-suite=disabled --verbose tests
flake8 src/ybinlogp

[testenv:docs]
deps =
-rrequirements.txt
sphinx
changedir = docs
commands = sphinx-build -b html -d build/doctrees source build/html

[flake8]
ignore = W191,E402,F401,E302,E101,E128,E126
max_line_length = 90
0