shotgunsoftware / python-api

A Python-based library for accessing Flow Production Tracking API.
https://developer.shotgridsoftware.com/python-api
Other
308 stars 198 forks source link

SG-32061 Python3.7+ Syntax #297

Closed mathbou closed 10 months ago

mathbou commented 1 year ago

Hi there,

I just saw through SG-31340-deprecation-py2 that py2 has officially been deprecated, so I updated the API to embrace a py3.7+ syntax

The biggest changes:

carlos-villavicencio-adsk commented 1 year ago

Thank you for that! Do you know why unit tests are failing? It seems they share the same root cause.

mathbou commented 1 year ago

Thank you for that! Do you know why unit tests are failing? It seems they share the same root cause.

I think I found the reason: CI tests relies on variables given by the run_tests.yml file. If tests are triggered from a PR, those value should be null, but the syntax that has been used prevent that, and instead the name of those variables were returned.

carlos-villavicencio-adsk commented 1 year ago

Amazing!

I have one question, since tk-core bundles python-api module, would it be an issue to have dependencies such as certifi not bundled as before?

mathbou commented 1 year ago

I have one question, since tk-core bundles python-api module, would it be an issue to have dependencies such as certifi not bundled as before?

Indeed yes, It will not work as is. I made a PR for the tk-core that would support this "vendor-less" version https://github.com/shotgunsoftware/tk-core/pull/914

carlos-villavicencio-adsk commented 1 year ago

Thank you for the clarification. If it's possible, can you split this work into two different PRs? We want to address these improvements separately. So ideally the extraction of the bundled dependencies can be reviewed outside of this scope.

mathbou commented 1 year ago

@carlos-villavicencio-adsk

I split this PR in two

A rebase will probably be required between the two merge to ensure there are no conflict between them