16. Installation via setup.py

Use the following link to get the latest code:

git clone git://git.code.sf.net/p/stingrayreader/code stingrayreader-code

It’s also possible to get an archive distribution kit. These may be slightly out of date.

16.1. Optional Build-from-Scratch

The Stingray distribution kit (minimally) is just the following.

  • source. The RST-formatted source used by PyLit3 to to create code and documentation.
  • sample. Several sample workbooks used for testing.
  • build.py. The build procedure.

Given these two directories, the build procedure uses PyLit3 to create stingray package. It uses Sphinx to create the documentation.

See Stingray Build for more information on the build procedure. This is an optional step to recreate the Python code from the documentation.

The build process required PyLit3 and Sphinx to be installed. Setuptools can be used to simplify installation.

python3 build.py

16.2. Installation via Distutils

To install stingray you can use the following. On Linux, this may require privileges via sudo.

sudo python3 setup.py install

In some cases, you might want to break this down into a build step that doesn’t require privileges and the final install step, which does require privileges.

python3 setup.py build
sudo python3 setup.py install

16.3. The setup.py File

To use Stingray, you must have the following package installed.

This provides Python package information.

from setuptools import setup
import sys

if sys.version_info < (3,3):
    print( "Stringray requires Python 3.3" )
    sys.exit(2)

setup(
    name='stingray',
    version='4.4.8',
    description='Schema-Based File Reader, COBOL, EBCDIC Conversion, ETL, Data Profiling',
    author='S.Lott',
    author_email='s_lott@yahoo.com',
    url='https://sourceforge.net/projects/stingray/',
    packages=[
        'stingray',
        'stingray.schema',
        'stingray.cobol',
        'stingray.workbook',
        ],
    package_data={'stingray': ['*.json']},

We depend on the release of Python itself, based on the sys.version_info named tuple. We have a few Python3.3 features.

We depend XLRD, which comes from PyPi. This is required for normal use and operation.

For a full build from the source document, we depend on having a new release of Sphinx and PyLit3.

The obsoletes is there in case anyone did happen to download the previous release.

install_requires=["xlrd>=0.9","sphinx>1.2"],
obsoletes=["cobol_dde","data_profile"],

Here are some trove classifiers.

classifiers=[
    "Development Status :: 6 - Mature",
    "Environment :: Console",
    "Intended Audience :: Developers",
    "Operating System :: OS Independent",
    "Programming Language :: Python",
    "Programming Language :: COBOL",
    "Topic :: Database",
    "Topic :: Software Development :: Libraries",
    "Topic :: Software Development :: Quality Assurance",
    ],
)