diff --git a/fabfile.py b/fabfile.py new file mode 100644 index 0000000..d6be11a --- /dev/null +++ b/fabfile.py @@ -0,0 +1,22 @@ +from fabric.api import local + +exclude_command = "--exclude nlpre/spacy_models/" + + +def test(): + local("nosetests --with-coverage --cover-package nlpre --cover-html") + + +def lint(): + local(f"black -l 80 nlpre tests *.py {exclude_command}") + local(f"flake8 nlpre --ignore=E501,E203,W503 {exclude_command}") + + +def view_cover(): + local("xdg-open cover/index.html") + + +def clean(): + local("rm -rvf .coverage cover/ .tox *.egg-info/ docs/ dist/") + for tag in ["*.pyc", "*~"]: + local(f"find . -name '%s' | xargs -I {tag} rm -v {tag}") diff --git a/requirements.txt b/requirements.txt index 6f5db65..9695fac 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,6 +7,6 @@ coverage flake8 nose -invoke +Fabric3 black tox diff --git a/setup.py b/setup.py index ea4c05e..aa573bd 100644 --- a/setup.py +++ b/setup.py @@ -3,84 +3,68 @@ __local__ = os.path.abspath(os.path.dirname(__file__)) -f_version = os.path.join(__local__, 'nlpre', '_version.py') +f_version = os.path.join(__local__, "nlpre", "_version.py") exec(open(f_version).read()) # Get the long description from the relevant file -long_description = '''NLPre +long_description = """NLPre ================================= A collection of Natural Language Preprocessing (NLPre) utilities, suitable for a pipeline. -''' +""" setuptools.setup( - name='nlpre', + name="nlpre", packages=setuptools.find_packages(), - # Include package data... include_package_data=True, - - install_requires = [ + install_requires=[ # NLP core libraries - 'unidecode', - 'pyparsing', - 'flashtext', - + "unidecode", + "pyparsing", + "flashtext", # See https://github.com/explosion/spaCy/issues/1099 for dataset # Fix the minor version so model doesn't change - 'spacy==2.1.0', - + "spacy==2.1.0", # Fix the version of mysqlclient due to windows problems - #"mysqlclient==1.3.12", + # "mysqlclient==1.3.12", ], - - description='Natural Language Preprocessing (NLPre) utilities.', + description="Natural Language Preprocessing (NLPre) utilities.", long_description=long_description, version=__version__, - # The project's main homepage. url="https://github.com/NIHOPA/NLPre", - #download_url='https://github.com/NIHOPA/NLPre/archive/v2.0.0.zip', - + # download_url='https://github.com/NIHOPA/NLPre/archive/v2.0.0.zip', # Author details author="Travis Hoppe", author_email="travis.hoppe+nlpre@gmail.com", - # Choose your license - license='CC0', - + license="CC0", # See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ # How mature is this project? Common values are # 3 - Alpha # 4 - Beta # 5 -Production/Stable - 'Development Status :: 5 - Production/Stable', - + "Development Status :: 5 - Production/Stable", # Indicate who your project is intended for - 'Intended Audience :: Developers', - 'Intended Audience :: Science/Research', - 'Intended Audience :: Healthcare Industry', - 'Intended Audience :: Education', - 'Intended Audience :: Financial and Insurance Industry', - - 'Natural Language :: English', - - 'Topic :: Text Processing', - 'Topic :: Text Processing :: Filters', - 'Topic :: Utilities', - + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Intended Audience :: Healthcare Industry", + "Intended Audience :: Education", + "Intended Audience :: Financial and Insurance Industry", + "Natural Language :: English", + "Topic :: Text Processing", + "Topic :: Text Processing :: Filters", + "Topic :: Utilities", # Pick your license as you wish (should match "license" above) - 'License :: OSI Approved :: MIT License', - + "License :: OSI Approved :: MIT License", # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. - 'Programming Language :: Python :: 3.6', + "Programming Language :: Python :: 3.6", ], - # What does your project relate to? keywords="NLP", - - test_suite='nose.collector', - tests_require=['nose'], + test_suite="nose.collector", + tests_require=["nose"], ) diff --git a/tasks.py b/tasks.py deleted file mode 100644 index 038be93..0000000 --- a/tasks.py +++ /dev/null @@ -1,23 +0,0 @@ -from invoke import task - -exclude_command = '--exclude nlpre/spacy_models/' - -@task -def test(c): - c.run("nosetests --with-coverage --cover-package nlpre --cover-html") - -@task -def lint(c): - c.run(f"black -l 80 nlpre tests {exclude_command}") - c.run(f"flake8 nlpre --ignore=E501,E203,W503 {exclude_command}") - -@task -def view_cover(c): - c.run("xdg-open cover/index.html") - -@task -def clean(c): - c.run('rm -rvf .coverage cover/ .tox *.egg-info/ docs/ dist/') - for tag in ["*.pyc", "*~",]: - c.run(f"find . -name '%s' | xargs -I {tag} rm -v {tag}") -