Skip to content

Commit db8d185

Browse files
committed
Merge pull request #10 from uber/travis
Add travis integration
2 parents 0ccbe17 + 8058fd3 commit db8d185

File tree

6 files changed

+37
-11
lines changed

6 files changed

+37
-11
lines changed

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: python
2+
install: make bootstrap
3+
script: make
4+
branches:
5+
except:
6+
- /^v[0-9]/

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.PHONY: bootstrap clean lint test
2+
.DEFAULT_GOAL := test
3+
4+
test: clean lint
5+
@py.test -s test/
6+
7+
lint:
8+
@flake8 .
9+
10+
clean:
11+
@find . -type f -name '*.pyc' -delete
12+
13+
bootstrap:
14+
@pip install -r requirements.txt
15+
@pip install -r requirements-test.txt
16+
@python setup.py develop

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Example Uber app for developers
22
==============================
33

4+
[![TravisCI](https://travis-ci.org/uber/doubles.svg?branch=master)](https://travis-ci.org/uber/doubles)
5+
46
https://developer.uber.com/
57

68
What Is This?
@@ -24,15 +26,8 @@ How To Use This
2426
Testing
2527
-------
2628

27-
1. Install the dependencies with:
28-
29-
```bash
30-
pip install -r requirements.txt
31-
pip install -r requirements-test.txt
32-
python setup.py develop
33-
```
34-
35-
2. Run the command `py.test test/`
29+
1. Install the dependencies with `make bootstrap`
30+
2. Run the command `make test`
3631
3. If you delete the fixtures, or decide to add some of your own, you’ll have to re-generate them, and the way this is done is by running the app, getting an auth_token from the main page of the app. Paste that token in place of the `test_auth_token` at the top of the `test_endpoints.py` file, then run the tests.
3732

3833

@@ -42,7 +37,7 @@ Development
4237
If you want to work on this application we’d love your pull requests and tickets on GitHub!
4338

4439
1. If you open up a ticket, please make sure it describes the problem or feature request fully.
45-
2. If you send us a pull request, make sure you add a test for what you added, and make sure the full test suite runs with `py.test`.
40+
2. If you send us a pull request, make sure you add a test for what you added, and make sure the full test suite runs with `make test`.
4641

4742
Deploy to Heroku
4843
----------------

app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ def get_redirect_uri(request):
223223
"""Return OAuth redirect URI."""
224224
parsed_url = urlparse(request.url)
225225
if parsed_url.hostname == 'localhost':
226-
return 'http://{hostname}:{port}/submit'.format(hostname=parsed_url.hostname, port=parsed_url.port)
226+
return 'http://{hostname}:{port}/submit'.format(
227+
hostname=parsed_url.hostname, port=parsed_url.port
228+
)
227229
return 'https://{hostname}/submit'.format(hostname=parsed_url.hostname)
228230

229231
if __name__ == '__main__':

requirements-test.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ pytest-cov==1.6
66

77
# HTTP Fixtures
88
betamax==0.4.0
9+
10+
# LINT OR DIE
11+
flake8==2.1.0
12+
pep8==1.5.6
13+
pyflakes==0.8.1

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max-line-length = 100

0 commit comments

Comments
 (0)