SG-Jira bridge - python 2.7?

Hi!

I’m trying to set up the sg-jira bridge. Do you have use python 2.7 even though it’s no longer supported? I tried to install shotgun_api3 w/2.7 and got this message:

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.

Collecting shotgun_api3
ERROR: Could not find a version that satisfies the requirement shotgun_api3 (from versions: none)
ERROR: No matching distribution found for shotgun_api3

So I tried with python 3.7, but getting import error with

Traceback (most recent call last):
File “sg-jira-bridge/update_shotgun_users.py”, line 13, in
from shotgun_api3 import Shotgun
File “/Users/bonnietai/venv/lib/python3.7/site-packages/shotgun_api3/init.py”, line 1, in
from shotgun import (Shotgun, ShotgunError, ShotgunFileDownloadError, Fault,
ImportError: cannot import name ‘Shotgun’ from ‘shotgun’ (/Users/bonnietai/venv/lib/python3.7/site-packages/shotgun/init.py)

Even though I’ve installed both Shotgun and shotgun packages.

Thanks,
Bonnie

5 Likes

Hi Bonnie!

First, welcome to the community! :partying_face:

You currently have to use Python 2.7 for both the JIRA bridge and the Shotgun event daemon. We haven’t ported these components yet to Python 3.

The error you have seen during the import of shotgun_api3 in the JIRA bridge when using Python 3.7 is due to the fact that the JIRA bridge’s requirements.txt file has pinned the version of the Python API to 3.0.39, which wasn’t Python 3 compliant.

We’re still porting our code to Python 3. Our current focus is on the Toolkit components. JIRA Bridge and Event Daemon are going to be ported at the tail end of the port. The reason Toolkit is prioritized over these two components is that the bridge and the daemon run with a version of Python that our clients have complete control over.

On the other hand, for software like Maya and Nuke, our clients are at the mercy of whatever versions of Python the software vendors decides to ship with. We do not want clients to be blocked from upgrading to a more recent version of a product because we do not support Python 3. It’s looking like most of the software vendors are going to be shipping support for both Python 2 and 3 this year, but there’s no guarantee how long they will. Plus, certain DCCs, like Blender, only support Python 3.

Cheers,

JF

3 Likes

Ah, I see, thanks JF!

I changed my venv to use python 2.7 and it works now. However, now I’m running into this error when I run sg-jira-bridge/update_shotgun_users.py:

File “/Users/bonnietai/Shotgun/venv/lib/python2.7/site-packages/jira/resilientsession.py”, line 57, in raise_on_error
r.status_code, error, r.url, request=request, response=r, **kwargs)
jira.exceptions.JIRAError: JiraError HTTP 400 url: https://playosmo.atlassian.net/rest/api/2/user/assignable/search?username=oscar_jpark%40hotmail.com&project=OTA&maxResults=2000
text: The query parameter ‘username’ is not supported in GDPR strict mode.

That seems to be addressed in the latest version of update_shotgun_users.py … is there something on the jira side I need to do? We are using jira cloud.

Thanks,
Bonnie

Hi @bonosmo,

This error is due to recent changes to the Jira Cloud REST API. You will need to update to sg-jira-bridge v0.2.2 to pick up the fix.

Once you have the code downloaded, make sure you update the packages in your environment as well by running:
pip install --upgrade -r /path/to/sg-jira-bridge/requirements.txt

Hopefully that will solve your problem.