-
Notifications
You must be signed in to change notification settings - Fork 120
SG-37222 new way to handle python third parties #996
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
base: master
Are you sure you want to change the base?
SG-37222 new way to handle python third parties #996
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #996 +/- ##
=======================================
Coverage 79.79% 79.79%
=======================================
Files 198 198
Lines 20770 20760 -10
=======================================
- Hits 16573 16566 -7
+ Misses 4197 4194 -3 ☔ View full report in Codecov by Sentry. |
Right now we use Rez to manage our internal libraries. This helps to keep our repo clean of duplicating libraries and implementing CICD to package the site-packages with our internal libs. With this, we can pull from our py registry (github), to manage our library injections. |
…_init__.py to best behavior with third parties
carlos-villavicencio-adsk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The init.py file it's too big in my opinion. It would be great to have a better organization/modularization there. Maybe we can consider using a main.py file? These are just thoughts.
Besides this, I think we should start testing this throughoutly.
julien-lang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few changes please. Also, I agree with all comments from Charlie so could you address them please?
And could you add some unit tests validating the import and handle of third partiy libs
This pull request introduces a major overhaul to the way third-party Python dependencies are managed and loaded in the project, focusing on the
tank_vendormechanism. The changes centralize dependency management using versionedpkgs.zipfiles, implement a robust dynamic import hook for thetank_vendornamespace, and improve documentation and maintainability. Legacy or redundant scripts and files are removed, and package-specific patches are handled more cleanly.Dependency Management and Loading Redesign:
tank_vendor/__init__.pythat auto-discovers and loads third-party packages from version-specificpkgs.zipfiles, supports lazy aliasing for thetank_vendor.*namespace, and applies package-specific patches (e.g., forshotgun_api3SSL certificates). This includes a custom meta path finder and robust error handling for missing or invalid ZIP files.developer/README.mdto describe the new requirements folder structure, the workflow for updating bundled dependencies, and the rationale behind usingpkgs.zipfiles for consistent and reproducible environments. [1] [2]Import and Compatibility Improvements:
python/tank/bootstrap/import_handler.pyto correctly skip SourceFileLoader for modules inside ZIP files, ensuring compatibility with the new packaging approach.upgrade_pyyaml.pyscript, as dependency upgrades are now handled via the new requirements workflow and automation.Cleanup and Maintenance:
packaging/__init__.pyandpackaging/_structures.py, as these are now managed within the ZIP-based dependency system. [1] [2]These changes modernize and streamline dependency management for the project, making it more maintainable and robust across Python versions and environments.
Resolves #914