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 coveralls
script: coverage run --source=pylast ./test_pylast.py
script: coverage run --source=pylast ./tests/test_pylast.py
after_success:
- coveralls
@ -24,7 +24,7 @@ after_script:
- coverage report
- ./check.sh
- pip install clonedigger
- clonedigger pylast.py
- clonedigger pylast
- grep "Clones detected" output.html
- grep "lines are duplicates" output.html

View file

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

View file

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

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}