Python开发所需的最新工具
项目描述
Python开发所需的最新工具 (进行中)
支持的Python版本:与经典Python解释器(CPython)相同
文档
完整文档可在 https://python-dev-tools.readthedocs.io 阅读。
安装
在终端中运行
$ python3 -m pip install python-dev-tools --user --upgrade
安装完整文档: https://python-dev-tools.readthedocs.io/en/latest/installation.html
就这样!在适用的情况下,使用提供的linter(flake8)、formatter(whataformatter)和precommit钩子(TODO)。
Visual Studio Code中的安装
遵循python-dev-tools的安装程序
确保在VS Code中安装了官方Python扩展
从您的活动虚拟环境中打开VS Code(实际上,确保python-dev-tools中的flake8在您的PYTHON_PATH中)
在VS Code中,打开设置(按F1键,然后输入“打开设置(JSON)”,然后输入)
在打开的JSON文件中添加(在关闭的}之前)
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.flake8Path": "flake8",
"python.formatting.provider": "black",
"python.formatting.blackPath": "whataformatter",
"python.formatting.blackArgs": [],
功能
集成常用工具的功能。此包提供了开发Python软件所需的常用依赖项。
简单的代码检查器
flake8 a_python_file.py 对a_python_file.py进行代码检查
基于flake8和插件:https://gitlab.com/pycqa/flake8
flake8-2020: https://github.com/asottile/flake8-2020
flake8-aaa: https://github.com/jamescooke/flake8-aaa
flake8-annotations: https://github.com/sco1/flake8-annotations
flake8-annotations-complexity: https://github.com/best-doctor/flake8-annotations-complexity
flake8-annotations-coverage: https://github.com/best-doctor/flake8-annotations-coverage
flake8-bandit: https://github.com/tylerwince/flake8-bandit
flake8-blind-except: https://github.com/elijahandrews/flake8-blind-except
flake8-breakpoint: https://github.com/afonasev/flake8-breakpoint
flake8-broken-line: https://github.com/sobolevn/flake8-broken-line
flake8-bugbear: https://github.com/PyCQA/flake8-bugbear
flake8-builtins: https://github.com/gforcada/flake8-builtins
flake8-class-attributes-order: https://github.com/best-doctor/flake8-class-attributes-order
flake8-coding: https://github.com/tk0miya/flake8-coding
flake8-cognitive-complexity: https://github.com/Melevir/flake8-cognitive-complexity
flake8-comments: https://github.com/orsinium-labs/flake8-comments
flake8-comprehensions: https://github.com/adamchainz/flake8-comprehensions
flake8-debugger: https://github.com/JBKahn/flake8-debugger
flake8-django: https://github.com/rocioar/flake8-django
flake8-docstrings: https://gitlab.com/pycqa/flake8-docstrings
flake8-encoding: https://github.com/python-formate/flake8-encodings
flake8-eradicate: https://github.com/sobolevn/flake8-eradicate
flake8-executable: https://github.com/xuhdev/flake8-executable
flake8-expression-complexity: https://pypi.ac.cn/project/flake8-expression-complexity/
flake8-fastapi: https://pypi.ac.cn/project/flake8-fastapi/
flake8-fixme: https://github.com/tommilligan/flake8-fixme
flake8-functions: https://github.com/best-doctor/flake8-functions
flake8-functions-names: https://github.com/Melevir/flake8-functions-names
flake8-future-annotations: https://github.com/tyleryep/flake8-future-annotations
flake8-isort: https://github.com/gforcada/flake8-isort
flake8-literal: https://github.com/plinss/flake8-literal
flake8-logging-format: https://github.com/globality-corp/flake8-logging-format
flake8-markdown: https://github.com/johnfraney/flake8-markdown
flake8-mutable: https://github.com/ebeweber/flake8-mutable
flake8-no-pep420: https://github.com/adamchainz/flake8-no-pep420
flake8-noqa: https://pypi.ac.cn/project/flake8-noqa/
flake8-pie: https://github.com/sbdchd/flake8-pie
flake8-pylint: https://github.com/orsinium-labs/flake8-pylint
flake8-pyi: https://github.com/PyCQA/flake8-pyi
flake8-pytest-style: https://github.com/m-burst/flake8-pytest-style
flake8-quotes: https://github.com/zheller/flake8-quotes/
flake8-rst-docstrings: https://github.com/peterjc/flake8-rst-docstrings
flake8-secure-coding-standard: https://github.com/Takishima/flake8-secure-coding-standard
flake8-simplify: https://github.com/MartinThoma/flake8-simplify
flake8-slots: https://github.com/python-formate/flake8-slots
flake8-string-format: https://github.com/xZise/flake8-string-format
flake8-tidy-imports: https://github.com/adamchainz/flake8-tidy-imports
flake8-typing-imports: https://github.com/asottile/flake8-typing-imports
flake8-use-fstring: https://github.com/MichaelKim0407/flake8-use-fstring
flake8-use-pathlib: https://gitlab.com/RoPP/flake8-use-pathlib
flake8-useless-assert: https://github.com/decorator-factory/flake8-useless-assert
flake8-variables-names: https://github.com/best-doctor/flake8-variables-names
flake8-warnings: https://github.com/orsinium-labs/flake8-warnings
pandas-vet: https://github.com/deppen8/pandas-vet
pep8-naming: https://github.com/PyCQA/pep8-naming
wemake-python-styleguide: https://github.com/wemake-services/wemake-python-styleguide
简单格式化器
whataformatter a_python_file.py 格式化 a_python_file.py
基于
autoflake: https://github.com/myint/autoflake
docformatter: https://github.com/PyCQA/docformatter
pybetter: https://github.com/lensvol/pybetter
pyupgrade: https://github.com/asottile/pyupgrade
removestar: https://github.com/asmeurer/removestar
简单precommit钩子
TODO
许可证
BSD 3-Clause许可证,欢迎贡献: https://python-dev-tools.readthedocs.io/en/latest/contributing.html。
TODO
flake8格式化器,用于向警告信息添加URL
文档
precommit(flake8,mypy)
变更日志
2023.3.24
需要Python3.8.1+
升级到 flake8 5(大多数插件对 flake8 6 不可用)
添加 flake8-fastapi 检查器
2022.5.27
添加 flake8-aaa 检查器
添加 flake8-blind-except 检查器
添加 flake8-breakpoint 检查器
添加 flake8-class-attributes-order 检查器
添加 flake8-cognitive-complexity 检查器
添加 flake8-coding 检查器
添加 flake8-comments 检查器
添加 flake8-django 检查器
添加 flake8-encoding 检查器
添加 flake8-executable 检查器
添加 flake8-functions-names 检查器
添加 flake8-future-annotations 检查器
添加 flake8-literal 检查器
添加 flake8-markdown 检查器
添加 flake8-noqa 检查器
添加 flake8-no-pep420 检查器
添加 flake8-pie 检查器
添加 flake8-pyi 检查器
添加 flake8-pylint 检查器
添加 flake8-secure-coding-standard 检查器
添加 flake8-slots 检查器
添加 flake8-use-pathlib 检查器
添加 flake8-useless-assert 检查器
添加 flake8-warnings 检查器
添加 pandas-vet 检查器
2022.5.26
添加 docformatter 格式化器
添加 isort 格式化器
添加 pybetter 格式化器
添加 pycln 格式化器
添加 removestar 格式化器
添加 ssort 格式化器
移除 cohesion 检查器(在纯数据类如 NamedTuple 上产生错误警告)
2022.5.20
添加 cohesion 检查器
添加 dlint 检查器
添加 flake8-annotations 检查器
添加 flake8-annotations-complexity 检查器
添加 flake8-annotations-coverage 检查器
添加 flake8-black 检查器
添加 flake8-expression-complexity 检查器
添加 flake8-functions 检查器
添加 flake8-pytest-style 检查器
添加 flake8-simplify 检查器
添加 flake8-tidy-imports 检查器
添加 flake8-typing-imports 检查器
添加 flake8-use-fstring 检查器
移除已弃用的 flake8-commas 检查器
修复 whataformatter 并添加 --target-version 选项以兼容 VS Code
2020.9.10
提供给 whatalinter 的路径可以是目录之一(递归搜索 Python 文件)
2020.9.7
为与 black 兼容,从 flake8 中移除 E203
2020.9.4
添加 whatalinter_vscode 以实现 Visual Studio Code 集成
2020.9.2
移除 wemake-python-styleguide 的一些警告,例如允许 f-strings
2020.9.1
使用 poetry
移除冗余的检查器
将最大行长度更改为 88(black 的默认值)
将 pydocstyle 替换为 flake8-docstrings
添加 wemake-python-styleguide
2019.10.22
添加 flake8-2020 检查器
2019.07.21
为 VS Code 兼容性,向 whataformatter 添加 --quiet 和 --diff 标志
2019.07.20
添加 black 格式化器
添加 autoflake 格式化器
添加 pyupgrade 格式化器
2019.04.08
添加 flake8 检查器
添加 flake8-isort 代码检查器
添加 pep8-naming 代码检查器
添加 flake8-comprehensions 代码检查器
添加 flake8-logging-format 代码检查器
添加 flake8-bugbear 代码检查器
添加 flake8-builtins 代码检查器
添加 flake8-broken-line 代码检查器
添加 flake8-fixme 代码检查器
添加 flake8-mutable 代码检查器
添加 flake8-debugger 代码检查器
添加 flake8-variables-names 代码检查器
添加 flake8-bandit 代码检查器
2019.03.02
添加 pydocstyle 代码检查器
2019.03.01
添加 McCabe 复杂性检查器
2019.02.26
添加 pyflakes 代码检查器
添加 pycodestyle 代码检查器
2019.02.23
首次发布于 PyPI。
项目详情
下载文件
下载适合您平台文件。如果您不确定选择哪个,请了解更多关于 安装软件包 的信息。
源代码分发
构建的发行版
python_dev_tools-2023.3.24.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | cf9446fd4ffd98bdc811baa05a102966240785e5f41da33d2a20dbeab8e4aec9 |
|
MD5 | 44350564ca2cd59690b76d13736b52df |
|
BLAKE2b-256 | fc95006e7e12c861b66407cf9dc582ee7b522b39cbfaa4ac5f8a8df0f28aca8d |
python_dev_tools-2023.3.24-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 47b8cad21d64585bcbb49ec75b260172ba7b6eb059e3246ef258729e77ee72f9 |
|
MD5 | 40a2c6a78113dcd36e001618e2602bfc |
|
BLAKE2b-256 | 6029f36d04f47dc43930671469ce9a345f1c8f6e61facabfb92ed72a79331eae |