Skip to content

Commit 6ff34e9

Browse files
authored
Merge pull request #71 from ducalpha/fixes_on_mac
Fixes on mac
2 parents e9bb79f + 9645e9e commit 6ff34e9

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ nose:
1717
unittest:
1818
python -m unittest discover -s test
1919

20-
install: build
21-
python setup.py install
20+
# using python setup.py deploys as .egg, causing the model file not found
21+
# using pip install deploys as a directory, so the model file can be found
22+
# install: build
23+
# python setup.py install
2224

2325
install-pip: build
2426
pip install .
27+
28+
install: install-pip

dragnet/util.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ def get_and_union_features(features):
147147
else:
148148
return features
149149

150-
151150
def load_pickled_model(filename, dirname=None):
152151
"""
153152
Load a pickled ``Extractor`` model from disk.
@@ -162,7 +161,7 @@ def load_pickled_model(filename, dirname=None):
162161
:class:`dragnet.extractor.Extractor`
163162
"""
164163
if dirname is None:
165-
pkg_filename = pkgutil.get_loader('dragnet').get_filename()
164+
pkg_filename = pkgutil.get_loader('dragnet').get_filename('dragnet')
166165
pkg_dirname = os.path.dirname(pkg_filename)
167166
dirname = os.path.join(pkg_dirname, 'pickled_models', model_path)
168167
filepath = os.path.join(dirname, filename)

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import os.path
2525
import lxml
26+
import sys
2627

2728
from setuptools import setup
2829
from numpy import get_include
@@ -51,7 +52,7 @@ def find_libxml2_include():
5152
Extension('dragnet.features._readability',
5253
sources=["dragnet/features/_readability.pyx"],
5354
include_dirs=[get_include()],
54-
extra_compile_args=['-std=c++0x'],
55+
extra_compile_args=['-std=c++11'] + (['-mmacosx-version-min=10.9'] if sys.platform.startswith("darwin") else []),
5556
language="c++"),
5657
Extension('dragnet.features._kohlschuetter',
5758
sources=["dragnet/features/_kohlschuetter.pyx"],

0 commit comments

Comments
 (0)