Skip to content

Use recommended python3.6 APIs and document 3.7 upgrades - #4134

Merged
phoenix-meadowlark merged 4 commits into
iree-org:mainfrom
phoenix-meadowlark:document-pyversion
Dec 9, 2020
Merged

phoenix-meadowlark merged 4 commits into
iree-org:mainfrom
phoenix-meadowlark:document-pyversion

Conversation

@phoenix-meadowlark

Copy link
Copy Markdown
Contributor

Note: It's probably easiest to review each commit separately.

Changes:

  • Remove remaining %-string substitutions (absl.logging excluded).
  • Replace all subprocess.check_* calls with the recommended subprocess.run(check=True,...).
  • Add TODO(Code upgrades for python >= 3.7 #4131) for the following:
    • python>=3.7: Use postponed type annotations.
    • python>=3.7: Consider using a dataclass.
    • python>=3.7: Use capture_output=True.
    • python>=3.7: Replace 'universal_newlines' with 'text'.
    • python>=3.7: Remove redundant OrderedDict.

@phoenix-meadowlark phoenix-meadowlark added infrastructure Relating to build systems, CI, or testing integrations/tensorflow TensorFlow model import and conversion bindings/python Python wrapping IREE's C API labels Dec 8, 2020
@google-cla google-cla Bot added the cla: yes label Dec 8, 2020
# See the License for the specific language governing permissions and
# limitations under the License.

# TODO(#4131) python>=3.7: Use postponed type annotations.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this comment applicable everywhere? It doesn't necessarily seem super useful to have the TODO listed everywhere as opposed to just listing it in the issue.

@phoenix-meadowlark phoenix-meadowlark Dec 9, 2020 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It only affects files with cases like the following

class ReferenceSelf

  @staticmethod
  def clone(self) -> "ReferenceSelf"
    pass

and BackendInfo (which can't be defined before it's used in *CompiledModule because it stores the *CompiledModule classes on its cls).

@phoenix-meadowlark
phoenix-meadowlark merged commit 01b507d into iree-org:main Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bindings/python Python wrapping IREE's C API infrastructure Relating to build systems, CI, or testing integrations/tensorflow TensorFlow model import and conversion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants