From 590252b5b189bf35033b45eb9807715374ef7357 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Fri, 19 Jun 2015 11:20:02 +0200 Subject: [PATCH] Initial skeleton. --- .travis.yml | 25 +++++++++++++++++++++++++ AUTHORS | 5 +++++ CONTRIBUTING.rst | 28 ++++++++++++++++++++++++++++ LICENSE | 28 ++++++++++++++++++++++++++++ MANIFEST.in | 11 +++++++++++ README.rst | 26 ++++++++++++++++++++++++++ requirements.txt | 3 +++ setup.py | 27 +++++++++++++++++++++++++++ utils/bump-version.sh | 20 ++++++++++++++++++++ utils/publish.sh | 6 ++++++ vxyowsup/__init__.py | 5 +++++ 11 files changed, 184 insertions(+) create mode 100644 .travis.yml create mode 100644 AUTHORS create mode 100644 CONTRIBUTING.rst create mode 100644 LICENSE create mode 100644 MANIFEST.in create mode 100644 README.rst create mode 100644 requirements.txt create mode 100644 setup.py create mode 100755 utils/bump-version.sh create mode 100755 utils/publish.sh create mode 100644 vxyowsup/__init__.py diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..44073b7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +language: python +python: + - "2.6" + - "2.7" +env: + # Test against the latest version of Twisted. + - TWISTED_VERSION="Twisted" +matrix: + include: + # Test against the oldest version of Twisted that we claim to support + # This is a separate matrix inclusion to avoid spawning unnecessary builds. + - python: "2.7" + env: TWISTED_VERSION="Twisted==13.1.0" + # Test on pypy without coverage, because it's unnecessary and very slow. + - python: "pypy" + env: TWISTED_VERSION="Twisted" NO_COVERAGE="1" +install: + - "pip install ${TWISTED_VERSION}" + - "pip install -r requirements.txt --use-wheel" + - "pip install coveralls --use-wheel" +script: + - if [ -z "$NO_COVERAGE" ]; then COVERAGE_CMD="coverage run --source=vxyowsup"; else COVERAGE_CMD=""; fi + - VUMITEST_REDIS_DB=1 $COVERAGE_CMD `which trial` vxyowsup +after_success: + - if [ -z "$NO_COVERAGE" ]; then coveralls; fi diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..f49c4c3 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,5 @@ +Jeremy Thurgood +Justin van der Merwe +Rudi Giesler +Simon Cross +Simon de Haan diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst new file mode 100644 index 0000000..e6fb1fe --- /dev/null +++ b/CONTRIBUTING.rst @@ -0,0 +1,28 @@ +How to contribute to Vumi Yowsup +================================ + +Vumi Yowsup is an Open Source software project under the BSD license. +We love contributions! + +Here's a quick guide on how to contribute to the project: + +1. Fork the repository +2. Run the tests, we'll only accept pull requests with passing tests. + Ensure that the tests run with ``trial vxyowsup`` and that you're starting + with a clean slate. +3. Make your changes to your forked repository and ensure that tests are + added where necessary. +4. Make the tests pass. +5. Push to your fork and submit a pull request! + (For bonus points use hub_ if you're turning an + existing issue into a pull request) + +At this point you're waiting on us. We like to comment on pull-requests +and where needed possibly request some changes, improvements or alternatives. + +Please ensure that your code is PEP8_ compliant and you use 4 spaces +for indentation, tabs are right out. + + +.. _PEP8: http://www.python.org/dev/peps/pep-0008/ +.. _hub: http://defunkt.io/hub/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8b91337 --- /dev/null +++ b/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) Praekelt Foundation and individual contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Praekelt Foundation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..79a8890 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,11 @@ +# Source distribution files. +include .coveragerc +include AUTHORS +include CONTRIBUTING.rst +include LICENSE +include README.rst +include requirements.txt +include setup.py + +# Prune stray bytecode files. +global-exclude *.pyc diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..6406992 --- /dev/null +++ b/README.rst @@ -0,0 +1,26 @@ +Vumi Yowsup +=========== + +A WhatsApp transport for `Vumi`_ built on `Yowsup`_. + +.. _Vumi: http://github.com/praekelt/vumi +.. _Yowsup: https://github.com/tgalal/yowsup + +|vxyowsup-ci|_ |vxyowsup-cover|_ + +.. |vxyowsup-ci| image:: https://travis-ci.org/praekelt/vumi-yowsub.png?branch=develop +.. _vxyowsup-ci: https://travis-ci.org/praekelt/vumi-yowsub + +.. |vxyowsub-cover| image:: https://coveralls.io/repos/praekelt/vumi-yowsub/badge.png?branch=develop +.. _vxyowsub-cover: https://coveralls.io/r/praekelt/vumi-yowsub + +You can contact the Vumi development team in the following ways: + +* via *email* by joining the the `vumi-dev@googlegroups.com`_ mailing list +* on *irc* in *#vumi* on the `Freenode IRC network`_ + +.. _vumi-dev@googlegroups.com: https://groups.google.com/forum/?fromgroups#!forum/vumi-dev +.. _Freenode IRC network: https://webchat.freenode.net/?channels=#vumi + +Issues can be filed in the GitHub issue tracker. Please don't use the issue +tracker for general support queries. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5371e72 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +# Our dependencies are all specified in setup.py. + +-e . diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..a7cf7ff --- /dev/null +++ b/setup.py @@ -0,0 +1,27 @@ +from setuptools import setup, find_packages + +setup( + name="vxyowsup", + version="0.0.1a", + url='http://github.com/praekelt/vumi-yowsup', + license='BSD', + description="A WhatsApp transport for Vumi.", + long_description=open('README.rst', 'r').read(), + author='Praekelt Foundation', + author_email='dev@praekeltfoundation.org', + packages=find_packages(), + include_package_data=True, + install_requires=[ + 'vumi', + 'Twisted>=13.1.0', + ], + classifiers=[ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: BSD License', + 'Operating System :: POSIX', + 'Programming Language :: Python', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: System :: Networking', + ], +) diff --git a/utils/bump-version.sh b/utils/bump-version.sh new file mode 100755 index 0000000..09240e0 --- /dev/null +++ b/utils/bump-version.sh @@ -0,0 +1,20 @@ +#!/bin/bash +VER="$1" + +if [[ "x${VER}" = "x" ]] +then + echo "Usage: $0 " + echo " e.g. $0 0.1.0" + exit 1 +fi + +function inplace_sed { + # Note: we don't use sed -i -e ... because it isn't supported by FreeBSD + # sed on OS X. + suffix=".inplace.bak" + sed -i"$suffix" -e "$1" "$2" + rm "$2$suffix" +} + +inplace_sed "s/\(version[ ]*=[ ]*[\"']\)\(.*\)\([\"'].*\)/\1${VER}\3/" setup.py +inplace_sed "s/^\(__version__[ ]*=[ ]*[\"']\)\(.*\)\([\"'].*\)/\1${VER}\3/" vxyowsup/__init__.py diff --git a/utils/publish.sh b/utils/publish.sh new file mode 100755 index 0000000..af00b6c --- /dev/null +++ b/utils/publish.sh @@ -0,0 +1,6 @@ +#!/bin/sh -e + +rm dist/* || true +python setup.py sdist bdist_wheel +python setup.py register +twine-upload dist/* diff --git a/vxyowsup/__init__.py b/vxyowsup/__init__.py new file mode 100644 index 0000000..8115aea --- /dev/null +++ b/vxyowsup/__init__.py @@ -0,0 +1,5 @@ +"""Vumi WhatsApp transport build using Yowsup.""" + +__version__ = "0.0.1a" + +__all__ = []