Make pylast a package. Move tests into a directory. Start using pytest

and tox. Use setuptools instead of distutils.
This commit is contained in:
Ivan Malison 2015-01-05 15:52:02 -08:00
parent 123951517a
commit 387220c1d6
8 changed files with 23 additions and 9 deletions

1
.build Normal file
View file

@ -0,0 +1 @@
0

View file

@ -13,7 +13,7 @@ install:
- travis_retry pip install -r test_requirements.txt - travis_retry pip install -r test_requirements.txt
- travis_retry pip install coveralls - travis_retry pip install coveralls
script: coverage run --source=pylast ./test_pylast.py script: coverage run --source=pylast ./tests/test_pylast.py
after_success: after_success:
- coveralls - coveralls
@ -24,7 +24,7 @@ after_script:
- coverage report - coverage report
- ./check.sh - ./check.sh
- pip install clonedigger - pip install clonedigger
- clonedigger pylast.py - clonedigger pylast
- grep "Clones detected" output.html - grep "Clones detected" output.html
- grep "lines are duplicates" output.html - grep "lines are duplicates" output.html

View file

@ -1,10 +1,10 @@
pyflakes pylast.py pyflakes pylast
echo --- echo ---
pyflakes test_pylast.py pyflakes tests
echo --- echo ---
pep8 test_pylast.py pep8 pylast
echo --- echo ---
pep8 pylast.py pep8 tests
# echo --- # echo ---
# clonedigger pylast.py # clonedigger pylast.py
# grep "Clones detected" output.html # grep "Clones detected" output.html

View file

@ -1,12 +1,14 @@
#!/usr/bin/env python #!/usr/bin/env python
import os
from distutils.core import setup from setuptools import setup, find_packages
setup( setup(
name="pylast", name="pylast",
version="1.0.0", version="1.0.0",
author="Amr Hassan <amr.hassan@gmail.com>", author="Amr Hassan <amr.hassan@gmail.com>",
tests_require=['mock', 'pytest', 'coverage', 'pep8', 'pyyaml', 'pyflakes'],
description=("A Python interface to Last.fm " description=("A Python interface to Last.fm "
"(and other API compatible social networks)"), "(and other API compatible social networks)"),
author_email="amr.hassan@gmail.com", author_email="amr.hassan@gmail.com",
@ -24,8 +26,8 @@ setup(
"Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.4",
], ],
keywords=["Last.fm", "music", "scrobble", "scrobbling"], keywords=["Last.fm", "music", "scrobble", "scrobbling"],
py_modules=("pylast",), packages=find_packages(exclude=('tests*')),
license="Apache2" license="Apache2"
) )
# End of file # End of file

0
tests/__init__.py Normal file
View file

11
tox.ini Normal file
View file

@ -0,0 +1,11 @@
[tox]
envlist = py34, py27
recreate = False
[testenv]
downloadcache = {homedir}/.pipcache
changedir = tests
deps =
pytest
mock
commands = py.test {posargs}