All Projects → rbanffy → testable_appengine

rbanffy / testable_appengine

Licence: Apache-2.0 license
A testable Python skeleton application for Google's App Engine and AppScale environments

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to testable appengine

docker-pudb
Debug Python code within a Docker container remotely from your terminal using pudb
Stars: ✭ 18 (-40%)
Mutual labels:  ipdb, pudb
Mezzanine
A game engine that supports high performance 3d graphics physics and sound
Stars: ✭ 18 (-40%)
Mutual labels:  engine
Engine-Tune-Repository-TunerPro-EFIlive-TunerCat
Repository for Engine Tune information
Stars: ✭ 30 (+0%)
Mutual labels:  engine
gist-slide
slideshow on google app engine
Stars: ✭ 13 (-56.67%)
Mutual labels:  google-appengine
pgae-examples
Ready-to-run examples to accompany the "Programming Google App Engine" books, by Dan Sanderson
Stars: ✭ 17 (-43.33%)
Mutual labels:  google-appengine
zenaton-node
⚡ Node.js library to run and orchestrate background jobs with Zenaton Workflow Engine
Stars: ✭ 50 (+66.67%)
Mutual labels:  engine
rails email
Record rails error logs and Email logs, efficient and clean
Stars: ✭ 23 (-23.33%)
Mutual labels:  engine
Minic
A simple chess engine to learn and play with
Stars: ✭ 65 (+116.67%)
Mutual labels:  engine
Wasabi
Wasabi Vulkan Game Engine
Stars: ✭ 34 (+13.33%)
Mutual labels:  engine
crynn
3D Game Engine Created In C++ & OpenGL
Stars: ✭ 45 (+50%)
Mutual labels:  engine
mapmint
Fast and easy webmapping.
Stars: ✭ 51 (+70%)
Mutual labels:  engine
devilf
A Flutter 2D RPG Game Example On Web & Android & IOS.
Stars: ✭ 66 (+120%)
Mutual labels:  engine
imsearch
Framework to build your own reverse image search engine
Stars: ✭ 64 (+113.33%)
Mutual labels:  engine
iris
Automatically tag Google Cloud resources for better manageability and billing reporting
Stars: ✭ 50 (+66.67%)
Mutual labels:  google-appengine
understanding-the-python-ecosystem
This project focuses on understanding the language ecosystem
Stars: ✭ 68 (+126.67%)
Mutual labels:  virtualenv
integration-test
ensure core packaging tools work well with each other
Stars: ✭ 15 (-50%)
Mutual labels:  virtualenv
DungeonMaster.NET
Reimplementation of famous old Dungeon Master game.
Stars: ✭ 23 (-23.33%)
Mutual labels:  engine
Austen-Works
Jane Austen’s Collected Works
Stars: ✭ 26 (-13.33%)
Mutual labels:  engine
RenderMaster
Graphic engine
Stars: ✭ 35 (+16.67%)
Mutual labels:  engine
UE4-BUIValidator
UE4 UI Texture Validator Plugin
Stars: ✭ 48 (+60%)
Mutual labels:  engine

testable_appengine

A testable Python skeleton application for Google App Engine and AppScale environments.

![Demo] (https://raw.githubusercontent.com/wiki/rbanffy/testable_appengine/screencap.gif)

Why?

Writing properly testable Python applications to run on Google App Engine is not trivial. Keeping the different application environments segregated is also an issue if all environments share the same SDK and Python environment. This template helps you build your application in such way it's contained in a folder, along with its virtualenvironment and separate copy of the SDK. It also preinstall ipdb and pudb debuggers, nose, pytest and webtest testing tools, appengine-fixture-loader (to load test or bootstrap data), and flake8 to do style checks on your code.

This tree was extracted from a larger project that makes use of it and further evolved on its own, with the enhancements ported back.

![nosetests running] (https://raw.githubusercontent.com/wiki/rbanffy/testable_appengine/screenshot.png)

Overall Structure

When you clone the Git repo, you'll have a tree structure not unlike the one below. This is the starting point for yout app.

├── build  (will be created when you run `make venv`)
├── cache  (will be created when you run `make venv`)
├── LICENSE
├── Makefile  (includes resourecs/Makefile)
├── README.md  (this file)
├── requirements.txt
├── resources
│   ├── autogenerated
│   ├── get_current_sdk_version.sh
│   ├── Makefile
│   └── requirements.txt (includes ../requirements.txt)
├── src  (contains a sample application)
│   ├── app.yaml
│   └── main.py
└── tests
    ├── __init__.py
    ├── persons.json
    └── sanity_test.py

Setting up your development environment

There is a makefile in the root directory. Running make venv will build a virtualenv in the .env folder, download the App Engine SDK, build the appropriate .pth files for your machine and install all requirements from the resources/requirements.txt file. If you wish to use a Python environment you provide yourself, you can make the virtualenv youself and run make libraries with VENV pointing to your virtualenv (as in VENV=.my_env make libraries)

The actual makefile is under resources. Your own makefile (with your own targets) should include it and extend it like the included Makefile does.

Please check the makefile before using it, as it may not make sense for your environment. It was tested on Ubuntu, Fedora, OSX (10.7+, provided you have functional pip and virtualenv utilities) and Windows 8.1 under Cygwin and Windows 10 under Ubuntu on Windows. If you are developing under Windows and don't use Cygwin or the Windows Subsystem for Linux, you are suffering more than you need for no good reason.

![Under Windows+Cygwin] (https://raw.githubusercontent.com/wiki/rbanffy/testable_appengine/windows.png)

![Under Ubuntu on Windows] (https://raw.githubusercontent.com/wiki/rbanffy/testable_appengine/ubuntu_on_windows.png)

When done, you can activate your virtualenv with the usual source .env/bin/activate or your favorite virtualenv tool. The tests will not function outside the local virtualenv. From the virtualenv, invoking dev_appserver.py and appcfg.py will use the versions in the SDK downloaded during install (check the Makefile for current version).

Your app should go in the local folder. Run your application using the dev_appserver.py script from within the virtualenv, as in dev_appserver.py .. Deploying ignores the files that do not belong to your application (the license, this README, cache, tests, resources and so on).

Tests

There are tests in the tests folder. The sanity_test.py checks whether everything is sane after you set up the environment.

Debugging

Debugging works like you'd expect. You just use pdb, ipdb or pudb (ipdb and pudb seem to have a tendency not to work under the dev_appserver, but pdb is just fine). Rule is, use ipbd or pudb if you want to debug something that's called by a test (run something like pudb .env/bin/nosetests), pdb for a live web application. Worst case scenario is that you just need to edit a little more. You can also easily use iPython to explore your ideas before you commit them to code.

![ipython prompt and ipdb in a test] (https://raw.githubusercontent.com/wiki/rbanffy/testable_appengine/using_ipdb.png)

![Using pudb] (https://raw.githubusercontent.com/wiki/rbanffy/testable_appengine/pudb.png)

Contributing

File a bug report (enhancement suggestions are fine too), fork it, PEP-8 it, test it, and, if it works, send a pull request. When in doubt, get in touch. We'll figure out what needs to be done.

This app is proudly checked with Travis

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].