For #47048, setup CI (#173) · oopoopoop/python-api@2704880 · GitHub
Skip to content

Commit 2704880

Browse files
authored
For #47048, setup CI (shotgunsoftware#173)
Beefs up the CI around the API: - HoundCI will do PEP8 validation - AppVeyor will do Windows builds - coveralls.io will offer code coverage - badges feature more prominently now on the README.
1 parent edce21b commit 2704880

9 files changed

Lines changed: 166 additions & 9 deletions

File tree

.coveragerc

Lines changed: 20 additions & 3 deletions

.flake8

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright (c) 2018 Shotgun Software Inc.
2+
#
3+
# CONFIDENTIAL AND PROPRIETARY
4+
#
5+
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
6+
# Source Code License included in this distribution package. See LICENSE.
7+
# By accessing, using, copying or modifying this work you indicate your
8+
# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights
9+
# not expressly granted therein are reserved by Shotgun Software Inc.
10+
11+
# Flake 8 PEP and lint configuration - https://gitlab.com/pycqa/flake8
12+
#
13+
# This defines the official lint and PEP8 rules for this repository
14+
#
15+
# You can run this locally by doing pep install flake8 and then
16+
# >flake8 /path/to/core
17+
#
18+
# This is also used by the hound CI - see the .hound.yml config file.
19+
#
20+
#
21+
[flake8]
22+
23+
# things we don't want to lint
24+
exclude =
25+
.git,
26+
.flake8,
27+
.gitignore,
28+
.travis.yml,
29+
.cache,
30+
.eggs,
31+
*.rst,
32+
*.yml,
33+
*.pyc,
34+
*.pyo,
35+
*.egg-info,
36+
__pycache__,
37+
# Those are our third parties, do not lint them!
38+
shotgun_api3/lib/httplib2/*.py,
39+
shotgun_api3/lib/simplejson/*.py,
40+
shotgun_api3/lib/xmlrpclib.py
41+
42+
# exceptions
43+
#
44+
# E501 line too long (112 > 79 characters)
45+
# E402 module level import not top of file
46+
# E999 SyntaxError: invalid syntax (hack for hound CI which runs python 3.x)
47+
48+
ignore = E501, E402, E999
49+

.hound.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2017 Shotgun Software Inc.
2+
#
3+
# CONFIDENTIAL AND PROPRIETARY
4+
#
5+
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
6+
# Source Code License included in this distribution package. See LICENSE.
7+
# By accessing, using, copying or modifying this work you indicate your
8+
# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights
9+
# not expressly granted therein are reserved by Shotgun Software Inc.
10+
11+
# https://houndci.com configuration file for linting and PEP8
12+
13+
python:
14+
enabled: true
15+
config_file: .flake8
16+

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ python:
44
- "2.7"
55
# command to install dependencies
66
install:
7-
- pip install nose
7+
- pip install -r tests/ci_requirements.txt
88
before_script:
99
- cp ./tests/example_config ./tests/config
1010
# command to run tests
11-
script: nosetests -v
11+
script: coverage run -m nose
12+
after_success: coveralls
1213
notifications:
1314
email:
1415
- api@shotgunsoftware.com

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
[![VFX Platform](https://img.shields.io/badge/vfxplatform-2018-yellow.svg)](http://www.vfxplatform.com/)
2+
[![Reference Documentation](http://img.shields.io/badge/doc-reference-blue.svg)](http://developer.shotgunsoftware.com/python-api)
3+
[![Build Status Linux](https://secure.travis-ci.org/shotgunsoftware/python-api.svg?branch=master)](http://travis-ci.org/shotgunsoftware/python-api)
4+
[![Build status Windows](https://ci.appveyor.com/api/projects/status/slvw7u4jatvdly98/branch/master?svg=true
5+
)](https://ci.appveyor.com/project/jfboismenu/python-api/branch/master)
6+
[![Coverage Status](https://coveralls.io/repos/github/shotgunsoftware/python-api/badge.svg?branch=master)](https://coveralls.io/github/shotgunsoftware/python-api?branch=master)
7+
[![Linting](https://img.shields.io/badge/PEP8%20by-Hound%20CI-a873d1.svg)](https://houndci.com)
8+
19
# Shotgun Python API
210

311
Shotgun provides a simple Python-based API for accessing Shotgun and integrating with other tools. This is the official API that is maintained by Shotgun Software (support@shotgunsoftware.com)
@@ -32,9 +40,6 @@ You can see the [full history of the Python API on the documentation site](http:
3240

3341
Integration and unit tests are provided.
3442

35-
[![Build Status](https://secure.travis-ci.org/shotgunsoftware/python-api.svg?branch=master)](http://travis-ci.org/shotgunsoftware/python-api)
36-
37-
3843
- All tests require the [nose unit testing tools](http://nose.readthedocs.org), and a `tests/config` file (you can copy an example from `tests/example_config`).
3944
- Tests can be run individually like this: `nosetest tests/test_client.py`
4045
- `test_client` and `tests_unit` use mock server interaction and do not require a Shotgun instance to be available (no modifications to `tests/config` are necessary).

appveyor.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (c) 2017 Shotgun Software Inc.
2+
#
3+
# CONFIDENTIAL AND PROPRIETARY
4+
#
5+
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
6+
# Source Code License included in this distribution package. See LICENSE.
7+
# By accessing, using, copying or modifying this work you indicate your
8+
# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights
9+
# not expressly granted therein are reserved by Shotgun Software Inc.
10+
11+
# https://www.appveyor.com/ Windows CI configuration file.
12+
13+
environment:
14+
matrix:
15+
- PYTHON: "C:\\Python27"
16+
17+
# To update these values, visit AppVeyor's site, click the user icon and scroll down to Encrypt Data.
18+
SG_SERVER_URL:
19+
secure: lIYAxmyz5GEvnbxqE1pAoNuU5+04RYsSzfjRxjqV7vI=
20+
SG_HUMAN_LOGIN: appveyor
21+
SG_HUMAN_NAME: App Veyor
22+
SG_HUMAN_PASSWORD:
23+
secure: 0/BofzMkXtzwtRqzC94FHt3lcyMBG0rr2w0rUropeT4=
24+
SG_SCRIPT_NAME: python-api-test
25+
SG_API_KEY:
26+
secure: cTW+pBjl1H17hsjDOvLaspqkc3H9juXfOhoXMvdcA2l3b5FQeJVYUBWaJUxmqTw9gEzAHmUS6R4WVvw07IWOQ9on8UFHsHqv3JkL2Ji/Oeo=
27+
SG_PROJECT_NAME: SG unittest project for AppVeyor
28+
29+
build: off
30+
31+
test_script:
32+
# Put your test command here.
33+
# If you don't need to build C extensions on 64-bit Python 3.3 or 3.4,
34+
# you can remove "build.cmd" from the front of the command, as it's
35+
# only needed to support those cases.
36+
# Note that you must use the environment variable %PYTHON% to refer to
37+
# the interpreter you're using - Appveyor does not do anything special
38+
# to put the Python version you want to use on PATH.
39+
- "tests\\run_appveyor.bat"

tests/ci_requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
coveralls==1.1
2+
nose

tests/run_appveyor.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
:: Copyright (c) 2018 Shotgun Software Inc.
2+
::
3+
:: CONFIDENTIAL AND PROPRIETARY
4+
::
5+
:: This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
6+
:: Source Code License included in this distribution package. See LICENSE.
7+
:: By accessing, using, copying or modifying this work you indicate your
8+
:: agreement to the Shotgun Pipeline Toolkit Source Code License. All rights
9+
:: not expressly granted therein are reserved by Shotgun Software Inc.
10+
11+
::
12+
:: This file is run by the appveyor builds.
13+
::
14+
15+
copy tests\example_config tests\config
16+
%PYTHON%\Scripts\pip install -r tests/ci_requirements.txt
17+
%PYTHON%\Scripts\nosetests.exe -v

tests/test_api.py

Lines changed: 12 additions & 1 deletion

0 commit comments

Comments
 (0)