soundphy -

What is Soundphy?

Soundphy is a sounds web service and database.

Contents

Developers

Installing dependencies

To install the required dependencies for developing Soundphy, you can make use of the provided requirements_dev.txt file:

pip install -r requirements_dev.txt

Running tests

Running the tests locally is very simple, using Tox from the top level path of the project:

tox

That single command will run all the tests for all the supported Python versions available in your system or environment.

For faster results you may want to run all the tests just against a single Python version. This command will run all tests against Python 3.5 only:

tox -e py35

Note that those tests include style and static analysis checks. If you just want to run all the behavior tests (not recommended):

pytest -n 8

If you just want to run a handful of behavior tests (common when developing new functionality), just run:

pytest -k keyword

Note

Before submitting your changes for review, make sure all tests pass with tox, as the continuous integration system will run all those checks as well.

Generating documentation

Documentation is generated with Sphinx. In order to generate the documentation locally you need to run make from the docs directory:

make html

Deployment

Auto-deployment on Openshift 3

In order to enable auto-deployment for the project, you need to have a OpenShift Online account.

If you don’t have one yet, you can create one on the following link.

OpenShift web console
Once on the OpenShift console, follow the next steps to setup a new project:
  • Choose Python language on the catalog and select Python 3.5 model.
  • Fill name, Git URL fields and proceed with the creation.

After creating the project, you will need to take note of the following info for the deploy: GitHub Webhook URL and GitHub secret.

For the GitHub Webhook URL, go to builds and open the one on the list. Then go to configuration tab, and the GitHub Webhook URL field will be on the right.

The GitHub secret can be found on the build config file. To open it, click over action dropdown placed on the top right corner of the console, and select Edit YAML.

Inside the build config editor, search the fragment that points to the repository and make sure that ref param points to the branch that will be auto deployed.

source:
  type: Git
  git:
    uri: 'https://github.com/Soundphy/soundphy'
    ref: master

Next, search for the spec / triggers fragment where the GitHub secret is placed, and grab the token.

spec:
  triggers:
  - type: Generic
    generic:
      secret: 00000000000
  - type: GitHub
    github:
      secret: 00000000000
GitHub webhook configuration

Now it’s time to setup the webhook that triggers the autodeployment. With the project opened on GitHub, go to webhook screen via settings / webhook / Add webhook. In there:

  • Fill the Payload URL field with the GitHub Webhook URL taken from Openshift console.
  • Choose application/json as content type.
  • Fill the secret field with the GitHub secret token.

Depending on your needs you could adjust more or less the events that triggers the webhook, in this case push event is enough.

Once you create the webhook, it will be deployed by the first time automatically, so be sure that was successfully delivered before closing the tab.

Software License and Disclaimer

Copyright (c) The Soundphy 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 Soundphy 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 OWNER 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.

Indices and tables