Skip to content

Conversation

@nickdavidhaynes
Copy link

@nickdavidhaynes nickdavidhaynes commented May 26, 2017

Background context for this PR

This SDK is need of a bit of love - a few API features have been released recently that haven't been added in, and it was due for a refactor anyway. The refactor will focus on copying the Ruby SDK functionality and design (with changes to maintain pythonic-ness where necessary), plus adding new API functionality like testing outputs and spell checking.

This PR brings the repo into PEP8 compliance and refactors the tests to match more closely to the Ruby SDK.

Quick note: the # of lines changed looks higher than it really is - the previous version used 2 spaces as indent, this version uses 4 in accordance with PEP8

What does this PR do?

  • PEP8 compliance
  • Test refactor
  • Add PR template

Impacted areas in application

  • wordsmith/
  • tests/

How should PR reviewers test this?

  • Getting started:
    • Install Python 3.6
    • Upgrade pip
    • Install the unit test framework with pip install pytest and the linter with pip install flake8
    • From the project root directory, install the dependencies with pip install pip install -r requirements.txt
  • Unit tests: from project root directory, python -m pytest
  • Linting: from project root directory, flake8 .

:param base_url: (optional) String representing the base URL for the Wordsmith API per documentation at http://wordsmith.readme.io/v1/docs
:param user_agent: (optional) String representing the user agent that should be sent with each API request
DEFAULT_VERSION = '1'
DEFAULT_URL = 'https://api.automatedinsights.com/v' + DEFAULT_VERSION

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think users should be allowed to change the default url; just the version. We don't really want people using this on incompatible sites and I don't think we want to support this for staging/qa/locally either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants