Skip to content

Commit 2f61756

Browse files
Use tox with Travis and some cleanup (#282)
* 🎨 use too with Travis and some cleanup * 🐛 pass VCAP_SERVICES when running tests with tox
1 parent 859368e commit 2f61756

9 files changed

+253
-734
lines changed

.travis.yml

+8-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
language: python
22
sudo: false
3-
notifications:
4-
email: false
3+
54
python:
65
- '2.7'
76
- '3.4'
87
- '3.5'
98
- '3.6'
9+
10+
cache: pip
11+
1012
before_install:
1113
- ! '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && openssl aes-256-cbc -K $encrypted_c3e85137836d_key -iv $encrypted_c3e85137836d_iv -in .env.enc -out .env -d || true'
12-
install:
13-
- pip install -r requirements-dev.txt
14-
- pip install pylint
15-
- pip install codecov
16-
- pip install git+git://github.com/watson-developer-cloud/python-sdk.git#egg=watson-developer-cloud
17-
- pip show six
18-
script:
19-
- sh pylint.sh
20-
- py.test test --cov=watson_developer_cloud
14+
15+
install: pip install tox-travis
16+
script: tox
17+
2118
after_success:
2219
- codecov
2320
- docs/publish.sh

CONTRIBUTING.md

+25-19
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,56 @@
1-
# Questions
1+
# Contributing
2+
3+
## Questions
24

35
If you are having difficulties using the APIs or have a question about the IBM Watson Services,
46
please ask a question on [dW Answers][dw] or [Stack Overflow][stackoverflow].
57

6-
# Issues
8+
## Issues
79

810
If you encounter an issue with the Python SDK, you are welcome to submit a [bug report](https://github.com/watson-developer-cloud/python-sdk/issues).
911
Before that, please search for similar issues. It's possible somebody has encountered this issue already.
1012

1113
## Pull Requests
1214

1315
If you want to contribute to the repository, here's a quick guide:
14-
1. Fork the repository
15-
2. develop and test your code changes with [pytest].
16+
17+
1. Fork the repository
18+
1. Install `virtualenv` and `tox`
19+
1. Develop and test your code changes with [pytest].
1620
* Respect the original code [style guide][styleguide].
1721
* Only use spaces for indentation.
1822
* Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted create a separate PR for this change.
19-
* Check for unnecessary whitespace with git diff --check before committing.
20-
3. Make the test pass
21-
4. Commit your changes
22-
5. Push to your fork and submit a pull request to the `dev` branch
23+
* Check for unnecessary whitespace with `git diff --check` before committing.
24+
* Make sure your code supports Python 2.7, 3.4, 3.5 and 3.6. You can use `pyenv` and `tox` for this
25+
1. Make the test pass
26+
1. Commit your changes
27+
1. Push to your fork and submit a pull request to the `dev` branch
2328

2429
## Running the tests
2530

2631
You probably want to set up a [virtualenv].
2732

28-
1. Clone this repository:
29-
```
33+
1. Clone this repository:
34+
```sh
3035
git clone https://github.com/watson-developer-cloud/python-sdk.git
3136
```
32-
2. Install the sdk as an editable package using the current source:
33-
```
37+
1. Install the sdk as an editable package using the current source:
38+
```sh
3439
pip install --editable .
3540
```
36-
3. Install the test dependencies with:
37-
```
38-
pip install -r requirements-dev.txt
39-
```
40-
4. Run the test cases with:
41+
1. Install the test dependencies with:
42+
```sh
43+
pip install -r requirements-dev.txt
4144
```
45+
1. Run the test cases with:
46+
```sh
4247
py.test test
4348
```
4449

4550
## Additional Resources
46-
+ [General GitHub documentation](https://help.github.com/)
47-
+ [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
51+
52+
* [General GitHub documentation](https://help.github.com/)
53+
* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
4854

4955
[dw]: https://developer.ibm.com/answers/questions/ask/?topics=watson
5056
[stackoverflow]: http://stackoverflow.com/questions/ask?tags=ibm-watson

0 commit comments

Comments
 (0)