proper setup.py setup & test
This commit is contained in:
parent
2bc118bfd9
commit
b1f597deae
10 changed files with 54 additions and 3 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,2 +1,5 @@
|
||||||
*.pyc
|
*.pyc
|
||||||
.*.sw?
|
.*.sw?
|
||||||
|
/dist/
|
||||||
|
/*.egg-info
|
||||||
|
build
|
||||||
|
|
0
larigira/__init__.py
Normal file
0
larigira/__init__.py
Normal file
|
@ -80,7 +80,7 @@ def on_player_crash(*args, **kwargs):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
def main():
|
||||||
p = Player()
|
p = Player()
|
||||||
p.start()
|
p.start()
|
||||||
p.link_exception(on_player_crash)
|
p.link_exception(on_player_crash)
|
||||||
|
@ -90,3 +90,6 @@ if __name__ == '__main__':
|
||||||
p.q.put('signal', *args)
|
p.q.put('signal', *args)
|
||||||
gevent.signal(signal.SIGHUP, sig, signal.SIGHUP)
|
gevent.signal(signal.SIGHUP, sig, signal.SIGHUP)
|
||||||
gevent.wait()
|
gevent.wait()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
|
@ -6,7 +6,7 @@ import pytest
|
||||||
|
|
||||||
import gevent
|
import gevent
|
||||||
|
|
||||||
from mpc import Timer, ParentedLet
|
from larigira.mpc import Timer, ParentedLet
|
||||||
|
|
||||||
# TODO: implement simple children and check that we will receive the expected
|
# TODO: implement simple children and check that we will receive the expected
|
||||||
# messages on the queue
|
# messages on the queue
|
|
@ -4,7 +4,7 @@ monkey.patch_all(subprocess=True)
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from rpc import create_app
|
from larigira.rpc import create_app
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
45
setup.py
Normal file
45
setup.py
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from setuptools import setup
|
||||||
|
from setuptools.command.test import test as TestCommand
|
||||||
|
|
||||||
|
|
||||||
|
class PyTest(TestCommand):
|
||||||
|
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
|
||||||
|
|
||||||
|
def initialize_options(self):
|
||||||
|
TestCommand.initialize_options(self)
|
||||||
|
self.pytest_args = []
|
||||||
|
|
||||||
|
def finalize_options(self):
|
||||||
|
TestCommand.finalize_options(self)
|
||||||
|
self.test_args = []
|
||||||
|
self.test_suite = True
|
||||||
|
|
||||||
|
def run_tests(self):
|
||||||
|
# import here, cause outside the eggs aren't loaded
|
||||||
|
import pytest
|
||||||
|
errno = pytest.main(self.pytest_args)
|
||||||
|
sys.exit(errno)
|
||||||
|
|
||||||
|
setup(name='larigira',
|
||||||
|
version='0.1',
|
||||||
|
description='A radio automation based on MPD',
|
||||||
|
author='boyska',
|
||||||
|
author_email='piuttosto@logorroici.org',
|
||||||
|
license='AGPL',
|
||||||
|
packages=['larigira'],
|
||||||
|
install_requires=[
|
||||||
|
'gevent',
|
||||||
|
'flask',
|
||||||
|
'python-mpd2',
|
||||||
|
'redis',
|
||||||
|
'celery'
|
||||||
|
],
|
||||||
|
tests_require=['pytest'],
|
||||||
|
cmdclass={'test': PyTest},
|
||||||
|
zip_safe=False,
|
||||||
|
entry_points={
|
||||||
|
'console_scripts': ['larigira=larigira.mpc:main']
|
||||||
|
}
|
||||||
|
)
|
Loading…
Reference in a new issue