Skip to content

SG-38306 Python2 Removal - Part 3 - Cleanup imports #400

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

Open
wants to merge 7 commits into
base: ticket/SG-38306-python2-removal-future-wording
Choose a base branch
from

Conversation

@julien-lang julien-lang force-pushed the ticket/SG-38306-python2-removal-cleanup-imports branch from 9850464 to 6e89b98 Compare July 17, 2025 14:12
@julien-lang julien-lang requested a review from Copilot July 17, 2025 14:14
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR is part of a Python 2 removal effort that focuses on cleaning up imports throughout the codebase. The changes replace deprecated six.moves imports with their standard Python 3 equivalents, simplify base64 encoding logic, and remove legacy Python 2/3 compatibility code.

Key changes include:

  • Replacing six.moves imports with direct Python 3 standard library imports
  • Simplifying base64 encoding by using base64.encodebytes directly
  • Removing deprecated JSON import fallback logic and Python 2/3 compatibility code

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_unit.py Replaces six.moves.urllib with direct urllib.request and urllib.error imports
tests/test_client.py Removes JSON import fallback logic and base64 compatibility code, adds direct stdlib imports
tests/test_api.py Replaces six.moves imports with direct urllib imports
tests/base.py Adds direct configparser and json imports, removes Python 2.6 compatibility code
shotgun_api3/shotgun.py Major cleanup replacing six.moves imports with direct stdlib imports and simplifying base64 usage
shotgun_api3/lib/mockgun/schema.py Replaces six.moves.cPickle with direct pickle import
docs/cookbook/examples/ami_handler.rst Updates documentation example to use direct urllib.parse import

@julien-lang julien-lang marked this pull request as ready for review July 17, 2025 14:34
@julien-lang julien-lang requested a review from a team July 17, 2025 14:35
Copy link
Contributor

@carlos-villavicencio-adsk carlos-villavicencio-adsk left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants