Skip to content

Commit

Permalink
Working with Pytnon 3.3 using nltk3.0a
Browse files Browse the repository at this point in the history
  • Loading branch information
sloria committed Jul 7, 2013
1 parent 0a5a699 commit c974354
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: python
python:
- "2.7"
- "3.3"
# Install dependencies
install:
- "pip install -U . --use-mirrors"
Expand Down
2 changes: 1 addition & 1 deletion nltk/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
except ImportError:
from xml.etree import ElementTree

from nltk import __file__
# from nltk import __file__
from nltk import compat
######################################################################
# Regular Expression Processing
Expand Down
31 changes: 27 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os

import text
from distutils.util import convert_path

try:
from setuptools import setup
Expand Down Expand Up @@ -32,6 +33,31 @@
sys.exit()


def find_packages(where='.', exclude=()):
"""Return a list all Python packages found within directory 'where'
'where' should be supplied as a "cross-platform" (i.e. URL-style) path; it
will be converted to the appropriate local path syntax. 'exclude' is a
sequence of package names to exclude; '*' can be used as a wildcard in the
names, such that 'foo.*' will exclude all subpackages of 'foo' (but not
'foo' itself).
"""
out = []
stack = [(convert_path(where), '')]
while stack:
where, prefix = stack.pop(0)
for name in os.listdir(where):
fn = os.path.join(where, name)
if ('.' not in name and os.path.isdir(fn) and
os.path.isfile(os.path.join(fn, '__init__.py'))):
out.append(prefix+name)
stack.append((fn, prefix + name + '.'))
for pat in list(exclude)+['ez_setup', 'distribute_setup']:
from fnmatch import fnmatchcase
out = [item for item in out if not fnmatchcase(item, pat)]
return out


def cheeseshopify(rst):
'''Since PyPI doesn't support the `code-block` or directive, this replaces
all `code-block` directives with `::`.
Expand All @@ -52,10 +78,7 @@ def cheeseshopify(rst):
author_email='[email protected]',
url='https://github.com/sloria/TextBlob',
install_requires=['PyYAML'],
packages=[
'text',
'nltk'
],
packages=find_packages(),
package_data={
"text": ["*.txt", "*.xml"],
},
Expand Down
1 change: 0 additions & 1 deletion text/blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from .mixins import ComparableMixin



class WordList(list):

'''A list-like collection of words.'''
Expand Down
1 change: 1 addition & 0 deletions text/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
basestring = str
else:
unicode = unicode

0 comments on commit c974354

Please sign in to comment.