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

Switch to using setuptools. #12

Open
wants to merge 5 commits 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
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ python:
# - "pypy"

install:
- pip install cython
- python setup.py install

# command to run tests, e.g. python setup.py test
script: py.test
script: "py.test tests"
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ include hat-trie/configure
include hat-trie/configure.ac

include src/hat_trie.pyx
include src/chat_datrie.pxd
include src/chat_trie.pxd

25 changes: 15 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
#! /usr/bin/env python
import os
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

from setuptools import setup
from setuptools.extension import Extension

def build_ext_proxy(*args, **kwargs):
from Cython.Distutils import build_ext
return build_ext(*args, **kwargs)

HATTRIE_DIR = 'hat-trie/src'
HATTRIE_FILE_NAMES = ['ahtable.c', 'hat-trie.c', 'misc.c', 'murmurhash3.c']
HATTRIE_FILES = [os.path.join(HATTRIE_DIR, name) for name in HATTRIE_FILE_NAMES]

setup(
name="hat-trie",
version="0.1",
description="HAT-Trie for Python",
long_description = open('README.rst').read() + "\n\n" + open('CHANGES.rst').read(),
name='hat-trie',
version='0.1',
description='HAT-Trie for Python',
long_description = open('README.rst').read() + '\n\n' + open('CHANGES.rst').read(),
author='Mikhail Korobov',
author_email='[email protected]',
url='https://github.com/kmike/hat-trie/',
#packages = ['hat_trie'],
cmdclass = {'build_ext': build_ext},
cmdclass = {'build_ext': build_ext_proxy},

ext_modules = [
Extension(
"hat_trie",
'hat_trie',
['src/hat_trie.pyx', 'src/chat_trie.pxd'] + HATTRIE_FILES,
#['src/datrie.c', 'src/cdatrie.c', 'src/stdio_ext.c'] + HATTRIE_FILES,
include_dirs=['hat-trie/src'],
)
],
Expand All @@ -46,4 +49,6 @@
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Text Processing :: Linguistic',
],

setup_requires=['cython'],
)
Loading