paddlepaddle-stubs


Namepaddlepaddle-stubs JSON
Version 3.0.0a1 PyPI version JSON
download
home_pagehttps://github.com/cattidea/paddlepaddle-stubs
SummaryA stubs package as described in PEP 561 for PaddlePaddle
upload_time2024-03-24 20:15:56
maintainerNone
docs_urlNone
authorNyakku Shigure
requires_python<4.0.0,>=3.8.0
licenseMIT
keywords pep 561 pep 484 type hints paddlepaddle
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PaddlePaddle Stubs <sup>WIP</sup>

A stubs package as described in [PEP 561](https://peps.python.org/pep-0561/) for [PaddlePaddle](https://github.com/PaddlePaddle/Paddle).

<p align="center">
   <a href="https://python.org/" target="_blank"><img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/paddlepaddle-stubs?logo=python&style=flat-square"></a>
   <a href="https://pypi.org/project/paddlepaddle-stubs/" target="_blank"><img src="https://img.shields.io/pypi/v/paddlepaddle-stubs?style=flat-square" alt="pypi"></a>
   <a href="https://pypi.org/project/paddlepaddle-stubs/" target="_blank"><img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/paddlepaddle-stubs?style=flat-square"></a>
   <a href="LICENSE"><img alt="LICENSE" src="https://img.shields.io/github/license/cattidea/paddlepaddle-stubs?style=flat-square"></a>
   <a href="https://github.com/astral-sh/ruff"><img alt="ruff" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&style=flat-square"></a>
   <a href="https://gitmoji.dev"><img src="https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67?style=flat-square" alt="Gitmoji"></a>
</p>

目前仅针对 [Pyright](https://github.com/microsoft/pyright) 进行了编写和测试,尚未支持 [Mypy](https://github.com/python/mypy)(Mypy 相对于 Pyright 太难用了,缺失功能太多),因此目前可能仅仅与 VS Code 的 Pylance 扩展一起工作良好~

> [!NOTE]
>
> 本 repo 非运行时库,因此本 repo 中所有示例和单测可能在运行时并不能正常运行,仅仅是为了更加全面和方便对类型进行检查而已。

## Usage

```bash
pip install paddlepaddle-stubs --pre
```

此时再打开编辑器,查看编辑器的类型提示~~~

VS Code 推荐配置:

```jsonc
{
   "python.languageServer": "Pylance",
   // 现在有一些类型在 strict mode 工作的并不是很好,推荐先使用 basic mode
   "python.analysis.typeCheckingMode": "basic",
   "python.analysis.inlayHints.functionReturnTypes": true,
   "python.analysis.inlayHints.variableTypes": true,
}
```

## Status

起步阶段,最低支持 Python 3.8,目前基于 PaddlePaddle 2.3.1 开发,第一个可用版本应当是 2.3.1 版本或者更晚的 2.4 版本~

## Roadmap

See [paddlepaddle-stubs 2.3.1 Roadmap](https://github.com/orgs/cattidea/projects/3)

### 2.4.0 alpha

> **Note**
>
> 此时本 repo 可 public,并发布到 PyPI

-  [x] 通过 basic mode 的类型检查
-  [x] 完善全部 P1 级别的类型信息(strict 下工作良好)

### 2.4.0 beta

-  [ ] 完善全部 P2 级别的类型信息(strict 下工作良好)
-  [ ] [官网示例高层 API 搭建 MNIST 示例代码](./examples/mnist_example.py)在 strict 模式下工作良好

### Future

之后应该是一边升级到新版本(2.4.0),一边继续完善 P3、P4、P5 级别的类型信息(strict 下工作良好)

要添加的还有很多,各个 API 类型信息需要仔细填写(修改自动生成的 `Any`,添加返回值类型),有兴趣的小伙伴可以一起来参与呀~


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cattidea/paddlepaddle-stubs",
    "name": "paddlepaddle-stubs",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0.0,>=3.8.0",
    "maintainer_email": null,
    "keywords": "PEP 561, PEP 484, Type Hints, PaddlePaddle",
    "author": "Nyakku Shigure",
    "author_email": "sigure.qaq@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/77/71/976fae6e2959b182d68d6904ae47709c517220fe7db91703e92c46850bb8/paddlepaddle_stubs-3.0.0a1.tar.gz",
    "platform": null,
    "description": "# PaddlePaddle Stubs <sup>WIP</sup>\n\nA stubs package as described in [PEP 561](https://peps.python.org/pep-0561/) for [PaddlePaddle](https://github.com/PaddlePaddle/Paddle).\n\n<p align=\"center\">\n   <a href=\"https://python.org/\" target=\"_blank\"><img alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/paddlepaddle-stubs?logo=python&style=flat-square\"></a>\n   <a href=\"https://pypi.org/project/paddlepaddle-stubs/\" target=\"_blank\"><img src=\"https://img.shields.io/pypi/v/paddlepaddle-stubs?style=flat-square\" alt=\"pypi\"></a>\n   <a href=\"https://pypi.org/project/paddlepaddle-stubs/\" target=\"_blank\"><img alt=\"PyPI - Downloads\" src=\"https://img.shields.io/pypi/dm/paddlepaddle-stubs?style=flat-square\"></a>\n   <a href=\"LICENSE\"><img alt=\"LICENSE\" src=\"https://img.shields.io/github/license/cattidea/paddlepaddle-stubs?style=flat-square\"></a>\n   <a href=\"https://github.com/astral-sh/ruff\"><img alt=\"ruff\" src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&style=flat-square\"></a>\n   <a href=\"https://gitmoji.dev\"><img src=\"https://img.shields.io/badge/gitmoji-%20\ud83d\ude1c%20\ud83d\ude0d-FFDD67?style=flat-square\" alt=\"Gitmoji\"></a>\n</p>\n\n\u76ee\u524d\u4ec5\u9488\u5bf9 [Pyright](https://github.com/microsoft/pyright) \u8fdb\u884c\u4e86\u7f16\u5199\u548c\u6d4b\u8bd5\uff0c\u5c1a\u672a\u652f\u6301 [Mypy](https://github.com/python/mypy)\uff08Mypy \u76f8\u5bf9\u4e8e Pyright \u592a\u96be\u7528\u4e86\uff0c\u7f3a\u5931\u529f\u80fd\u592a\u591a\uff09\uff0c\u56e0\u6b64\u76ee\u524d\u53ef\u80fd\u4ec5\u4ec5\u4e0e VS Code \u7684 Pylance \u6269\u5c55\u4e00\u8d77\u5de5\u4f5c\u826f\u597d\uff5e\n\n> [!NOTE]\n>\n> \u672c repo \u975e\u8fd0\u884c\u65f6\u5e93\uff0c\u56e0\u6b64\u672c repo \u4e2d\u6240\u6709\u793a\u4f8b\u548c\u5355\u6d4b\u53ef\u80fd\u5728\u8fd0\u884c\u65f6\u5e76\u4e0d\u80fd\u6b63\u5e38\u8fd0\u884c\uff0c\u4ec5\u4ec5\u662f\u4e3a\u4e86\u66f4\u52a0\u5168\u9762\u548c\u65b9\u4fbf\u5bf9\u7c7b\u578b\u8fdb\u884c\u68c0\u67e5\u800c\u5df2\u3002\n\n## Usage\n\n```bash\npip install paddlepaddle-stubs --pre\n```\n\n\u6b64\u65f6\u518d\u6253\u5f00\u7f16\u8f91\u5668\uff0c\u67e5\u770b\u7f16\u8f91\u5668\u7684\u7c7b\u578b\u63d0\u793a\uff5e\uff5e\uff5e\n\nVS Code \u63a8\u8350\u914d\u7f6e\uff1a\n\n```jsonc\n{\n   \"python.languageServer\": \"Pylance\",\n   // \u73b0\u5728\u6709\u4e00\u4e9b\u7c7b\u578b\u5728 strict mode \u5de5\u4f5c\u7684\u5e76\u4e0d\u662f\u5f88\u597d\uff0c\u63a8\u8350\u5148\u4f7f\u7528 basic mode\n   \"python.analysis.typeCheckingMode\": \"basic\",\n   \"python.analysis.inlayHints.functionReturnTypes\": true,\n   \"python.analysis.inlayHints.variableTypes\": true,\n}\n```\n\n## Status\n\n\u8d77\u6b65\u9636\u6bb5\uff0c\u6700\u4f4e\u652f\u6301 Python 3.8\uff0c\u76ee\u524d\u57fa\u4e8e PaddlePaddle 2.3.1 \u5f00\u53d1\uff0c\u7b2c\u4e00\u4e2a\u53ef\u7528\u7248\u672c\u5e94\u5f53\u662f 2.3.1 \u7248\u672c\u6216\u8005\u66f4\u665a\u7684 2.4 \u7248\u672c\uff5e\n\n## Roadmap\n\nSee [paddlepaddle-stubs 2.3.1 Roadmap](https://github.com/orgs/cattidea/projects/3)\n\n### 2.4.0 alpha\n\n> **Note**\n>\n> \u6b64\u65f6\u672c repo \u53ef public\uff0c\u5e76\u53d1\u5e03\u5230 PyPI\n\n-  [x] \u901a\u8fc7 basic mode \u7684\u7c7b\u578b\u68c0\u67e5\n-  [x] \u5b8c\u5584\u5168\u90e8 P1 \u7ea7\u522b\u7684\u7c7b\u578b\u4fe1\u606f\uff08strict \u4e0b\u5de5\u4f5c\u826f\u597d\uff09\n\n### 2.4.0 beta\n\n-  [ ] \u5b8c\u5584\u5168\u90e8 P2 \u7ea7\u522b\u7684\u7c7b\u578b\u4fe1\u606f\uff08strict \u4e0b\u5de5\u4f5c\u826f\u597d\uff09\n-  [ ] [\u5b98\u7f51\u793a\u4f8b\u9ad8\u5c42 API \u642d\u5efa MNIST \u793a\u4f8b\u4ee3\u7801](./examples/mnist_example.py)\u5728 strict \u6a21\u5f0f\u4e0b\u5de5\u4f5c\u826f\u597d\n\n### Future\n\n\u4e4b\u540e\u5e94\u8be5\u662f\u4e00\u8fb9\u5347\u7ea7\u5230\u65b0\u7248\u672c\uff082.4.0\uff09\uff0c\u4e00\u8fb9\u7ee7\u7eed\u5b8c\u5584 P3\u3001P4\u3001P5 \u7ea7\u522b\u7684\u7c7b\u578b\u4fe1\u606f\uff08strict \u4e0b\u5de5\u4f5c\u826f\u597d\uff09\n\n\u8981\u6dfb\u52a0\u7684\u8fd8\u6709\u5f88\u591a\uff0c\u5404\u4e2a API \u7c7b\u578b\u4fe1\u606f\u9700\u8981\u4ed4\u7ec6\u586b\u5199\uff08\u4fee\u6539\u81ea\u52a8\u751f\u6210\u7684 `Any`\uff0c\u6dfb\u52a0\u8fd4\u56de\u503c\u7c7b\u578b\uff09\uff0c\u6709\u5174\u8da3\u7684\u5c0f\u4f19\u4f34\u53ef\u4ee5\u4e00\u8d77\u6765\u53c2\u4e0e\u5440\uff5e\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A stubs package as described in PEP 561 for PaddlePaddle",
    "version": "3.0.0a1",
    "project_urls": {
        "Homepage": "https://github.com/cattidea/paddlepaddle-stubs",
        "Repository": "https://github.com/cattidea/paddlepaddle-stubs"
    },
    "split_keywords": [
        "pep 561",
        " pep 484",
        " type hints",
        " paddlepaddle"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "34bad79ca4489d9b59fb8cf50af8504b549c5cd08ec7538e95451379a245977f",
                "md5": "d91b9fb739affb3b253579849e1fd093",
                "sha256": "1cbd5728da68baf3e92340bc8a8c2b2b43c88b2553f471f2f24c4651abbe607d"
            },
            "downloads": -1,
            "filename": "paddlepaddle_stubs-3.0.0a1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d91b9fb739affb3b253579849e1fd093",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0.0,>=3.8.0",
            "size": 346214,
            "upload_time": "2024-03-24T20:15:55",
            "upload_time_iso_8601": "2024-03-24T20:15:55.387860Z",
            "url": "https://files.pythonhosted.org/packages/34/ba/d79ca4489d9b59fb8cf50af8504b549c5cd08ec7538e95451379a245977f/paddlepaddle_stubs-3.0.0a1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7771976fae6e2959b182d68d6904ae47709c517220fe7db91703e92c46850bb8",
                "md5": "004df2e8fc682cc5ee71e63f5d8653e0",
                "sha256": "aa0582c58585c0f5312cde1a639851171a9cbc82f2568a26af8f60da37b91304"
            },
            "downloads": -1,
            "filename": "paddlepaddle_stubs-3.0.0a1.tar.gz",
            "has_sig": false,
            "md5_digest": "004df2e8fc682cc5ee71e63f5d8653e0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0.0,>=3.8.0",
            "size": 151680,
            "upload_time": "2024-03-24T20:15:56",
            "upload_time_iso_8601": "2024-03-24T20:15:56.795010Z",
            "url": "https://files.pythonhosted.org/packages/77/71/976fae6e2959b182d68d6904ae47709c517220fe7db91703e92c46850bb8/paddlepaddle_stubs-3.0.0a1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-24 20:15:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cattidea",
    "github_project": "paddlepaddle-stubs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "paddlepaddle-stubs"
}
        
Elapsed time: 0.20811s