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

Remove support for Python 2 #1837

Merged
merged 7 commits into from
Dec 6, 2022
Merged

Remove support for Python 2 #1837

merged 7 commits into from
Dec 6, 2022

Conversation

cbentejac
Copy link
Contributor

@cbentejac cbentejac commented Dec 2, 2022

Description

This PR removes the support of Python 2.7 and early Python 3 (< 3.5) versions from Meshroom.

The continuous integration action rules are updated to only lint and test with Python 3.8. The requirements and installation documentation are updated accordingly.

All the workarounds used to support both Python 2.7 and Python 3 are removed. In particular, the "pyCompatibility" module and all references to it are deleted. Deprecation warnings highlighted by the unit tests are fixed.

Finally, Dockerfiles that are specific to Python 2 are removed, and build scripts that contain exclusive bits of code to handle Python 2 are updated to only refer to Python 3.

Features list

  • Remove support for Python 2.7 in the CI
  • Remove support for Python 2.7 and Python 3 (< 3.5) from the requirements and documentation
  • Remove all compatibility workarounds in Meshroom
  • Fix Python 3 deprecation warnings in the unit tests
  • Remove Dockerfiles that are specific to Python 2

@fabiencastan fabiencastan added this to the Meshroom 2022.1.0 milestone Dec 5, 2022
@cbentejac cbentejac force-pushed the dev/stopPython2Support branch from 8185426 to 5c3a803 Compare December 5, 2022 16:10
The compatibility with versions of Python older than 3.5 is not
maintained anymore.
- "pyCompatibility.basestring" are replaced by standard Python3 "str"
- "Sequence" and "Iterable" from "collections" are now directly imported
with "collections.abc"
In particular:
- In common/, remove the backport of weakref.WeakMethod
- In docs/ and ui/, use the standard FileNotFoundError class
- Use built-in open() instead of io.open(), and stop importing io
- In core/stats.py, use the standard implementation of xml.etree instead
of the C one
Regular expressions in regular strings generate deprecation warnings
with Python 3 ("invalid escape sequence \x"). To fix these warnings,
the regex must be contained within a raw string. For nodes that have
parameters whose description and/or value contain regex, the strings
are transformed into raw strings. In the case of descriptions, which are
generally written across several lines, regular strings are concatenated
with regular strings to preserve line returns (with "\n", which becomes
uneffective in raw strings).
@cbentejac cbentejac force-pushed the dev/stopPython2Support branch from 5c3a803 to 2c216b9 Compare December 5, 2022 16:20
@cbentejac cbentejac marked this pull request as ready for review December 5, 2022 16:30
@cbentejac cbentejac self-assigned this Dec 5, 2022
@fabiencastan fabiencastan changed the title Remove support for Python 2.7 Remove support for Python 2 Dec 6, 2022
@fabiencastan fabiencastan merged commit 67de413 into develop Dec 6, 2022
@fabiencastan fabiencastan deleted the dev/stopPython2Support branch December 6, 2022 09:18
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