Skip to content

Latest commit

 

History

History
146 lines (102 loc) · 3.73 KB

CONTRIBUTING.md

File metadata and controls

146 lines (102 loc) · 3.73 KB

TabPy Contributing Guide

Environment Setup

The purpose of this guide is to enable developers of Tabpy to install the project and run it locally.

Prerequisites

These are prerequisites for an environment required for a contributor to be able to work on TabPy changes:

  • Python 3.7, 3.8 or 3.9:
    • To see which version of Python you have installed, run python --version.
  • git
  • Node.js for npm packages - install from https://nodejs.org.
  • NPM packages - install all with npm install markdown-toc markdownlint command.

Cloning TabPy Repository

  1. Open your OS shell.

  2. Navigate to the folder in which you would like to save your local TabPy repository.

  3. In the command prompt, enter the following commands:

    git clone https://github.com/tableau/TabPy.git
    cd TabPy
  4. Install all dependencies:

    python -m pip install --upgrade pip
    pip install -r requirements.txt
    pip install -r requirements_dev.txt

Tests

To run the whole test suite execute the following command:

pytest

Unit Tests

Unit tests suite can be executed with the following command:

pytest tests/unit

Integration Tests

Integration tests can be executed with the next command:

pytest tests/integration

Code Coverage

You can run unit tests to collect code coverage data. To do so run pytest either for server or tools test, or even combined:

pytest tests --cov=tabpy

TabPy in Python Virtual Environment

It is possible (and recommended) to run TabPy in a virtual environment. More details are on TabPy in Python virtual environment page.

Documentation Updates

For any process, scripts or API changes documentation needs to be updated accordingly. Please use markdown validation tools like web-based markdownlint or npm markdownlint-cli.

TOC for markdown file is built with markdown-toc:

markdown-toc -i docs/server-startup.md

To check markdown style for all the documentation use markdownlint:

markdownlint .

These checks will run as part of the build if you submit a pull request.

TabPy with Swagger

You can invoke the TabPy Server API against a running TabPy instance with Swagger.

  • Make CORS related changes in TabPy configuration file: update tabpy/tabpy-server/state.ini file in your local repository to have the next settings:
[Service Info]
Access-Control-Allow-Origin = *
Access-Control-Allow-Headers = Origin, X-Requested-with, Content-Type
Access-Control-Allow-Methods = GET, OPTIONS, POST

Code styling

flake8 is used to check Python code against our style conventions:

flake8 .