Skip to content

Commit 343346c

Browse files
author
Mathieu
committed
remove embedded six, sgsix, httplib2, mimetypes, certifi and pyparsing // add httplib2 and certifi to requirements
1 parent b8a907f commit 343346c

42 files changed

Lines changed: 116 additions & 23791 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveragerc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,3 @@
1414

1515
[run]
1616
source=shotgun_api3
17-
omit=
18-
shotgun_api3/lib/httplib2/*
19-
shotgun_api3/lib/six.py

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010

1111
[flake8]
1212
max-line-length = 120
13-
exclude = shotgun_api3/lib/httplib2/*,shotgun_api3/lib/six.py,tests/httplib2test.py,tests/mock.py
13+
exclude = tests/mock.py

docs/advanced/packaging.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ There are caveats you need to be aware of when creating such an app.
1515
HTTPS Validation and cacerts.txt
1616
********************************
1717
When creating the connection to ShotGrid a file is used to validate the ShotGrid certificate. This
18-
file is located at ``shotgun_api3/lib/httplib2/cacerts.txt``. Because this file is not a Python
18+
file can be located with ``httplib2.BUILTIN_CA_CERTS``. Because this file is not a Python
1919
file imported by your application, py2app will not know to include it in your package, it will
2020
need to be explicitly specified in your ``setup.py`` file (edit the path based on the location
2121
where your ``shotgun_api3`` package is located)::
2222

2323
DATA_FILES = [
24-
('shotgun_api3', ['/shotgun/src/python-api/shotgun_api3/lib/httplib2/cacerts.txt'])
24+
('shotgun_api3', [httplib2.BUILTIN_CA_CERTS])
2525
]
2626

2727
Once you create your py2app package its contents should include two files (among others) in the

docs/cookbook/examples/ami_handler.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ via ``POST``. If you're using a custom protocol the data is sent via ``GET``.
9595
# Imports
9696
# ---------------------------------------------------------------------------------------------
9797
import sys, os
98-
import six
98+
import urllib.parse
9999
import logging as logger
100100

101101
# ---------------------------------------------------------------------------------------------
@@ -218,7 +218,7 @@ via ``POST``. If you're using a custom protocol the data is sent via ``GET``.
218218
params = params.split("&")
219219
p = {"column_display_names": [], "cols": []}
220220
for arg in params:
221-
key, value = map(six.moves.urllib.parse.unquote, arg.split("=", 1))
221+
key, value = map(urllib.parse.unquote, arg.split("=", 1))
222222
if key == "column_display_names" or key == "cols":
223223
p[key].append(value)
224224
else:

docs/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ If you're using pip with `requirements.txt`, add the following line::
6060
Installing with ``setup.py``
6161
****************************
6262

63-
From a local copy of the repository, you can run ``python setup.py install`` to copy the package inside your python ``site-packages``. Note that while ``setuptools`` will complain about syntax errors when installing the library, the library is fully functional. However, it ships with both Python 2 and Python 3 copies of ``httplib2``, which will generate syntax errors when byte-compiling the Python modules.
63+
From a local copy of the repository, you can run ``python setup.py install`` to copy the package inside your python ``site-packages``. Note that while ``setuptools`` will complain about syntax errors when installing the library, the library is fully functional.

docs/reference.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,3 @@ Example for a user whose language preference is set to Japanese:
964964
},
965965
...
966966
}
967-
968-
.. note::
969-
If needed, the encoding of the returned localized string can be ensured regardless the Python version using shotgun_api3.lib.six.ensure_text().

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@
1818
f = open('LICENSE')
1919
license = f.read().strip()
2020

21-
# For python 2.4 support
2221
script_args = sys.argv[1:]
23-
if (sys.version_info[0] <= 2) or (sys.version_info[0] == 2 and sys.version_info[1] <= 5):
24-
if 'install' in script_args and '--no-compile' not in script_args:
25-
script_args.append('--no-compile')
26-
2722

2823
setup(
2924
name='shotgun_api3',
@@ -39,4 +34,9 @@
3934
include_package_data=True,
4035
package_data={'': ['cacerts.txt', 'cacert.pem']},
4136
zip_safe=False,
37+
python_requires='>=3.7.0',
38+
install_requires=[
39+
'httplib2>=0.19.1',
40+
'certifi>=2022.12.7',
41+
],
4242
)

shotgun_api3/lib/README.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,8 @@
44

55
Some third-party modules are bundled with `python-api` inside lib.
66

7-
### httplib2
8-
9-
`httplib2` is used to make http connections to the ShotGrid server. We bundle both python2 and python3 compatible versions since httplib2 chose to maintain parallel versions of the module for python 2 and 3 compatibility.
10-
11-
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.
12-
13-
### mimetypes
14-
15-
The `mimetypes` module is broken on Windows only for Python 2.7.0 to 2.7.9 inclusively.
16-
We bundle the version from 2.7.10
17-
18-
See bugs:
19-
20-
* [9291](http://bugs.python.org/issue9291) (Fixed in 2.7.7)
21-
* [21652](http://bugs.python.org/issue21652) (Fixed in 2.7.8)
22-
* [22028](http://bugs.python.org/issue22028) (Fixed in 2.7.10)
23-
24-
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.
25-
26-
### six
27-
28-
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/).
29-
30-
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.
31-
327
## ShotGrid Modules
338

34-
### sgsix
35-
36-
`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.
37-
389
### sgtimezone
3910

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

shotgun_api3/lib/certifi/__init__.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

shotgun_api3/lib/certifi/__main__.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)