oracle / oracle/oci-python-sdk

Add type annotations compatible with mypy/pyright

Open
#533 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

SDK
Dominant language
Python
Stars
474
Forks
321
Avg merge
23m
Merged PRs (30d)
4

Description

Hi, could you please add type annotations in the format which would mypy and/or pyright recognize?

I've tried both mypy/pyright and their stubgens, unfortunately, none of them is able to parse type annotations in format of (core/models/instance.py):

:param defined_tags:
    The value to assign to the defined_tags property of this Instance.
:type defined_tags: dict(str, dict(str, object))

It looks like, most of OCI SDK code is generated. If so, it should be possible to adopt generation process in order to support proper type annotations.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with core/models/instance.py and compare its :type defined_tags notation with the formats accepted by mypy and pyright. Then trace the generation process mentioned in the issue to determine where annotations are produced. Done means generated OCI SDK annotations can be parsed by mypy or pyright, including the defined_tags example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.