Skip to content

Conversation

ssteinbach
Copy link
Collaborator

@ssteinbach ssteinbach commented Sep 26, 2022

Summary

Following the VFX platform, for which 2019 was the last version which included python 2.7 support, we are dropping python2.7 support starting with v0.16. This enables us to modernize the code base and remove a number of shims and bandaids.

Changes

  • Sets VFX platform supported years as 2022, 2021, and 2020
  • Removes Python2.7 support from the library
    • # python 2 blocks
    • version_info[0] < 3 blocks
    • try:...except ImportError:... blocks
  • Removes Python2.7 build matrix lines from CI/github actions
  • updates setup.py project metadata to drop 2.7 from versions
  • Removes shim code that was bridging differences between python3 and python2
  • modernizes to python3 patterns by running pyupgrade --py37-plus
    • makes a bunch of smaller changes, from visual inspection lots of "".format() -> f""

OTIOZ Note

We will follow this up with a PR proposing to change the ZIP_DEFLATED algorithm used by OTIOZ to use bzip2 or LZMA.

Closes #1395

@ssteinbach ssteinbach added this to the Public Beta 16 milestone Sep 26, 2022
@ssteinbach
Copy link
Collaborator Author

Review notes on a previous PR that I want to not lose track of: #1418 (comment)

Co-authored-by: Jean-Christophe Morin <[email protected]>
Signed-off-by: Stephan Steinbach <[email protected]>
@ssteinbach
Copy link
Collaborator Author

@JeanChristopheMorinPerso It looks like importlib.metadata is new in 3.8 - since we still have 3.7 on the list, I don't think we can use that quite yet.

@ssteinbach ssteinbach marked this pull request as ready for review September 26, 2022 22:28
@JeanChristopheMorinPerso
Copy link
Member

JeanChristopheMorinPerso commented Sep 26, 2022

@ssteinbach there is a backport on PyPI: https://pypi.org/project/importlib-metadata/. It's what I would call an official backport. Maybe we could use that?

@ssteinbach
Copy link
Collaborator Author

@JeanChristopheMorinPerso Ok got it. I think I'd like to split that out to a follow up PR.

Copy link
Member

@JeanChristopheMorinPerso JeanChristopheMorinPerso left a comment

Choose a reason for hiding this comment

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

Co-authored-by: Jean-Christophe Morin <[email protected]>
Signed-off-by: Stephan Steinbach <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2022

Codecov Report

Merging #1423 (944b791) into main (c5b1a8b) will increase coverage by 0.30%.
The diff coverage is 79.76%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1423      +/-   ##
==========================================
+ Coverage   86.08%   86.38%   +0.30%     
==========================================
  Files         201      201              
  Lines       21051    20860     -191     
  Branches     2461     2446      -15     
==========================================
- Hits        18121    18020     -101     
+ Misses       2328     2244      -84     
+ Partials      602      596       -6     
Flag Coverage Δ
py-unittests 86.38% <79.76%> (+0.30%) ⬆️

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

Impacted Files Coverage Δ
...melineio_contrib/adapters/extern_maya_sequencer.py 0.00% <0.00%> (ø)
...ntrib/opentimelineio_contrib/adapters/extern_rv.py 0.00% <0.00%> (ø)
.../opentimelineio_contrib/adapters/ffmpeg_burnins.py 0.00% <0.00%> (ø)
contrib/opentimelineio_contrib/adapters/rv.py 15.75% <0.00%> (ø)
...timelineio/opentimelineio/algorithms/track_algo.py 89.61% <ø> (ø)
...neio/opentimelineio/console/autogen_version_map.py 25.64% <0.00%> (ø)
...timelineio/opentimelineio/plugins/python_plugin.py 89.23% <ø> (ø)
...c/py-opentimelineio/opentimelineio/schema/stack.py 80.00% <0.00%> (+13.33%) ⬆️
tests/test_cdl.py 95.00% <ø> (ø)
tests/test_image_sequence_reference.py 97.57% <0.00%> (-0.03%) ⬇️
... and 56 more

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 c5b1a8b...944b791. Read the comment docs.

@ssteinbach
Copy link
Collaborator Author

@ssteinbach
Copy link
Collaborator Author

Hm, I'm not sure why collections.abc classes are throwing Sphinx off, or why they're creeping into the doc build?

@JeanChristopheMorinPerso
Copy link
Member

@ssteinbach I guess you found the issue (the extra ())?

…mat.py

Co-authored-by: Jean-Christophe Morin <[email protected]>
Signed-off-by: Stephan Steinbach <[email protected]>
@ssteinbach ssteinbach requested a review from meshula September 29, 2022 18:12
Copy link
Member

@JeanChristopheMorinPerso JeanChristopheMorinPerso left a comment

Choose a reason for hiding this comment

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

I re-reviewed everything and it looks good to me!

I'll just ask a question again because I think it kind of got lost. Should we replace the next methods for __next__? For example https://github.com/AcademySoftwareFoundation/OpenTimelineIO/blob/main/src/py-opentimelineio/opentimelineio-bindings/otio_serializableObjects.cpp#L247. I think it would be a good idea but can well be push to another PR since this PR is starting to be pretty big.

@ssteinbach
Copy link
Collaborator Author

Lets do that in a follow up PR. I'm not quite clear on what it means for the implementation, so I'd like to do that separately to test it

@ssteinbach
Copy link
Collaborator Author

Ok this looks good. The two follow up from this:

@ssteinbach ssteinbach merged commit 41ceb58 into AcademySoftwareFoundation:main Sep 29, 2022
@ssteinbach ssteinbach deleted the main.drop_py27 branch September 29, 2022 21:28
MichaelPlug pushed a commit to MichaelPlug/OpenTimelineIO that referenced this pull request Aug 5, 2023
* Sets VFX platform supported years as 2022, 2021, and 2020
* Removes Python2.7 support from the library
* Removes Python2.7 build matrix lines from CI/github actions
* updates setup.py project metadata to drop 2.7 from versions
* modernizes to python3 patterns by running pyupgrade --py37-plus

Signed-off-by: Stephan Steinbach <[email protected]>
Co-authored-by: ssteinbach <[email protected]>
Co-authored-by: Jean-Christophe Morin <[email protected]>
Signed-off-by: Michele Spina <[email protected]>
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.

Drop Python2.7 support
4 participants