1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-08-24 09:03:34 +00:00

SETUP move code to src

This way we can ensure that the packaged code is tested.
See https://hynek.me/articles/testing-packaging/ or c62a78c015

+ DOC adapt doc to new structure and test doc with travis
This commit is contained in:
Patrick Kanzler
2016-06-20 16:41:46 +02:00
parent e8e91eba80
commit 87438f9efa
13 changed files with 32 additions and 7 deletions

View File

@@ -2,10 +2,18 @@
import os
import sys
from setuptools import setup
from setuptools import find_packages, setup
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):
"""read file from same path as setup.py"""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
@@ -58,9 +66,8 @@ setup(
'receipt,',
],
platforms='any',
packages=[
'escpos',
],
package_dir={"": "src"},
packages=find_packages(where="src", exclude=["tests", "tests.*"]),
package_data={'': ['COPYING']},
classifiers=[
'Development Status :: 4 - Beta',