Skip to content

Conversation

ssteinbach
Copy link
Collaborator

@ssteinbach ssteinbach commented Apr 16, 2021

  • During plugin loading, checks to see which source_files have already been loaded before loading a new plugin.
  • For pkg_resource plugins that use the function approach rather than the manifest.json approach, generates a source_files path based on the path to the module containing the function.
  • Adds unit tests to check duplicate entries.
  • Also updates and clarifies some documentation around how the plugin manifests are loaded.

@ssteinbach ssteinbach added this to the Public Beta 14 milestone Apr 16, 2021
@avrata
Copy link
Contributor

avrata commented Apr 16, 2021

This all looks good to me. I did have two thoughts but in thinking about it more I don't know if they are really worth any changes:

  • Any concern with relative vs absolute paths? This code did not try and normalize them before, but with using the file path as a key now, there could be some inadvertent missed collisions if they are intermixed.
  • Could/should this all be localized into Manifest.extend()? I don't see an easy way to do this currently though using source_files. (such that people might want to manually call this, but could get into trouble if so)

I still wish I could track down what the "duplicate schema def" issue was and if we should be super strict about never allowing duplicates in any of these internal lists or not.

@ssteinbach
Copy link
Collaborator Author

@avrata I think this function could use a clean up pass and refactor how the manifests aggregate and are loaded. But this adds a check for relative vs absolute paths.

@codecov-commenter
Copy link

codecov-commenter commented Apr 16, 2021

Codecov Report

Merging #945 (44cfacc) into master (1f92548) will decrease coverage by 0.02%.
The diff coverage is 80.70%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #945      +/-   ##
==========================================
- Coverage   85.63%   85.61%   -0.03%     
==========================================
  Files         191      191              
  Lines       18160    18204      +44     
  Branches     2061     2071      +10     
==========================================
+ Hits        15552    15585      +33     
- Misses       2085     2088       +3     
- Partials      523      531       +8     
Flag Coverage Δ
unittests 85.61% <80.70%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
tests/test_plugin_detection.py 81.57% <69.23%> (-2.55%) ⬇️
tests/test_adapter_plugin.py 88.72% <83.33%> (-0.94%) ⬇️
...-opentimelineio/opentimelineio/plugins/manifest.py 86.56% <84.61%> (-1.77%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1f92548...44cfacc. Read the comment docs.

@avrata
Copy link
Contributor

avrata commented Apr 16, 2021

Looks great! Thanks

@ssteinbach ssteinbach force-pushed the no_duplicate_manifest_loads branch from a291345 to 10b3def Compare April 23, 2021 19:27
- manifests could be listed with relative paths too, this makes all the
  paths absolute before checking them
- hard set it to use the __file__ attribute instead of relying on
  function to insert something meaningful.
@ssteinbach ssteinbach force-pushed the no_duplicate_manifest_loads branch from 143c105 to 44cfacc Compare May 1, 2021 00:19
@ssteinbach ssteinbach requested a review from meshula May 1, 2021 02:09
@meshula meshula merged commit 2f4a3c5 into AcademySoftwareFoundation:master May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants