Skip to content

Commit

Permalink
Bring the latests improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ogolovatyi authored and ogolovatyi committed Jan 11, 2019
1 parent af0f3dc commit 970aefb
Show file tree
Hide file tree
Showing 66 changed files with 6,662 additions and 1,513 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tabpy-server/tabpy_server/_version.py export-subst
135 changes: 28 additions & 107 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,107 +1,28 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# OS generated
.DS_Store
# NodeJS files and folders
node_modules/
package.json
package-lock.json

# Compiled python modules
*.pyc

# Setuptools distribution folder
*/dist/
*/build/

# Python egg metadata, regenerated from source files by setuptools.
*/*.egg-info

# PyCharm
.idea/

# TabPy server artifacts
tabpy-server/tabpy_server/common/default.conf
tabpy-server/install.log
tabpy-server/tabpy_server/query_objects
tabpy-server/tabpy_server/staging
tabpy-server/tabpy_server/state.ini

# etc
setup.bat
*~
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# TabPy Changelog

This file list notable changes for TabPy project releases.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## v0.2

- Initial version
101 changes: 87 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,106 @@
# Contributing Guide
# TabPy Contributing Guide

<!-- toc -->

- [Environment Setup](#environment-setup)
- [Prerequisites](#prerequisites)
- [Windows Specific Steps](#windows-specific-steps)
- [Mac Specific Steps](#mac-specific-steps)
- [Documentation Updates](#documentation-updates)
- [Versioning](#versioning)
- [TabPy with Swagger](#tabpy-with-swagger)

<!-- tocstop -->

## Environment Setup

TabPy suggests using [Pipenv](https://docs.pipenv.org) to configure and manage your development environment and provides facilities to enable this out of the box. To start, clone the source code and from the project root run:
The purpose of this guide is to enable developers of Tabpy to install the project
and run it locally.

```sh
pipenv install --dev
```
## Prerequisites

This will create a dedicated virtual environment containing all of the required packages.
These are prerequisites for an environment required for a contributor to
be able to work on TabPy changes:

## Starting the Server
- Python 3.x
- To see which version of Python you have installed, run ```python --version```.
- git
- TabPy repo:
- Get the latest TabPy repository with `git clone https://github.com/tableau/TabPy.git`
- Create a new branch for your changes.
- When changes are ready push them on github and create merge request.

From the project root, activate the virtual environment you created above via:
## Windows Specific Steps

1. Open a windows command prompt.
2. In the command prompt, navigate to the folder in which you would like to save
your local TabPy repository.
3. In the command prompt, enter the following commands:

```sh
git clone https://github.com/tableau/TabPy.git
cd TabPy
set TABPY_ROOT=%cd%
set PYTHONPATH=%PYTHONPATH%;%TABPY_ROOT%\tabpy-server;%TABPY_ROOT%\tabpy-server\tabpy_server;%TABPY_ROOT%\tabpy-tools;%TABPY_ROOT%\tabpy-tools\tabpy_tools;%TABPY_ROOT%\tabpy-server\tabpy_server\psws
```

To start a local TabPy instance:

```sh
pipenv shell
cd %TABPY_ROOT%
startup.cmd
```

Thereafter, simply navigate to tabpy-server/tabpy-server and run:
To run the unit test suite:

```sh
python tabpy.py
cd %TABPY_ROOT%
python tests\runtests.py
```

## Testing Your Changes
## Linux and Mac Specific Steps

If you have downloaded Tabpy and would like to manually install Tabpy Server
not using pip then follow the steps below [to run TabPy in Python virtual environment](docs/tabpy-virtualenv.md).


After making any changes to either the client or the server you can run the regression test suite from the top level directory as follows:
## Documentation Updates

For any process, scripts or API changes documentation needs to be updated accordingly.
Please use markdown validation tools like web-based[markdownlint](https://dlaa.me/markdownlint/)
or npm [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli).

TOC for markdown file is built with [markdonw-toc](https://www.npmjs.com/package/markdown-toc).

## Versioning

TabPy is versioned with [Versioneer tool](https://github.com/warner/python-versioneer) and uses the github release
tag as a version. In case you need to update version for TabPy use `git tag` command. Example below
shows how to update TabPy version to `v3.14-gamma`:

```sh
python runtests.py
git tag v3.14-gamma
git push
git push --tag
```

## TabPy with Swagger

You can invoke TabPy Server API against running TabPy instance with Swagger:

- Make CORS related changes in TabPy configuration file: update `tabpy-server\state.ini`
file in your local repository to have the next settings:

```config
[Service Info]
Access-Control-Allow-Origin = *
Access-Control-Allow-Headers = Origin, X-Requested-with, Content-Type
Access-Control-Allow-Methods = GET, OPTIONS, POST
```

- Start local instance of TabPy server following [TabPy Server Startup Guide](docs/server-startup.md).
- Run local copy of Swagger editor with steps provided at
[https://github.com/swagger-api/swagger-editor](https://github.com/swagger-api/swagger-editor).
- Open `misc/TabPy.yml` in Swagger editor.
- In case your TabPy server runs not on `localhost:9004` update
`host` value in `TabPy.yml` accordingly.
21 changes: 0 additions & 21 deletions Pipfile

This file was deleted.

Loading

0 comments on commit 970aefb

Please sign in to comment.