Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SG-29997 Removing Python 2 code #345

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Flow Production Tracking Python API Changelog

Here you can see the full list of changes between each Python API release.

v3.7.0 (2024 Jun 10)
===================
- Drop support for Python 2.x.x
- Drop use of six package
- Documentation update
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only change this file when we prepare a release of python-api. Not when we work on the code.


v3.6.0 (2024 May 1)
===================
- Drop support for Python 2.7
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,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. This will exclude python 3 specific files in the `/lib` directory, preventing a failure from being reported by nose for compilation due to incompatible syntax in those files.
- `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
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@
f = open('LICENSE')
license = f.read().strip()

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


setup(
name='shotgun_api3',
version='3.6.0',
version='3.7.0',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not in this PR

description='Flow Production Tracking Python API',
long_description=readme,
author='Autodesk',
Expand Down
10 changes: 2 additions & 8 deletions shotgun_api3/lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Some third-party modules are bundled with `python-api` inside lib.

### httplib2

`httplib2` is used to make http connections to the Flow Production Tracking 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.
`httplib2` is used to make http connections to the Flow Production Tracking server.

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.

Expand All @@ -23,17 +23,11 @@ See bugs:

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see six removed in this PR. We should keep this until it is completely removed.


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.
`sgutils` is a module that contains additional helper functions, variables, etc. that supplement six's functionality. It is intended that `sgutils` can be used within other packages that include or depend on the `python-api` package as well.

### sgtimezone

Expand Down
Loading