Skip to content

Development_Contribution

Chris Caron edited this page Feb 18, 2019 · 20 revisions

Thanks to all who have landed on this page with the intent of contributing to the apprise library. Any changes you make are going to easily make it upstream as long as there is there are:

  • Unit tests: apprise is currently sitting at 100% test coverage. The goal is to keep it this way! 🙂
  • PEP8 Compliance: Following the PEP 8 Style Guide for Python is a must. Most editors have PEP8 plugins and allow you to keep everything compliant as you go.
  • Python 2.7 backwards support. I'd like to support Python 2.7 for as long as i can only because there is a huge amount of servers still using this today. When you push your code upstream, a code-runner will test all this for you if you're uncertain.

The following should get you all set up:

# Install our apprise development requirements
pip install --requirement requirements.txt --requirement dev-requirements.txt

I also have this small (very simple) script that I run each time before I push my changes. It may or may not be useful to others:

#!/bin/sh
# Description: This is a checkdone.sh script used to check against the
#              apprise project that I reference before I commit any code
#              upstream.
#
#              Note: this script was intended to be ran from within the
#                    apprise root directory (after being checked out from
#                    github).

# Cleanup
cleanup() {
   rm -rf .tox/ .eggs .coverage .cache \
      apprise.egg-info htmlcov build &>/dev/null
}

# In case it wasn't ran before (or we ctrl-c'ed last time); we
# want to just clean up any lingering content from the last time
# we may or may have not done a checkdone.sh
cleanup

# Check for pep8
flake8 . --count --show-source --statistics
if [ $? -ne 0 ]; then
   echo "pep8 failed; early exit."
   exit 1
fi

# Handle our coverage
coverage run ./setup.py test
if [ $? -ne 0 ]; then
   echo "tests failed; early exit."
   exit 1
fi

# Print it to screen
coverage report --show-missing

# Cleanup
cleanup
Clone this wiki locally