Skip to content
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
999d92d
Import order
julien-lang Jul 16, 2025
9777db0
Remove __future__ imports
julien-lang Jul 16, 2025
e3e72cd
Cleanup super prototype
julien-lang Jul 16, 2025
2e3b54b
six.iter....
julien-lang Jul 16, 2025
64fa354
Remove calls to six.text_type and six.binary_type
julien-lang Jul 16, 2025
d014745
Remove calls to ensure_bytes, ensure_text, ensure_strings
julien-lang Jul 16, 2025
153f179
test fixed
eduardoChaucaGallegos Jul 17, 2025
2de2822
fixup! test fixed
julien-lang Jul 17, 2025
24835e3
Black
julien-lang Jul 17, 2025
60bb0bc
Update shotgun_api3/shotgun.py
julien-lang Jul 17, 2025
473b811
six.moves imports
julien-lang Jul 16, 2025
f68f1ae
Cleanup BytesIO import from six
julien-lang Jul 16, 2025
0b956cc
simple json
julien-lang Jul 16, 2025
b94da1a
Cleanup Py2-3 compat with ImportError
julien-lang Jul 16, 2025
6e89b98
Simplify Base64
julien-lang Jul 16, 2025
439d0b3
fixup! six.moves imports
julien-lang Jul 17, 2025
adbc0da
fixup! six.moves imports
julien-lang Jul 17, 2025
c4d1e30
Remove deprecated custome mimetype module
julien-lang Jul 16, 2025
e93ed1e
Remove deprecated backported mock module
julien-lang Jul 16, 2025
12f1abe
Fixup assert_called_once
julien-lang Jul 17, 2025
ea953d2
Fixup CI tests
julien-lang Jul 17, 2025
f45faac
fixup! Fixup CI tests
julien-lang Jul 17, 2025
6a2b3e2
provides debug info
julien-lang Jul 17, 2025
cb800c1
fixup! provides debug info
julien-lang Jul 17, 2025
a4afffa
fixup! Remove deprecated backported mock module
julien-lang Jul 17, 2025
77c9cd3
Remove python2 from httplib2 module
julien-lang Jul 16, 2025
6124681
fixup issue with ssl_error_classes
julien-lang Jul 17, 2025
10119ec
Cleanup six.PY2/six.PY3 conditions
julien-lang Jul 16, 2025
c9648c1
Remove useless test in Python 3
julien-lang Jul 16, 2025
e7ca1eb
Replace sgsix.file_types by io.IOBase
julien-lang Jul 16, 2025
3cbc5ff
Replace ShotgunSSLError by ssl.SSLError
julien-lang Jul 16, 2025
5d8b18d
Cleanup Python-2 related comments and workarounds
julien-lang Jul 17, 2025
b90a64b
fixup! Cleanup six.PY2/six.PY3 conditions
julien-lang Jul 17, 2025
f6275cd
Remove deprecated ensure_ascii parameter from SG object
julien-lang Jul 16, 2025
5c4dc5b
fixup! Remove deprecated ensure_ascii parameter from SG object
julien-lang Jul 17, 2025
c321734
Test CI
julien-lang Jul 17, 2025
1f370fe
fixup! Test CI
julien-lang Jul 17, 2025
2eb8306
fixup! fixup! Test CI
julien-lang Jul 17, 2025
1463852
fixup! fixup! fixup! Test CI
julien-lang Jul 17, 2025
da922f9
fixup! fixup! fixup! fixup! Test CI
julien-lang Jul 17, 2025
c03452a
Remove now unsused sgutils
julien-lang Jul 16, 2025
dc934f5
Remove now useless sgsix module
julien-lang Jul 16, 2025
9a131fa
Remove six module
julien-lang Jul 16, 2025
abbc531
pulling from master and conflicts fixed
eduardoChaucaGallegos Sep 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
source=shotgun_api3
omit=
shotgun_api3/lib/httplib2/*
shotgun_api3/lib/six.py
shotgun_api3/lib/certify/*
shotgun_api3/lib/pyparsing.py
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

[flake8]
max-line-length = 120
exclude = shotgun_api3/lib/httplib2/*,shotgun_api3/lib/six.py,tests/httplib2test.py,tests/mock.py
exclude = shotgun_api3/lib/httplib2/*,tests/httplib2test.py
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Integration and unit tests are provided.
- (Note: Running `pip install -r tests/ci_requirements.txt` will install this package)
- A `tests/config` file (you can copy an example from `tests/example_config`).
- Tests can be run individually like this: `nosetests --config="nose.cfg" tests/test_client.py`
- Make sure to not forget the `--config="nose.cfg"` option. This option tells nose to use our config file. This will exclude python 2- and 3-specific files in the `/lib` directory, preventing a failure from being reported by nose for compilation due to incompatible syntax in those files.
- Make sure to not forget the `--config="nose.cfg"` option. This option tells nose to use our config file.
- `test_client` and `tests_unit` use mock server interaction and do not require a Flow Production Tracking instance to be available (no modifications to `tests/config` are necessary).
- `test_api` and `test_api_long` *do* require a Flow Production Tracking 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`.
Expand Down
10 changes: 5 additions & 5 deletions azure-pipelines-templates/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ parameters:

jobs:
# The job will be named after the OS and Azure will suffix the strategy to make it unique
# so we'll have a job name "Windows Python 2.7" for example. What's a strategy? Strategies are the
# name of the keys under the strategy.matrix scope. So for each OS we'll have "<OS> Python 2.7" and
# "<OS> Python 3.7".
# so we'll have a job name "Windows Python 3.9" for example. What's a strategy? Strategies are the
# name of the keys under the strategy.matrix scope. So for each OS we'll have "<OS> Python 3.9" and
# "<OS> Python 3.10".
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vm_image }}
Expand Down Expand Up @@ -68,8 +68,8 @@ jobs:
versionSpec: '$(python.version)'
addToPath: True

# Install all dependencies needed for running the tests. This command is good for
# Python 2 and 3, but also for all OSes
# Install all dependencies needed for running the tests. This command is good
# for all OSes
- script: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r tests/ci_requirements.txt
Expand Down
3 changes: 1 addition & 2 deletions docs/cookbook/examples/ami_handler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ via ``POST``. If you're using a custom protocol the data is sent via ``GET``.
# Imports
# ---------------------------------------------------------------------------------------------
import sys, os
import six
import logging as logger

# ---------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -218,7 +217,7 @@ via ``POST``. If you're using a custom protocol the data is sent via ``GET``.
params = params.split("&")
p = {"column_display_names": [], "cols": []}
for arg in params:
key, value = map(six.moves.urllib.parse.unquote, arg.split("=", 1))
key, value = map(urllib.parse.unquote, arg.split("=", 1))
if key == "column_display_names" or key == "cols":
p[key].append(value)
else:
Expand Down
3 changes: 0 additions & 3 deletions docs/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,3 @@ Example for a user whose language preference is set to Japanese:
},
...
}

.. note::
If needed, the encoding of the returned localized string can be ensured regardless the Python version using shotgun_api3.lib.six.ensure_text().
23 changes: 0 additions & 23 deletions shotgun_api3/lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,8 @@ Some third-party modules are bundled with `python-api` inside lib.

The version of `httplib2` bundled should be updated manually, however its version is included in the unused `shotgun_api3/lib/requirements.txt` to allow Github's automated CVE notifications to work.

### mimetypes

The `mimetypes` module is broken on Windows only for Python 2.7.0 to 2.7.9 inclusively.
We bundle the version from 2.7.10

See bugs:

* [9291](http://bugs.python.org/issue9291) (Fixed in 2.7.7)
* [21652](http://bugs.python.org/issue21652) (Fixed in 2.7.8)
* [22028](http://bugs.python.org/issue22028) (Fixed in 2.7.10)

The version of `mimetypes` bundled should be updated manually if necessary, however it is unlikely this will be needed, as it is only used for Python versions 2.7.0 - 2.7.9, and newer Python versions simply use the native `mimetypes` module.

### six

Six is a Python 2/3 compatibility library. In python-api, it's used to make simultaneous support for Python on 2 and 3 easier to maintain and more readable, but allowing the use of common helper functions, unified interfaces for modules that changed, and variables to ease type comparisons. For more on six, see the [documentation](https://six.readthedocs.io/).

The version of `six` bundled should be updated manually, however its version is included in the unused `shotgun_api3/lib/requirements.txt` to allow Github's automated CVE notifications to work.

## Flow Production Tracking Modules

### sgsix

`sgsix` is a module that contains extensions to `six`. These might be additional helper functions, variables, etc. that supplement six's functionality. It is intended that `sgsix` can be used within other packages that include or depend on the `python-api` package as well.

### sgtimezone

`sgtimezone` contains classes for easing the conversion between the server (UTC) timezone and client timezone.
Expand Down
Loading