Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Latest commit

 

History

History
134 lines (92 loc) · 4.18 KB

CONTRIBUTING.rst

File metadata and controls

134 lines (92 loc) · 4.18 KB

How to contribute to SQLBucket

(this is pretty much a copy of the Flask contribution documentation).

Thank you for considering contributing to SQLBucket! This is a very young library, easy to understand, where lots can be added.

Support questions

For questions about your own code ask on Stack Overflow. Search with Google first using: site:stackoverflow.com sqlbucket {search term, exception message, etc.}

Reporting issues

Use the issue tracker for this:

  • Describe what you expected to happen.
  • If possible, include a minimal, complete, and verifiable example to help us identify the issue. This also helps check that the issue is not with your own code.
  • Describe what actually happened. Include the full traceback if there was an exception.
  • List your Python and SQLBucket version.

Submitting patches

  • Include tests if your patch is supposed to solve a bug, and explain clearly under which circumstances the bug happens. Make sure the test fails without your patch.
  • Try to follow PEP8.
  • Use the utils at your disposition in test folders to mock api requests.
  • Every mock request should be put in the fixture folder.
  • Tests are run with pytest.

First time setup

  • Download and install the latest version of git.

  • Configure git with your username and email:

    git config --global user.name 'your name'
    git config --global user.email 'your email'
    
  • Make sure you have a GitHub account.

  • Fork SQLBucket to your GitHub account by clicking the Fork button.

  • Clone your GitHub fork locally:

    git clone https://github.com/{username}/sqlbucket
    cd sqlbucket
    
  • Add the main repository as a remote to update later:

    git remote add socialpoint-labs https://github.com/socialpoint-labs/sqlbucket
    git fetch socialpoint-labs
    
  • Create a virtualenv:

    python3 -m venv env
    . env/bin/activate
    # or "env\Scripts\activate" on Windows
    
  • Install SQLBucket in editable mode with development dependencies:

    pip install -e ".[dev]"
    

Start coding

  • Create a branch to identify the issue you would like to work on (e.g. 2287-dry-test-suite)
  • Using your favorite editor, make your changes, committing as you go.
  • Try to follow PEP8.
  • Include tests that cover any code changes you make. Make sure the test fails without your patch.
  • Push your commits to GitHub and create a pull request.
  • Celebrate 🎉

Running the tests

Run the basic test suite with:

pytest

This only runs the tests for the current environment. Travis-CI will run the full suite when you submit your pull request.

Running test coverage

Generating a report of lines that do not have test coverage can indicate where to start contributing. Run pytest using coverage and generate a report on the terminal and as an interactive HTML document:

coverage run -m pytest
coverage report
coverage html
# then open htmlcov/index.html

Read more about coverage.

make targets

SQLBucket provides a Makefile with various shortcuts. They will ensure that all dependencies are installed.

  • make test runs the basic test suite with pytest
  • make cov runs the basic test suite with coverage