Skip to content

Commit

Permalink
Merge pull request #7 from staticdev/master
Browse files Browse the repository at this point in the history
Config and requirements improvements
  • Loading branch information
thalesbertaglia authored Jan 18, 2019
2 parents e37a9ac + 286728f commit 4acc7b8
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 22 deletions.
6 changes: 3 additions & 3 deletions enelvo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Enelvo
~~~~~~~~~~~~~~~~~~~
A flexible normalizer for user-generated content.
:copyright: (c) 2017 by Thales Bertaglia
:copyright: (c) 2017-2019 by Thales Bertaglia
:licence: MIT, see LICENSE for more details
"""
import logging
Expand All @@ -13,13 +13,13 @@
__summary__ = 'A flexible normaliser for user-generated content.'
__uri__ = 'https://www.github.com/tfcbertaglia/enelvo'

__version__ = '0.0.7'
__version__ = '0.0.9'

__author__ = 'Thales Bertaglia'
__email__ = '[email protected]'

__license__ = 'MIT'
__copyright__ = 'Copyright 2017 Thales Bertaglia'
__copyright__ = 'Copyright 2017-2019 Thales Bertaglia'

# the user should dictate what happens when a logging event occurs
logging.getLogger(__name__).addHandler(logging.NullHandler())
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
gensim>=2.2.0
emoji>=0.4.5
tabulate>=0.7.7
editdistance>=0.3.1
numpy>=1.13.3
cython
gensim==3.6.0
emoji==0.5.1
tabulate==0.8.2
editdistance==0.5.2
numpy==1.16.0
cython==0.29.2
49 changes: 36 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,43 @@
import codecs
import os.path
import re
import sys
from Cython.Build import cythonize
from Cython.Distutils import build_ext
from setuptools import setup, Extension

here = os.path.abspath(os.path.dirname(__file__))


def read(*parts):
return codecs.open(os.path.join(here, *parts), 'r').read()


def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")

REQUIRED_PYTHON = (3, 5)

ext_modules = [
Extension("enelvo.metrics.cythonlcs", ["enelvo/metrics/cythonlcs.pyx"], include_dirs=['.'])]
Extension("enelvo.metrics.cythonlcs",
["enelvo/metrics/cythonlcs.pyx"], include_dirs=['.'])]

setup(
name='Enelvo',
version='0.0.7',
version=find_version("enelvo", "__init__.py"),
packages=['enelvo', 'enelvo.preprocessing', 'enelvo.candidate_generation',
'enelvo.candidate_scoring', 'enelvo.metrics', 'enelvo.utils', 'enelvo.preprocessing.tokenizer'],
package_data = {'enelvo' : ['../requirements.txt', 'resources/lexicons/*',
'resources/corr-lexicons/*', 'resources/embeddings/norm_lexicon.pickle',
'../setup_cython.py', '../build/*',
'preprocessing/tokenizer/lexicons/*'] },
'enelvo.candidate_scoring', 'enelvo.metrics',
'enelvo.utils', 'enelvo.preprocessing.tokenizer'],
package_data={'enelvo': ['../requirements.txt', 'resources/lexicons/*',
'resources/corr-lexicons/*',
'resources/embeddings/norm_lexicon.pickle',
'../setup_cython.py', '../build/*',
'preprocessing/tokenizer/lexicons/*']},
license='MIT',
long_description=open('README.md', encoding='utf-8').read(),
author='Thales Bertaglia',
Expand All @@ -24,12 +46,13 @@
python_requires='>={}.{}'.format(*REQUIRED_PYTHON),
include_package_data=True,
install_requires=[
'gensim>=2.2.0',
'emoji>=0.4.5',
'tabulate>=0.7.7',
'editdistance>=0.3.1',
'numpy>=1.13.3', 'cython'],
'gensim>=3.6.0',
'emoji>=0.5.1',
'tabulate>=0.8.2',
'editdistance>=0.5.2',
'numpy>=1.16.0',
'cython>=0.29.2'],
cmdclass={'build_ext': build_ext},
ext_modules=ext_modules,
options={'build_ext':{'inplace':True, 'force':True}},
options={'build_ext': {'inplace': True, 'force': True}},
)

0 comments on commit 4acc7b8

Please sign in to comment.