Merge pull request #138 from python-escpos/setup/check-in-travis
Check setup in Travis and make sure that the package is tested
This commit is contained in:
commit
0907b6aa8b
|
@ -1,6 +1,10 @@
|
||||||
language: python
|
language: python
|
||||||
sudo: false
|
sudo: false
|
||||||
cache: pip
|
cache: pip
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- graphviz
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- python: 2.7
|
- python: 2.7
|
||||||
|
@ -19,6 +23,8 @@ matrix:
|
||||||
env: TOXENV=pypy
|
env: TOXENV=pypy
|
||||||
- python: pypy3
|
- python: pypy3
|
||||||
env: TOXENV=pypy3
|
env: TOXENV=pypy3
|
||||||
|
- python: 2.7
|
||||||
|
env: TOXENV=docs
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- python: 3.5-dev
|
- python: 3.5-dev
|
||||||
- python: nightly
|
- python: nightly
|
||||||
|
|
|
@ -20,7 +20,7 @@ from setuptools_scm import get_version
|
||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
# If extensions (or modules to document with autodoc) are in another directory,
|
||||||
# add these directories to sys.path here. If the directory is relative to the
|
# add these directories to sys.path here. If the directory is relative to the
|
||||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||||
sys.path.insert(0, os.path.abspath('..'))
|
sys.path.insert(0, os.path.abspath('../src'))
|
||||||
root = os.path.relpath(os.path.join(os.path.dirname(__file__), '..'))
|
root = os.path.relpath(os.path.join(os.path.dirname(__file__), '..'))
|
||||||
|
|
||||||
# -- General configuration ------------------------------------------------
|
# -- General configuration ------------------------------------------------
|
||||||
|
@ -42,6 +42,11 @@ extensions = [
|
||||||
'sphinx.ext.inheritance_diagram',
|
'sphinx.ext.inheritance_diagram',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# supress warnings for external images
|
||||||
|
suppress_warnings = [
|
||||||
|
'image.nonlocal_uri',
|
||||||
|
]
|
||||||
|
|
||||||
# enable todos
|
# enable todos
|
||||||
todo_include_todos = True
|
todo_include_todos = True
|
||||||
|
|
||||||
|
|
17
setup.py
17
setup.py
|
@ -2,10 +2,18 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from setuptools import setup
|
from setuptools import find_packages, setup
|
||||||
from setuptools.command.test import test as test_command
|
from setuptools.command.test import test as test_command
|
||||||
|
|
||||||
|
|
||||||
|
base_dir = os.path.dirname(__file__)
|
||||||
|
src_dir = os.path.join(base_dir, "src")
|
||||||
|
|
||||||
|
# When executing the setup.py, we need to be able to import ourselves, this
|
||||||
|
# means that we need to add the src/ directory to the sys.path.
|
||||||
|
sys.path.insert(0, src_dir)
|
||||||
|
|
||||||
|
|
||||||
def read(fname):
|
def read(fname):
|
||||||
"""read file from same path as setup.py"""
|
"""read file from same path as setup.py"""
|
||||||
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
||||||
|
@ -58,9 +66,8 @@ setup(
|
||||||
'receipt,',
|
'receipt,',
|
||||||
],
|
],
|
||||||
platforms='any',
|
platforms='any',
|
||||||
packages=[
|
package_dir={"": "src"},
|
||||||
'escpos',
|
packages=find_packages(where="src", exclude=["tests", "tests.*"]),
|
||||||
],
|
|
||||||
package_data={'': ['COPYING']},
|
package_data={'': ['COPYING']},
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Development Status :: 4 - Beta',
|
'Development Status :: 4 - Beta',
|
||||||
|
@ -84,7 +91,7 @@ setup(
|
||||||
'Topic :: Office/Business :: Financial :: Point-Of-Sale',
|
'Topic :: Office/Business :: Financial :: Point-Of-Sale',
|
||||||
],
|
],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'pyusb',
|
'pyusb>=1.0.0',
|
||||||
'Pillow>=2.0',
|
'Pillow>=2.0',
|
||||||
'qrcode>=4.0',
|
'qrcode>=4.0',
|
||||||
'pyserial',
|
'pyserial',
|
||||||
|
|
9
tox.ini
9
tox.ini
|
@ -1,8 +1,15 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist = py27, py34, py35
|
envlist = py27, py34, py35, docs
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
deps = nose
|
deps = nose
|
||||||
coverage
|
coverage
|
||||||
scripttest
|
scripttest
|
||||||
commands = nosetests --with-coverage --cover-erase --cover-branches
|
commands = nosetests --with-coverage --cover-erase --cover-branches
|
||||||
|
|
||||||
|
[testenv:docs]
|
||||||
|
basepython = python
|
||||||
|
changedir = doc
|
||||||
|
deps = sphinx
|
||||||
|
setuptools_scm
|
||||||
|
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
|
||||||
|
|
Loading…
Reference in New Issue