Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplified Installation Instructions with Pipenv #110

Merged
merged 7 commits into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# 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
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Contributing Guide

## 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:

```sh
pipenv install --dev
```

This will create a dedicated virtual environment containing all of the required packages.

## Starting the Server

From the project root, activate the virtual environment you created above via:

```sh
pipenv shell
```

Thereafter, simply navigate to tabpy-server/tabpy-server and run:

```sh
python tabpy.py
```
21 changes: 21 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
future = "*"
futures = "==3.1.1"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Typically wouldn't pin this requirement, but it is a bug in Pipenv:

pypa/pipenv#1586

Not sure what the roadmap to support Py27 is so may not be a long term issue, but worth calling out

Copy link

Choose a reason for hiding this comment

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

Have you considered baselining with pyenv with the pyenv-virtualenv plugin? This would accommodate a simplified install story as well as be a sole route to document running on all supported python versions?

I've got a Dockerfile working that builds a running container that is likely useful to the project. I'd contribute that; I'd just need to tweak some minor modifications and likely switch to an alpine base image instead of the custom internal one I use now. I have this with Supervisor managing the processes. I was considering have it fronted with an Nginx proxy; that could be added to the example container or a single container of it's own to complete that story. For simplicity and 'access' to new users, the former would be more simple I'd imagine. Finally i'm fixing some "problems" with tabby.py startup that I found needed to be simplified that should be generally useful. I'll look further on Tableau's site or in the project for contributing and so on.

How actively is the main branch being maintained? 1 of your merges took a month and that looks only to mainly be pep8 cleanups......

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have not but at the same time I've never used that plug in. My reasoning for choosing pipenv was that it gives you both the virtual environment and package management all in one, and given the talk on it at PyCon this year I think its going to be well engrained in the future of the language. If you think this is better done with pyenv-virtualenv however you could always submit a PR to see what the team prefers :-)

I am not associated with Tableau in any way and therefore am not qualified to speak on the maintenance aspect, but I have gotten feedback on issues and PRs submitted so far

requests = "*"
simplejson = "*"
tornado-json = "*"
tornado = "*"
cloudpickle = "*"
decorator = "*"
python-dateutil = "*"
genson = "*"
jsonschema = "*"
"809dc83" = {path = "./tabpy-client", edtiable = true}
numpy = "*"

[dev-packages]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

One potential weakness here is that Pipenv doesn't support specifying multiple Python versions:

pypa/pipenv#1050

If someone is trying to develop on a non-supported Python version this wouldn't stop them from doing so, but as far as distributions are concerned you'd be guarding against that in the setup.py requirements

196 changes: 196 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,26 @@ Tableau Python Server (TabPy) is part of Tableau's expanding range of extensibil

For all questions not related to the TabPy code (installation, deployment, connections, Python issues, etc.) and requests use [Server & Online Administration Forum](https://community.tableau.com/community/forums/server-administration) on [Tableau Community](https://community.tableau.com).

## Installation

TabPy is distributed as two separate packages, namely as _tabpy-client_ and _tabpy-server_. Both are available from PyPy and any combination of the packages can be installed via:

```sh
pip install tabpy-server
pip install tabpy-client
```

Alternately, to work from the source code you should reference the [Contributing Guide](CONTRIBUTING.md) for instructions on how to configure your environment and install all dependencies.

## About

TabPy framework allows Tableau to remotely execute Python code. It has two components:

1. A [server](server.md) process built on Tornado, which allows for the remote execution of Python code through a set of REST APIs. Code can either be immediately executed or persisted in the server process and exposed as a REST endpoint, to be called later.
2. A [client library](client.md) that enables the deployment of such endpoints, based on Python functions.

Tableau can connect to the TabPy server to execute Python code on the fly and display results in Tableau visualizations. Users can control data and parameters being sent to TabPy by interacting with their Tableau worksheets, dashboard or stories.

You can find detailed **installation instructions** for TabPy server [HERE](server.md).

To run Python code in your Tableau calculated fields, enter the address and port number for a TabPy server instance in Tableau.

<p align="center"><img alt="Screenshot of Configuration on Tableau Desktop" src="external-service-configuration.png"></p>
Expand Down
Loading