Skip to content

Commit

Permalink
Merge pull request #4 from IBMStreams/develop
Browse files Browse the repository at this point in the history
0.1
  • Loading branch information
markheger committed Mar 6, 2020
2 parents 392c06f + 5262158 commit 414ab80
Show file tree
Hide file tree
Showing 19 changed files with 1,500 additions and 27 deletions.
30 changes: 5 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
Expand All @@ -40,14 +38,12 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

Expand All @@ -59,7 +55,6 @@ coverage.xml
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
Expand All @@ -77,26 +72,11 @@ target/
# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
# celery beat schedule file
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py
Expand All @@ -122,8 +102,8 @@ venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
/package/*.sab
/package/*.json
/package/job*.tar.gz
/**/toolkit.xml
83 changes: 81 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,81 @@
# pypi.streamsx.sttgateway
[INCUBATION] This is a step in allowing natural use of Streams for a Python developer. A project that will be registered with PyPi to allow 'pip install' of Python packages that support Python developers interacting with IBM Streams.
# Python streamsx.sttgateway package

This exposes SPL operators in the `com.ibm.streamsx.sttgateway` toolkit as Python methods.

Package is organized using standard packaging to upload to PyPi.

The package is uploaded to PyPi in the standard way:
```
cd package
python setup.py sdist bdist_wheel upload -r pypi
```
Note: This is done using the `ibmstreams` account at pypi.org and requires `.pypirc` file containing the credentials in your home directory.

Package details: https://pypi.python.org/pypi/streamsx.sttgateway

Documentation is using Sphinx and can be built locally using:
```
cd package/docs
make html
```

or

ant doc

and viewed using
```
firefox package/docs/build/html/index.html
```

The documentation is also setup at `readthedocs.io`.

Documentation links:
* http://streamsxsttgateway.readthedocs.io

## Version update

To change the version information of the Python package, edit following files:

- ./package/docs/source/conf.py
- ./package/streamsx/sttgateway/\_\_init\_\_.py

When the development status changes, edit the *classifiers* in

- ./package/setup.py

When the documented sample must be changed, change it here:

- ./package/streamsx/sttgateway/\_\_init\_\_.py
- ./package/DESC.txt

## Environment

You need the streamsx package in version 1.14.7 to use and test the streamsx.sttgateway package. Install it like this:

pip install streamsx==1.14.7

In addition you should unset the PYTHONPATH variable to not use the streams package included in your local Streams installation:

unset PYTHONPATH

## Test

When using local build (e.g. not forcing remote build), then you need to specifiy the toolkit location, for example:

export STREAMS_STTGATEWAY_TOOLKIT=<PATH_TO_STTGATEWAY_TOOLKIT>/com.ibm.streamsx.sttgateway


### Test

Run the (build-only) test with:

ant test


```
cd package
python3 -u -m unittest streamsx.sttgateway.tests.test_sttgateway.Test
```


53 changes: 53 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<project name="PypackageTests" default="test" basedir="." xmlns:if="ant:if">

<property name="package" location="package"/>

<target name="clean">
<delete>
<fileset dir="${basedir}" includes="**/*.pyc,**/streamsx*.sab,**/streamsx*.json"/>
</delete>
<delete includeemptydirs="true">
<fileset dir="${basedir}" includes="**/__pycache__/**"/>
</delete>
<delete includeemptydirs="true">
<fileset dir="${basedir}" includes="**/tk*/**"/>
</delete>
<delete includeemptydirs="true">
<fileset dir="${package}" includes="**/build/**,dist/**,streamsx.*.egg-info/**"/>
</delete>
<delete>
<fileset dir="${package}" includes="job*.tar.gz"/>
</delete>
<delete>
<fileset dir="${package}" includes="**/toolkit.xml"/>
</delete>
</target>

<target name="doc">
<echo message="Generate html doc"/>
<exec executable="make" failonerror="true" dir="${package}/docs">
<arg value="-f" />
<arg value="Makefile" />
<arg value="html" />
</exec>
</target>

<target name="test" depends="clean">
<exec executable="/bin/sh"
outputproperty="toolkit.test.output" errorproperty="toolkit.test.error" resultproperty="toolkit.test.result"
dir="${package}">
<arg value="-c"/>
<arg value="python3 -u -m unittest streamsx.sttgateway.tests.test_sttgateway.Test"/>
</exec>
<echo message="${toolkit.test.output}" if:set="toolkit.test.output"/>
<echo message="${toolkit.test.error}" if:set="toolkit.test.error"/>
<fail message="The test failed - result ${toolkit.test.result}.">
<condition>
<not>
<equals arg1="${toolkit.test.result}" arg2="0"/>
</not>
</condition>
</fail>
</target>

</project>
16 changes: 16 additions & 0 deletions package/DESC.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Overview
========

Provides functions and classes for use with Streaming Analytics service on
IBM Cloud and IBM Streams including IBM Cloud Pak for Data.

Transcribes audio into text via the IBM Watson STT (Speech To Text) service running on the IBM Cloud or on the IBM Cloud Pak for Data.

* `Streaming Analytics service <https://console.ng.bluemix.net/catalog/services/streaming-analytics>`_
* `IBM Streams developer community <https://developer.ibm.com/streamsdev/>`_
* `Watson Speech to Text <https://www.ibm.com/cloud/watson-speech-to-text>`_

Documentation
=============

* `streamsx.sttgateway package documentation <http://streamsxsttgateway.readthedocs.io>`_

0 comments on commit 414ab80

Please sign in to comment.