Skip to content

ryandj/python-api

 
 

Repository files navigation

VFX Platform Reference Documentation Build Status Linux Build status Windows Coverage Status Linting

Shotgun Python API

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)

The latest version can always be found at http://github.com/shotgunsoftware/python-api

Minimum Requirements

  • Shotgun server v2.4.12+.
  • Python v2.6 - v2.7.

High Performance Requirements

Documentation

Tutorials and detailed documentation about the Python API are available at http://developer.shotgunsoftware.com/python-api).

Some useful direct links:

Changelog

You can see the full history of the Python API on the documentation site.

Updating HTTPLib2

  1. Download the latest version of HTTPLib2 at https://pypi.org/project/httplib2.
  2. Extract the python2/httplib2 into shotgun_api3/lib/http2lib without the test folder.
  3. Scan the files for any references to importing httplib2 and make sure they import "from ." instead of "from httplib2" because the library isn't in the Python path.

Tests

Integration and unit tests are provided.

  • All tests require the nose unit testing tools, and a tests/config file (you can copy an example from tests/example_config).
  • Tests can be run individually like this: nosetest tests/test_client.py
  • 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).
  • test_api and test_api_long do require a Shotgun instance, with a script key available for the tests. The server and script user values must be supplied in the tests/config file. The tests will add test data to your server based on information in your config. This data will be manipulated by the tests, and should not be used for other purposes.
  • To run all of the tests, use the shell script run-tests.

Release process

Packaging up new release

  1. Update the Changelog in the HISTORY.rst file
    • Add bullet points for any changes that have happened since the previous release. This may include changes you did not make so look at the commit history and make sure we don't miss anything. If you notice something was done that wasn't added to the changelog, hunt down that engineer and make them feel guilty for not doing so. This is a required step in making changes to the API.
    • Try and match the language of previous change log messages. We want to keep a consistent voice.
    • Make sure the date of the release matches today. We try and keep this TBD until we're ready to do a release so it's easy to catch that it needs to be updated.
    • Make sure the version number is filled out and correct. We follow semantic versioning. Or more correctly, we should be following it.
  2. Ensure any changes or additions to public methods are documented
    • Update the Github wiki, and usually you'll need to update the Method Reference page with concise and exact documentation of the changes that are in this release.
    • Ensure that doc strings are updated in the code itself to work with Sphinx and are correctly formatted.
    • Examples are always good especially if this a new feature or method.
    • Think about a new user to the API trying to figure out how to use the features you're documenting.
  3. Update the version value in python-api/setup.py to match the version you are packaging. This controls what version users will get when installing via pip.
  4. Update the __version__ value in shotgun_api3/shotgun.py to the version you're releasing. This identified the current version within the API itself.
  5. Commit these changes in master with a commit message like packaging for the vx.x.x release.
  6. Create a tag based off of the master branch called vx.x.x to match the version number you're releasing.
  7. Push master and your tag to Github.
  8. Update the Releases page with your new release.
    • The release should already be there from your tag but if not, create a new one.
    • Add more detailed information regarding the changes in this release. This is a great place to add examples, and reasons for the change!

Letting the world know

We usually send an email to the shotgun-dev list with an announcement of the release and highlight the changes.

Prepare for the Next Dev Cycle

  1. Update the __version__ value in shotgun_api3/shotgun.py to the next version number with .dev appended to it. For example, v3.0.24.dev
  2. Add a new section to the Changelog in the HISTORY.rst file with the next version number and a TBD date
    **v3.0.24 - TBD**
       + TBD
  1. Commit the changes to master with a commit message like Bump version to v3.0.24.dev
  2. Push master to Github

About

A Python-based API for accessing Shotgun.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 89.9%
  • C 10.0%
  • Other 0.1%