diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..210d02e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +# Config file for automatic testing at travis-ci.org +sudo: false + +language: python +python: 3.5 + +install: + - pip install tox + +script: tox diff --git a/LICENSE.txt b/LICENSE.txt index c06d528..58e9c2d 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,5 @@ Copyright (c) 2011-2012 Gregory Haskins, http://greghaskins.com +Copyright (c) 2016 YPlan, http://github.com/YPlan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..97e2ad3 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include LICENSE.txt +include README.rst diff --git a/README b/README deleted file mode 120000 index 92cacd2..0000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ -README.rst \ No newline at end of file diff --git a/requirements.in b/requirements.in new file mode 100644 index 0000000..e079f8a --- /dev/null +++ b/requirements.in @@ -0,0 +1 @@ +pytest diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..9716eb7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,8 @@ +# +# This file is autogenerated by pip-compile +# To update, run: +# +# pip-compile --output-file requirements.txt requirements.in +# +py==1.4.31 # via pytest +pytest==3.0.2 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..2a9acf1 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal = 1 diff --git a/setup.py b/setup.py index 0622f18..b70702d 100644 --- a/setup.py +++ b/setup.py @@ -1,37 +1,37 @@ import os -try: - # use setuptools if available - from setuptools import setup - kwargs = { - 'entry_points': {'console_scripts': - 'gibberish = gibberish:console_main', - } - } -except ImportError: - # fall back to distutils - from distutils import setup - kwargs = {} +from setuptools import setup base_dir = os.path.dirname(os.path.abspath(__file__)) +with open(os.path.join(base_dir, 'README.rst')) as fp: + long_description = fp.read() + setup( - name='Gibberish', + name='gibberish', description="A pseudo-word generator", - version='0.3', + version='0.3.1', author='Gregory Haskins', author_email='greg@greghaskins.com', url='https://github.com/greghaskins/gibberish', packages=('gibberish',), license='MIT License', - long_description=open(os.path.join(base_dir, 'README.rst')).read(), + long_description=long_description, install_requires=['PyYAML'], package_data={ 'gibberish': ['database/*'], }, - # include_package_data=True, extras_require={ 'dev': ['nltk'] - }, - **kwargs + }, + classifiers=[ + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Natural Language :: English', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', + ], + entry_points={ + 'console_scripts': 'gibberish = gibberish:console_main', + } ) diff --git a/test_it.py b/test_it.py new file mode 100644 index 0000000..7465447 --- /dev/null +++ b/test_it.py @@ -0,0 +1,17 @@ +import gibberish + + +def test_generate_word(): + word = gibberish.generate_word() + assert len(word) + assert word.isalpha() + + +def test_generate_words(): + word_list = gibberish.generate_word() + + assert len(word_list) + + for word in word_list: + assert len(word) + assert word.isalpha() diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..2474577 --- /dev/null +++ b/tox.ini @@ -0,0 +1,7 @@ +[tox] +envlist = py{27,35} + +[testenv] +install_command = pip install --no-deps {opts} {packages} +deps = -rrequirements.txt +commands = py.test {posargs}