diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..6dddafe --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,36 @@ +# 贡献指南 + +非常感谢你愿意为 PySide6-Code-Tutorial 项目提供贡献,请阅读以下内容,遵守一些基本规则,以便项目保持良好状态快速发展。 + +## 开始编码之前 + +如果你准备对代码进行超过数十行的修改或新增,我强烈建议你先提交一个 issue,谈谈你想实现的东西。在投入很多精力之前,我们应该先讨论一下是否要这样做,也可以确保我们不重复工作。 + +## 编写代码 + +### 准备开发环境 + +开发环境相较于使用环境较为复杂,确保已经安装 Python 3.11+ 和 [Poetry](https://python-poetry.org/docs/#installation),然后通过 Poetry 创建和安装开发环境: + +```shell +cd PySide6-Code-Tutorial +poetry init +poetry install +``` + +还需要通过 [pre-commit](https://pre-commit.com/) 安装 git 钩子: + +```shell +pre-commit install +``` + +### 代码风格 + +- 总体来讲,新增和修改的代码应接近原有代码的风格。尽量使代码有良好的可读性。 +- 请使用 [Black](https://black.readthedocs.io/en/stable/) 格式化代码,确保所有代码风格与项目一致。开发环境中已经安装了 Black,配置使用方法可以参考[这篇文章](https://muzing.top/posts/a29e4743/)。 +- 请为代码添加充分的[类型注解](https://muzing.top/posts/84a8da1c/),并能通过 [mypy](https://mypy.readthedocs.io/en/stable/) 检查不报错。 +- 请为模块、类、函数/方法、属性等添加 docstring 或注释,确保含义清晰易读。 + +## 拉取请求 + +新建一个指向 [muziing/PySide6-Code-Tutorial](https://github.com/muziing/PySide6-Code-Tutorial) 的 `main` 分支的拉取请求,我将尽快 review 代码并给出反馈。 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..41549df --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,22 @@ +fail_fast: false + +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-toml + - id: check-yaml + - id: trailing-whitespace + - id: end-of-file-fixer + +- repo: https://github.com/psf/black + rev: 24.2.0 + hooks: + - id: black + args: [--config, "./pyproject.toml"] + +- repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + args: [--settings-path, "./pyproject.toml"] diff --git "a/01-HelloWorld-\345\237\272\346\234\254\347\273\223\346\236\204/01-HelloWorld-\347\254\254\344\270\200\344\270\252PySide6\347\250\213\345\272\217.py" "b/01-HelloWorld-\345\237\272\346\234\254\347\273\223\346\236\204/01-HelloWorld-\347\254\254\344\270\200\344\270\252PySide6\347\250\213\345\272\217.py" index ce51959..c5ac625 100644 --- "a/01-HelloWorld-\345\237\272\346\234\254\347\273\223\346\236\204/01-HelloWorld-\347\254\254\344\270\200\344\270\252PySide6\347\250\213\345\272\217.py" +++ "b/01-HelloWorld-\345\237\272\346\234\254\347\273\223\346\236\204/01-HelloWorld-\347\254\254\344\270\200\344\270\252PySide6\347\250\213\345\272\217.py" @@ -37,7 +37,9 @@ def magic(self) -> None: if __name__ == "__main__": - app = QtWidgets.QApplication(sys.argv) # 创建APP,将运行脚本时(可能的)的其他参数传给Qt以初始化 + app = QtWidgets.QApplication( + sys.argv + ) # 创建APP,将运行脚本时(可能的)的其他参数传给Qt以初始化 widget = MyWidget() # 实例化一个MyWidget类对象 widget.show() # 显示窗口 sys.exit(app.exec()) # 正常退出APP:app.exec()关闭app,sys.exit()退出进程 diff --git "a/01-HelloWorld-\345\237\272\346\234\254\347\273\223\346\236\204/03-\347\261\273\347\232\204\347\273\247\346\211\277\345\205\263\347\263\273.py" "b/01-HelloWorld-\345\237\272\346\234\254\347\273\223\346\236\204/03-\347\261\273\347\232\204\347\273\247\346\211\277\345\205\263\347\263\273.py" index 9002f28..46669f2 100644 --- "a/01-HelloWorld-\345\237\272\346\234\254\347\273\223\346\236\204/03-\347\261\273\347\232\204\347\273\247\346\211\277\345\205\263\347\263\273.py" +++ "b/01-HelloWorld-\345\237\272\346\234\254\347\273\223\346\236\204/03-\347\261\273\347\232\204\347\273\247\346\211\277\345\205\263\347\263\273.py" @@ -5,7 +5,7 @@ def get_sub_classes(class_): """递归地显示某一类的所有子类""" for subclass in class_.__subclasses__(): print(subclass) - if len(class_.__subclasses__()) > 0: + if len(subclass.__subclasses__()) > 0: get_sub_classes(subclass) diff --git "a/02-QtCore-\351\235\236GUI\347\232\204\346\240\270\345\277\203\345\212\237\350\203\275/01-The_Meta-Object_System-\345\205\203\345\257\271\350\261\241\347\263\273\347\273\237.md" "b/02-QtCore-\351\235\236GUI\347\232\204\346\240\270\345\277\203\345\212\237\350\203\275/01-The_Meta-Object_System-\345\205\203\345\257\271\350\261\241\347\263\273\347\273\237.md" index ef2a6f0..f3d24e8 100644 --- "a/02-QtCore-\351\235\236GUI\347\232\204\346\240\270\345\277\203\345\212\237\350\203\275/01-The_Meta-Object_System-\345\205\203\345\257\271\350\261\241\347\263\273\347\273\237.md" +++ "b/02-QtCore-\351\235\236GUI\347\232\204\346\240\270\345\277\203\345\212\237\350\203\275/01-The_Meta-Object_System-\345\205\203\345\257\271\350\261\241\347\263\273\347\273\237.md" @@ -74,6 +74,6 @@ if (QLabel label = QLabel (obj)) { label.setText(tr("Ping")) ------ -© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the [GNU Free Documentation License version 1.3](https://www.gnu.org/licenses/fdl-1.3.html) as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. +© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the [GNU Free Documentation License version 1.3](https://www.gnu.org/licenses/fdl-1.3.html) as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. © 2022 zh_CN Translation by muzing\. diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/01-QWidget-\346\216\247\344\273\266\347\232\204\345\237\272\347\261\273/09-QWidget-\351\224\256\347\233\230\350\276\223\345\205\245\347\204\246\347\202\271-2.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/01-QWidget-\346\216\247\344\273\266\347\232\204\345\237\272\347\261\273/09-QWidget-\351\224\256\347\233\230\350\276\223\345\205\245\347\204\246\347\202\271-2.py" index 7d0e4f3..991b21b 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/01-QWidget-\346\216\247\344\273\266\347\232\204\345\237\272\347\261\273/09-QWidget-\351\224\256\347\233\230\350\276\223\345\205\245\347\204\246\347\202\271-2.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/01-QWidget-\346\216\247\344\273\266\347\232\204\345\237\272\347\261\273/09-QWidget-\351\224\256\347\233\230\350\276\223\345\205\245\347\204\246\347\202\271-2.py" @@ -1,8 +1,3 @@ -import sys - -from PySide6 import QtWidgets -from PySide6.QtCore import Qt - """ QWidget 键盘输入焦点控制 @@ -14,7 +9,7 @@ https://doc.qt.io/qt-6/qwidget.html#setFocusProxy .setFocusPolicy(policy: Qt.FocusPolicy) 设置焦点策略,详见下方Qt.FocusPolicy -.focusPolicy() -> Qt.FocusPolicy 返回该控件的焦点策略 +.focusPolicy() -> Qt.FocusPolicy 返回该控件的焦点策略 Qt.FocusPolicy 具体分为如下数种: https://doc.qt.io/qt-6/qt.html#FocusPolicy-enum @@ -32,6 +27,11 @@ """ +import sys + +from PySide6 import QtWidgets +from PySide6.QtCore import Qt + class MyWidget(QtWidgets.QWidget): def __init__(self, *args, **kwargs): diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/01-QWidget-\346\216\247\344\273\266\347\232\204\345\237\272\347\261\273/10-QWidget-\345\205\211\346\240\207.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/01-QWidget-\346\216\247\344\273\266\347\232\204\345\237\272\347\261\273/10-QWidget-\345\205\211\346\240\207.py" index 9c286a6..8e84f4d 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/01-QWidget-\346\216\247\344\273\266\347\232\204\345\237\272\347\261\273/10-QWidget-\345\205\211\346\240\207.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/01-QWidget-\346\216\247\344\273\266\347\232\204\345\237\272\347\261\273/10-QWidget-\345\205\211\346\240\207.py" @@ -57,7 +57,9 @@ def test_01(self) -> None: # 设置为自定义图案光标 pixmap = QtGui.QPixmap("../../Resources/Icons/snowflake_128px.ico").scaled(52, 52) - my_cursor = QtGui.QCursor(pixmap, 26, 26) # 以图片像素点位置26,26为热点(光标实际所在位置坐标) + my_cursor = QtGui.QCursor( + pixmap, 26, 26 + ) # 以图片像素点位置26,26为热点(光标实际所在位置坐标) self.setCursor(my_cursor) # 设置label中的光标为Qt内置的其他光标 diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/02-Button-\346\214\211\351\222\256\346\216\247\344\273\266/04-QCheckBox-\345\244\215\351\200\211\346\241\206/03-QCheckBox-\344\277\241\345\217\267.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/02-Button-\346\214\211\351\222\256\346\216\247\344\273\266/04-QCheckBox-\345\244\215\351\200\211\346\241\206/03-QCheckBox-\344\277\241\345\217\267.py" index 3b3e01a..eefe0d3 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/02-Button-\346\214\211\351\222\256\346\216\247\344\273\266/04-QCheckBox-\345\244\215\351\200\211\346\241\206/03-QCheckBox-\344\277\241\345\217\267.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/02-Button-\346\214\211\351\222\256\346\216\247\344\273\266/04-QCheckBox-\345\244\215\351\200\211\346\241\206/03-QCheckBox-\344\277\241\345\217\267.py" @@ -30,11 +30,11 @@ def test_01(self) -> None: @QtCore.Slot(int) def test_slot(state: int) -> None: - if state == Qt.Checked: + if state == Qt.Checked.value: print("复选框被选中了!") - elif state == Qt.Unchecked: + elif state == Qt.Unchecked.value: print("复选框被取消选中了!") - elif state == Qt.PartiallyChecked: + elif state == Qt.PartiallyChecked.value: print("复选框被部分选中!") self.cb.stateChanged.connect(test_slot) # type: ignore diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/03-QLineEdit-\345\215\225\350\241\214\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250/07-QLineEdit-\345\205\211\346\240\207.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/03-QLineEdit-\345\215\225\350\241\214\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250/07-QLineEdit-\345\205\211\346\240\207.py" index 375a794..8347a1a 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/03-QLineEdit-\345\215\225\350\241\214\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250/07-QLineEdit-\345\205\211\346\240\207.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/03-QLineEdit-\345\215\225\350\241\214\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250/07-QLineEdit-\345\205\211\346\240\207.py" @@ -74,7 +74,9 @@ def setup_ui(self) -> None: pos_layout = QtWidgets.QFormLayout() pos_layout.addRow(QtWidgets.QLabel("光标当前位于:"), self.pos_line_edit) pos_layout.addRow(QtWidgets.QLabel("将光标设置到:"), self.set_pos_spinbox) - pos_layout.addRow(QtWidgets.QLabel(f"{self.point.toTuple()}处的光标位于"), self.pos_at_label) + pos_layout.addRow( + QtWidgets.QLabel(f"{self.point.toTuple()}处的光标位于"), self.pos_at_label + ) pos_groupbox.setLayout(pos_layout) # ================ 光标移动风格 ======================= diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/07-QScrollArea-\346\273\232\345\212\250\345\214\272\345\237\237/02-QScrollArea-\350\247\206\345\233\276\346\216\247\344\273\266.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/07-QScrollArea-\346\273\232\345\212\250\345\214\272\345\237\237/02-QScrollArea-\350\247\206\345\233\276\346\216\247\344\273\266.py" index 1fc69ba..cc14d1c 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/07-QScrollArea-\346\273\232\345\212\250\345\214\272\345\237\237/02-QScrollArea-\350\247\206\345\233\276\346\216\247\344\273\266.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/07-QScrollArea-\346\273\232\345\212\250\345\214\272\345\237\237/02-QScrollArea-\350\247\206\345\233\276\346\216\247\344\273\266.py" @@ -77,7 +77,9 @@ def test_01(self) -> None: self.scroll_area.widget().resize(200, 400) # 尺寸小于滚动区域尺寸 # 设置对齐方式 - self.scroll_area.setAlignment(Qt.AlignHCenter | Qt.AlignBottom) # 设置为水平居中、垂直靠底部对齐 + self.scroll_area.setAlignment( + Qt.AlignHCenter | Qt.AlignBottom + ) # 设置为水平居中、垂直靠底部对齐 def test_02(self) -> None: """测试尺寸控制、确保可见功能""" diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/08-TextEdit-\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250\344\270\216\351\230\205\350\257\273\345\231\250/01-QPlainTextEdit-\347\272\257\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250/02-QPlainTextEdit-\346\215\242\350\241\214\346\226\271\345\274\217\343\200\201\345\217\252\350\257\273.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/08-TextEdit-\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250\344\270\216\351\230\205\350\257\273\345\231\250/01-QPlainTextEdit-\347\272\257\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250/02-QPlainTextEdit-\346\215\242\350\241\214\346\226\271\345\274\217\343\200\201\345\217\252\350\257\273.py" index 65e3035..8bef759 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/08-TextEdit-\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250\344\270\216\351\230\205\350\257\273\345\231\250/01-QPlainTextEdit-\347\272\257\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250/02-QPlainTextEdit-\346\215\242\350\241\214\346\226\271\345\274\217\343\200\201\345\217\252\350\257\273.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/08-TextEdit-\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250\344\270\216\351\230\205\350\257\273\345\231\250/01-QPlainTextEdit-\347\272\257\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250/02-QPlainTextEdit-\346\215\242\350\241\214\346\226\271\345\274\217\343\200\201\345\217\252\350\257\273.py" @@ -68,7 +68,9 @@ def test_01(self) -> None: """测试自动换行功能""" # 设置换行模式 - self.pte.setLineWrapMode(QtWidgets.QPlainTextEdit.LineWrapMode.WidgetWidth) # 自动换行(默认值) + self.pte.setLineWrapMode( + QtWidgets.QPlainTextEdit.LineWrapMode.WidgetWidth + ) # 自动换行(默认值) # self.pte.setLineWrapMode(QtWidgets.QPlainTextEdit.LineWrapMode.NoWrap) # 关闭自动换行 print(self.pte.lineWrapMode()) # 获取换行模式 diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/08-TextEdit-\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250\344\270\216\351\230\205\350\257\273\345\231\250/01-QPlainTextEdit-\347\272\257\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250/08-QPlainText-\346\241\210\344\276\213-\346\230\276\347\244\272\350\241\214\345\217\267.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/08-TextEdit-\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250\344\270\216\351\230\205\350\257\273\345\231\250/01-QPlainTextEdit-\347\272\257\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250/08-QPlainText-\346\241\210\344\276\213-\346\230\276\347\244\272\350\241\214\345\217\267.py" index 2b88baf..76811b1 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/08-TextEdit-\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250\344\270\216\351\230\205\350\257\273\345\231\250/01-QPlainTextEdit-\347\272\257\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250/08-QPlainText-\346\241\210\344\276\213-\346\230\276\347\244\272\350\241\214\345\217\267.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/08-TextEdit-\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250\344\270\216\351\230\205\350\257\273\345\231\250/01-QPlainTextEdit-\347\272\257\346\226\207\346\234\254\347\274\226\350\276\221\345\231\250/08-QPlainText-\346\241\210\344\276\213-\346\230\276\347\244\272\350\241\214\345\217\267.py" @@ -23,7 +23,9 @@ def setup_ui(self) -> None: self.pte = QtWidgets.QPlainTextEdit(self) self.pte.resize(350, 400) self.pte.move(150, 80) - self.pte.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOn) # 始终显示滚动条 + self.pte.setVerticalScrollBarPolicy( + QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOn + ) # 始终显示滚动条 # 用于限制line_num_label位置尺寸的父控件 line_num_widget = QtWidgets.QWidget(self) diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/10-SpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/01-QAbstractSpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206\346\212\275\350\261\241\345\237\272\347\261\273/02-QAbstractSpinBox-\350\216\267\345\217\226\346\226\207\346\234\254\343\200\201\345\257\271\351\275\220\346\226\271\345\274\217\343\200\201\345\215\203\345\210\206\347\254\246\343\200\201\347\211\271\346\225\260\345\200\274\346\226\207\346\234\254.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/10-SpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/01-QAbstractSpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206\346\212\275\350\261\241\345\237\272\347\261\273/02-QAbstractSpinBox-\350\216\267\345\217\226\346\226\207\346\234\254\343\200\201\345\257\271\351\275\220\346\226\271\345\274\217\343\200\201\345\215\203\345\210\206\347\254\246\343\200\201\347\211\271\346\225\260\345\200\274\346\226\207\346\234\254.py" index bee6b21..edb88da 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/10-SpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/01-QAbstractSpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206\346\212\275\350\261\241\345\237\272\347\261\273/02-QAbstractSpinBox-\350\216\267\345\217\226\346\226\207\346\234\254\343\200\201\345\257\271\351\275\220\346\226\271\345\274\217\343\200\201\345\215\203\345\210\206\347\254\246\343\200\201\347\211\271\346\225\260\345\200\274\346\226\207\346\234\254.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/10-SpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/01-QAbstractSpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206\346\212\275\350\261\241\345\237\272\347\261\273/02-QAbstractSpinBox-\350\216\267\345\217\226\346\226\207\346\234\254\343\200\201\345\257\271\351\275\220\346\226\271\345\274\217\343\200\201\345\215\203\345\210\206\347\254\246\343\200\201\347\211\271\346\225\260\345\200\274\346\226\207\346\234\254.py" @@ -50,7 +50,9 @@ def setup_ui(self) -> None: btn.clicked.connect(lambda: print(spin_box.text())) # type: ignore # =================================== 文本对齐方式 =================================== - spin_box.setAlignment(QtCore.Qt.AlignmentFlag.AlignHCenter) # 更改为水平居中对齐,默认为左对齐 + spin_box.setAlignment( + QtCore.Qt.AlignmentFlag.AlignHCenter + ) # 更改为水平居中对齐,默认为左对齐 # ==================================== 千分符 =================================== spin_box.setGroupSeparatorShown(True) # 显示千分符 diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/10-SpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/02-QSpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/03-QSpinBox-\346\225\260\345\200\274\343\200\201\346\225\260\345\200\274\346\230\276\347\244\272\350\277\233\345\210\266\343\200\201\345\211\215\345\220\216\347\274\200.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/10-SpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/02-QSpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/03-QSpinBox-\346\225\260\345\200\274\343\200\201\346\225\260\345\200\274\346\230\276\347\244\272\350\277\233\345\210\266\343\200\201\345\211\215\345\220\216\347\274\200.py" index 3c272fd..474cd96 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/10-SpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/02-QSpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/03-QSpinBox-\346\225\260\345\200\274\343\200\201\346\225\260\345\200\274\346\230\276\347\244\272\350\277\233\345\210\266\343\200\201\345\211\215\345\220\216\347\274\200.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/10-SpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/02-QSpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/03-QSpinBox-\346\225\260\345\200\274\343\200\201\346\225\260\345\200\274\346\230\276\347\244\272\350\277\233\345\210\266\343\200\201\345\211\215\345\220\216\347\274\200.py" @@ -58,7 +58,9 @@ def setup_ui(self) -> None: spinbox.setSuffix(" cm") # 设置后缀 # spinbox.setPrefix("$ ") # 设置前缀 print(f"完整文本为{spinbox.text()}") # 获取文本时会获取到包含前后缀的完整文本 - print(f"数值为{spinbox.text().removesuffix(spinbox.suffix())}") # Python3.9提供的移除后缀方法 + print( + f"数值为{spinbox.text().removesuffix(spinbox.suffix())}" + ) # Python3.9提供的移除后缀方法 print(f"数值为{spinbox.cleanText()}") diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/10-SpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/04-QDateTimeEdit-\346\227\245\346\234\237\346\227\266\351\227\264\347\274\226\350\276\221\345\231\250/01-QDateTimeEdit-\347\256\200\344\273\213\344\270\216\345\210\233\345\273\272.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/10-SpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/04-QDateTimeEdit-\346\227\245\346\234\237\346\227\266\351\227\264\347\274\226\350\276\221\345\231\250/01-QDateTimeEdit-\347\256\200\344\273\213\344\270\216\345\210\233\345\273\272.py" index 94328fe..f733d1f 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/10-SpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/04-QDateTimeEdit-\346\227\245\346\234\237\346\227\266\351\227\264\347\274\226\350\276\221\345\231\250/01-QDateTimeEdit-\347\256\200\344\273\213\344\270\216\345\210\233\345\273\272.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/10-SpinBox-\346\225\260\345\200\274\350\256\276\345\256\232\346\241\206/04-QDateTimeEdit-\346\227\245\346\234\237\346\227\266\351\227\264\347\274\226\350\276\221\345\231\250/01-QDateTimeEdit-\347\256\200\344\273\213\344\270\216\345\210\233\345\273\272.py" @@ -36,7 +36,9 @@ def setup_ui(self) -> None: # dte = QtWidgets.QDateTimeEdit(self) # 创建空的日期时间编辑器 # dte = QtWidgets.QDateTimeEdit(my_time, self) # 使用QTime初始化 # dte = QtWidgets.QDateTimeEdit(my_date, self) # 使用QDate初始化 - dte = QtWidgets.QDateTimeEdit(QtCore.QDateTime.currentDateTime(), self) # 使用QDateTime初始化 + dte = QtWidgets.QDateTimeEdit( + QtCore.QDateTime.currentDateTime(), self + ) # 使用QDateTime初始化 dte.move(200, 200) diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/01-QComboBox-\347\273\204\345\220\210\344\270\213\346\213\211\346\241\206/03-QComboBox-\346\235\241\347\233\256\346\223\215\344\275\234-2.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/01-QComboBox-\347\273\204\345\220\210\344\270\213\346\213\211\346\241\206/03-QComboBox-\346\235\241\347\233\256\346\223\215\344\275\234-2.py" index 974c15e..f3d2a8d 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/01-QComboBox-\347\273\204\345\220\210\344\270\213\346\213\211\346\241\206/03-QComboBox-\346\235\241\347\233\256\346\223\215\344\275\234-2.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/01-QComboBox-\347\273\204\345\220\210\344\270\213\346\213\211\346\241\206/03-QComboBox-\346\235\241\347\233\256\346\223\215\344\275\234-2.py" @@ -87,7 +87,9 @@ def setup_ui(self) -> None: cbb.setEditText("000") # 将当前文本设置为00,而不影响其他条目 # 设置尺寸调整策略 - cbb.setSizeAdjustPolicy(QtWidgets.QComboBox.SizeAdjustPolicy.AdjustToContents) # 总是根据内容调整尺寸 + cbb.setSizeAdjustPolicy( + QtWidgets.QComboBox.SizeAdjustPolicy.AdjustToContents + ) # 总是根据内容调整尺寸 # 限制最小字符数 cbb.setMinimumContentsLength(3) diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/01-QComboBox-\347\273\204\345\220\210\344\270\213\346\213\211\346\241\206/06-QComboBox-\344\277\241\345\217\267.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/01-QComboBox-\347\273\204\345\220\210\344\270\213\346\213\211\346\241\206/06-QComboBox-\344\277\241\345\217\267.py" index 10a9639..1580faa 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/01-QComboBox-\347\273\204\345\220\210\344\270\213\346\213\211\346\241\206/06-QComboBox-\344\277\241\345\217\267.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/01-QComboBox-\347\273\204\345\220\210\344\270\213\346\213\211\346\241\206/06-QComboBox-\344\277\241\345\217\267.py" @@ -1,14 +1,10 @@ -import sys - -from PySide6 import QtCore, QtWidgets - """ QComboBox 信号 提供了多种精细的信号供使用 .activated(index: int) 当用户在组合下拉框中选中一个条目时发射此信号,索引作为参数传递。即使选中项未改变也会发射 - + .currentIndexChanged(index: int) 当当前索引由用户交互或编程方式改变时发射此信号,索引作为参数传递。 若combobox为空或当前索引已重置,则传递条目的 index 或 -1 @@ -18,11 +14,11 @@ .editTextChanged(text: str) 当启用了可编辑模式,且编辑器中的文本发生改变时发射此信号,新的文本作为参数传递 - + .highlighted(index: int) 当用户高亮(光标移入或键盘选择)了弹出菜单中的某一条目时发射此信号 索引值作为参数传递 - + .textActivated(text: str) 当用户选择了条目之一时,发射此信号并将文本作为参数传递 即使选择未发生改变也会发射此信号 @@ -33,6 +29,10 @@ """ +import sys + +from PySide6 import QtCore, QtWidgets + class MyWidget(QtWidgets.QWidget): def __init__(self, *args, **kwargs): diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/02-QFontComboBox-\345\255\227\344\275\223\344\270\213\346\213\211\346\241\206/01-QFontComboBox-\347\256\200\344\273\213\344\270\216\345\210\233\345\273\272.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/02-QFontComboBox-\345\255\227\344\275\223\344\270\213\346\213\211\346\241\206/01-QFontComboBox-\347\256\200\344\273\213\344\270\216\345\210\233\345\273\272.py" index e1d4f48..31d61e9 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/02-QFontComboBox-\345\255\227\344\275\223\344\270\213\346\213\211\346\241\206/01-QFontComboBox-\347\256\200\344\273\213\344\270\216\345\210\233\345\273\272.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/02-QFontComboBox-\345\255\227\344\275\223\344\270\213\346\213\211\346\241\206/01-QFontComboBox-\347\256\200\344\273\213\344\270\216\345\210\233\345\273\272.py" @@ -29,7 +29,9 @@ def setup_ui(self) -> None: fcb = QtWidgets.QFontComboBox() # 创建示例文本并连接信号,当用户选择字体改变时,对应改变示例文本的字体 - text_label = QtWidgets.QLabel("我能吞下玻璃而不伤身体\nThe quick brown fox jumps over the lazy dog.") + text_label = QtWidgets.QLabel( + "我能吞下玻璃而不伤身体\nThe quick brown fox jumps over the lazy dog." + ) fcb.currentFontChanged.connect(text_label.setFont) # type: ignore # 使用布局管理器布局界面 diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/02-QFontComboBox-\345\255\227\344\275\223\344\270\213\346\213\211\346\241\206/02-QFontComboBox-\345\212\237\350\203\275\344\275\234\347\224\250.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/02-QFontComboBox-\345\255\227\344\275\223\344\270\213\346\213\211\346\241\206/02-QFontComboBox-\345\212\237\350\203\275\344\275\234\347\224\250.py" index 6849a9c..f60acfe 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/02-QFontComboBox-\345\255\227\344\275\223\344\270\213\346\213\211\346\241\206/02-QFontComboBox-\345\212\237\350\203\275\344\275\234\347\224\250.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/11-ComboBox-\344\270\213\346\213\211\346\241\206/02-QFontComboBox-\345\255\227\344\275\223\344\270\213\346\213\211\346\241\206/02-QFontComboBox-\345\212\237\350\203\275\344\275\234\347\224\250.py" @@ -56,7 +56,9 @@ def setup_ui(self) -> None: fcb = QtWidgets.QFontComboBox() # 创建示例文本并连接信号,当用户选择字体改变时,对应改变示例文本的字体 - text_label = QtWidgets.QLabel("我能吞下玻璃而不伤身体。\nThe quick brown fox jumps over the lazy dog.") + text_label = QtWidgets.QLabel( + "我能吞下玻璃而不伤身体。\nThe quick brown fox jumps over the lazy dog." + ) fcb.currentFontChanged.connect(text_label.setFont) # type: ignore # 使用布局管理器布局界面 @@ -66,7 +68,9 @@ def setup_ui(self) -> None: self.setLayout(layout) # ======================== 设置显示字体 ======================== - fcb.setDisplayFont("Arial", QtGui.QFont("Arial Black", italic=True)) # 注意在本地测试时使用本机已安装的字体 + fcb.setDisplayFont( + "Arial", QtGui.QFont("Arial Black", italic=True) + ) # 注意在本地测试时使用本机已安装的字体 # 此时在combobox中的"Arial"条目是用黑体斜体显示的,而非原来的Arial字体 # ======================== 设置示例文本、书写系统 ======================== diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/01-QDialog-\345\257\271\350\257\235\346\241\206\345\237\272\347\261\273/03-QDialog-\346\247\275\343\200\201\345\260\272\345\257\270\346\213\226\346\213\275.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/01-QDialog-\345\257\271\350\257\235\346\241\206\345\237\272\347\261\273/03-QDialog-\346\247\275\343\200\201\345\260\272\345\257\270\346\213\226\346\213\275.py" index a70932c..cd9f73c 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/01-QDialog-\345\257\271\350\257\235\346\241\206\345\237\272\347\261\273/03-QDialog-\346\247\275\343\200\201\345\260\272\345\257\270\346\213\226\346\213\275.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/01-QDialog-\345\257\271\350\257\235\346\241\206\345\237\272\347\261\273/03-QDialog-\346\247\275\343\200\201\345\260\272\345\257\270\346\213\226\346\213\275.py" @@ -1,7 +1,3 @@ -import sys - -from PySide6 import QtCore, QtWidgets - """ QDialog 槽、结果、尺寸拖拽控件 @@ -14,7 +10,7 @@ 则done()也将导致局部事件循环结束,且exec()返回r。 .exec() 将对话框作为模态对话框显示。(默认为应用程序级模态)此函数返回QDialog.Accepted或QDialog.Rejected。 尽量避免使用exec()函数,而用open()替代。因为open()是异步的,并且不会增加额外的事件循环 - + QDialog.result中保存了对话框获得的结果,也可以通过代码显式设置结果码: .result() -> int 获取模态对话框的结果码,QDialog.Accepted为1,QDialog.Rejected为0 .setResult(i: int) 将模态对话框的结果码设置为i @@ -30,6 +26,10 @@ """ +import sys + +from PySide6 import QtCore, QtWidgets + class MyWidget(QtWidgets.QWidget): def __init__(self, *args, **kwargs): diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/03-QFileDialog-\346\226\207\344\273\266\345\257\271\350\257\235\346\241\206/01-QFileDialog-\347\256\200\344\273\213\344\270\216\345\210\233\345\273\272.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/03-QFileDialog-\346\226\207\344\273\266\345\257\271\350\257\235\346\241\206/01-QFileDialog-\347\256\200\344\273\213\344\270\216\345\210\233\345\273\272.py" index eaf3bcd..3d2b88b 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/03-QFileDialog-\346\226\207\344\273\266\345\257\271\350\257\235\346\241\206/01-QFileDialog-\347\256\200\344\273\213\344\270\216\345\210\233\345\273\272.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/03-QFileDialog-\346\226\207\344\273\266\345\257\271\350\257\235\346\241\206/01-QFileDialog-\347\256\200\344\273\213\344\270\216\345\210\233\345\273\272.py" @@ -28,8 +28,12 @@ def setup_dialog(self) -> None: """配置对话框属性功能""" self.dialog.setAcceptMode(QtWidgets.QFileDialog.AcceptMode.AcceptOpen) # 打开模式 self.dialog.setFileMode(QtWidgets.QFileDialog.FileMode.ExistingFiles) # 选择现有文件 - self.dialog.setLabelText(QtWidgets.QFileDialog.DialogLabel.Accept, "选择") # 为「接受」按键指定文本 - self.dialog.setLabelText(QtWidgets.QFileDialog.DialogLabel.Reject, "取消") # 为「拒绝」按键指定文本 + self.dialog.setLabelText( + QtWidgets.QFileDialog.DialogLabel.Accept, "选择" + ) # 为「接受」按键指定文本 + self.dialog.setLabelText( + QtWidgets.QFileDialog.DialogLabel.Reject, "取消" + ) # 为「拒绝」按键指定文本 def setup_ui(self) -> None: """设置界面""" diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/03-QFileDialog-\346\226\207\344\273\266\345\257\271\350\257\235\346\241\206/03-QFileDialog-\351\273\230\350\256\244\345\220\216\347\274\200\345\220\215\343\200\201\346\240\207\347\255\276\346\226\207\346\234\254\343\200\201\347\233\256\345\275\225.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/03-QFileDialog-\346\226\207\344\273\266\345\257\271\350\257\235\346\241\206/03-QFileDialog-\351\273\230\350\256\244\345\220\216\347\274\200\345\220\215\343\200\201\346\240\207\347\255\276\346\226\207\346\234\254\343\200\201\347\233\256\345\275\225.py" index 60742ac..556c1fc 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/03-QFileDialog-\346\226\207\344\273\266\345\257\271\350\257\235\346\241\206/03-QFileDialog-\351\273\230\350\256\244\345\220\216\347\274\200\345\220\215\343\200\201\346\240\207\347\255\276\346\226\207\346\234\254\343\200\201\347\233\256\345\275\225.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/03-QFileDialog-\346\226\207\344\273\266\345\257\271\350\257\235\346\241\206/03-QFileDialog-\351\273\230\350\256\244\345\220\216\347\274\200\345\220\215\343\200\201\346\240\207\347\255\276\346\226\207\346\234\254\343\200\201\347\233\256\345\275\225.py" @@ -38,14 +38,20 @@ def __init__(self, *args, **kwargs): def setup_dialog(self) -> None: """设置文件对话框""" - self.dialog.setAcceptMode(QtWidgets.QFileDialog.AcceptMode.AcceptSave) # 文件对话框用于保存文件 + self.dialog.setAcceptMode( + QtWidgets.QFileDialog.AcceptMode.AcceptSave + ) # 文件对话框用于保存文件 # 默认后缀名 self.dialog.setDefaultSuffix("txt") # 设置默认后缀名 # 标签文本 - self.dialog.setLabelText(QtWidgets.QFileDialog.DialogLabel.Accept, "保存") # 将Accept按钮文本设置为保存 - self.dialog.setLabelText(QtWidgets.QFileDialog.DialogLabel.Reject, "取消") # 将Reject标签文本设置为取消 + self.dialog.setLabelText( + QtWidgets.QFileDialog.DialogLabel.Accept, "保存" + ) # 将Accept按钮文本设置为保存 + self.dialog.setLabelText( + QtWidgets.QFileDialog.DialogLabel.Reject, "取消" + ) # 将Reject标签文本设置为取消 def setup_ui(self) -> None: """设置界面""" diff --git "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/05-QMessageBox-\344\277\241\346\201\257\346\217\220\347\244\272\346\241\206/04-QMessageBox-\351\235\231\346\200\201\346\226\271\346\263\225.py" "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/05-QMessageBox-\344\277\241\346\201\257\346\217\220\347\244\272\346\241\206/04-QMessageBox-\351\235\231\346\200\201\346\226\271\346\263\225.py" index 96def6b..3b69be4 100644 --- "a/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/05-QMessageBox-\344\277\241\346\201\257\346\217\220\347\244\272\346\241\206/04-QMessageBox-\351\235\231\346\200\201\346\226\271\346\263\225.py" +++ "b/03-QtWidgets-\345\270\270\347\224\250\346\216\247\344\273\266/12-Dialog-\345\257\271\350\257\235\346\241\206/05-QMessageBox-\344\277\241\346\201\257\346\217\220\347\244\272\346\241\206/04-QMessageBox-\351\235\231\346\200\201\346\226\271\346\263\225.py" @@ -70,7 +70,9 @@ def test_static(self): """测试QMessageBox的静态方法""" self.about_btn.clicked.connect( - lambda: QMessageBox.about(self, "关于此程序", "本程序为PySide6 Code Tutorial中的一个案例") + lambda: QMessageBox.about( + self, "关于此程序", "本程序为PySide6 Code Tutorial中的一个案例" + ) ) # type: ignore self.about_qt_btn.clicked.connect(lambda: QMessageBox.aboutQt(self)) # type: ignore @@ -99,7 +101,10 @@ def show_info_dlg() -> None: def show_warn_dlg() -> None: """self.warning_btn对应的槽函数""" result = QMessageBox.warning( - self, "静态方法-警告", "警告:直接退出将不会保存修改", QMessageBox.StandardButton.Discard + self, + "静态方法-警告", + "警告:直接退出将不会保存修改", + QMessageBox.StandardButton.Discard, ) self.label.setText(f"用户选择了:{user_result_dict[result]}") self.label.adjustSize() diff --git "a/05-QtWidgets-\350\277\233\351\230\266\350\257\235\351\242\230/02-QSS-\346\240\267\345\274\217\350\241\250/01-QSS\344\270\273\351\242\230\345\217\212\347\274\226\350\276\221\345\231\250.md" "b/05-QtWidgets-\350\277\233\351\230\266\350\257\235\351\242\230/02-QSS-\346\240\267\345\274\217\350\241\250/01-QSS\344\270\273\351\242\230\345\217\212\347\274\226\350\276\221\345\231\250.md" index 0365495..ba4475b 100644 --- "a/05-QtWidgets-\350\277\233\351\230\266\350\257\235\351\242\230/02-QSS-\346\240\267\345\274\217\350\241\250/01-QSS\344\270\273\351\242\230\345\217\212\347\274\226\350\276\221\345\231\250.md" +++ "b/05-QtWidgets-\350\277\233\351\230\266\350\257\235\351\242\230/02-QSS-\346\240\267\345\274\217\350\241\250/01-QSS\344\270\273\351\242\230\345\217\212\347\274\226\350\276\221\345\231\250.md" @@ -67,7 +67,7 @@ class QSSLoader: ```python app = QApplication(sys.argv) window = MainWindow() - + style_file = './style.qss' style_sheet = QSSLoader.read_qss_file(style_file) window.setStyleSheet(style_sheet) diff --git "a/07-Packaging-\350\265\204\346\272\220\347\256\241\347\220\206\344\270\216\346\211\223\345\214\205/01-\350\265\204\346\272\220\347\256\241\347\220\206/01-\345\234\250PyQt\344\270\255\344\275\277\347\224\250qrc-rcc\350\265\204\346\272\220\347\263\273\347\273\237.md" "b/07-Packaging-\350\265\204\346\272\220\347\256\241\347\220\206\344\270\216\346\211\223\345\214\205/01-\350\265\204\346\272\220\347\256\241\347\220\206/01-\345\234\250PyQt\344\270\255\344\275\277\347\224\250qrc-rcc\350\265\204\346\272\220\347\263\273\347\273\237.md" index 7883e76..112a676 100644 --- "a/07-Packaging-\350\265\204\346\272\220\347\256\241\347\220\206\344\270\216\346\211\223\345\214\205/01-\350\265\204\346\272\220\347\256\241\347\220\206/01-\345\234\250PyQt\344\270\255\344\275\277\347\224\250qrc-rcc\350\265\204\346\272\220\347\263\273\347\273\237.md" +++ "b/07-Packaging-\350\265\204\346\272\220\347\256\241\347\220\206\344\270\216\346\211\223\345\214\205/01-\350\265\204\346\272\220\347\256\241\347\220\206/01-\345\234\250PyQt\344\270\255\344\275\277\347\224\250qrc-rcc\350\265\204\346\272\220\347\263\273\347\273\237.md" @@ -118,48 +118,48 @@ Qt Resource Compiler version 6.4.1 Options: -h, --help 显示关于命令行选项的帮助 - + --help-all 显示包括Qt独有选项在内的所有帮助 - + -v, --version 显示版本信息 - + -o, --output 将输出写入到 中,而不是 stdout 中 -t, --temp 为大资源文件使用临时文件 - + --name 创建一个外部初始化函数 - + --root 用根目录 作为资源访问路径的前缀 - + --compress-algo 使用 算法压缩输入文件([zlib], none) - + --compress 级别压缩输入文件 - + --no-compress 禁用所有压缩,等同于 --compress-algo=none - + --no-zstd 禁止使用 zstd 压缩 - + --threshold 衡量是否值得进行压缩的阈值 - + --binary 输出一个作为动态资源使用的二进制文件 - + -g, --generator 选择生成器 - + --pass Pass number for big resources - + --namespace 关闭命名空间宏 - + --verbose 启用 verbose 模式 - + --list 只列出 .qrc 文件条目,不生成代码 - + --list-mapping 只输出 .qrc 中定义的资源路径与文件系统路径的 映射,不生成代码 - + -d, --depfile 中写入一个包含 .qrc 依赖项的 depfile --project 输出一个包含当前目录下所有文件的资源文件 - + --format-version 写入 RCC 格式的版本 Arguments: @@ -302,6 +302,15 @@ def get_about_text(): return about_text ``` +或者使用本项目提供的 [`OpenQFile`](./open_qfile.py): + +```python +from open_qfile import OpenQFile + +with OpenQFile(":/texts/About_Text", "rt", encoding="utf-8") as f: + about_text = f.read() +``` + 对于图片,可以在创建 [QIcon](https://doc.qt.io/qt-6/qicon.html)、[QImage](https://doc.qt.io/qt-6/qimage.html)、[QPixmap](https://doc.qt.io/qt-6/qpixmap.html) 对象时将直接资源路径作为参数传入: ```python diff --git "a/07-Packaging-\350\265\204\346\272\220\347\256\241\347\220\206\344\270\216\346\211\223\345\214\205/01-\350\265\204\346\272\220\347\256\241\347\220\206/open_qfile.py" "b/07-Packaging-\350\265\204\346\272\220\347\256\241\347\220\206\344\270\216\346\211\223\345\214\205/01-\350\265\204\346\272\220\347\256\241\347\220\206/open_qfile.py" new file mode 100644 index 0000000..d2724a8 --- /dev/null +++ "b/07-Packaging-\350\265\204\346\272\220\347\256\241\347\220\206\344\270\216\346\211\223\345\214\205/01-\350\265\204\346\272\220\347\256\241\347\220\206/open_qfile.py" @@ -0,0 +1,201 @@ +import locale +import os +import pathlib +import warnings +from typing import Optional, Union + +from PySide6.QtCore import QFile, QIODevice + + +class QtFileOpen: + """ + 通过 QFile 读写文件的上下文管理器 \n + 使与 Python 的 with 语句风格统一 \n + + 使用举例: + + with QtFileOpen("./test.txt", "rt", encoding="utf-8") as f: + print(f.read()) + """ + + def __init__( + self, + file: Union[str, bytes, os.PathLike[str]], + mode="r", + encoding: Optional[str] = None, + ): + """ + :param file: 文件路径 + :param mode: 打开模式(暂时只支持文本读取) + :param encoding: 文本文件编码 + """ + + # 预处理文件路径,防止在 Windows 平台下 QFile 只能处理 '/' 导致的问题 + file_path = self.deal_path(file) + print(file_path) + + # 分析模式是否合法、返回正确的 FileIo 类实例 + # https://docs.python.org/zh-cn/3/library/functions.html#open + if "b" not in mode: + # 文本模式 + self.io_obj = PyQTextFileIo(file_path, mode, encoding) + else: + # 二进制模式(暂不支持) + # self.io_obj = PyQByteFileIo(file, mode) + raise ValueError("暂不支持该模式") + + def __enter__(self): + return self.io_obj + + def __exit__(self, exc_type, exc_val, exc_tb): + self.io_obj.close() + + @classmethod + def deal_path(cls, path) -> str: + """ + 预处理文件路径,确保使用 / 风格 + :param path: 文件路径 + :return: 使用正斜杠(/)的路径字符串 + """ + + # 若路径以字节串传入,则先处理成字符串 + if isinstance(path, bytes): + path = str(path, encoding=locale.getencoding()) + + return str(pathlib.PurePath(path).as_posix()) + + +class PyQTextFileIo: + """ + 将 QFile 中处理文本文件读写的部分封装成 Python的 io 风格 + 目前只支持读取,不支持写入 + """ + + def __init__( + self, + file: Union[str, bytes, os.PathLike[str]], + mode, + encoding: Optional[str] = None, + ): + self._file = QFile(file) + + if encoding is not None: + self.encoding = encoding + else: + # 用户未指定编码,则使用当前平台默认编码 + self.encoding = locale.getencoding() + + self.mode = self._parse_mode(mode) + self._file.open(self.mode) + + @classmethod + def _parse_mode(cls, py_mode: str) -> QIODevice: + """ + 解析文件打开模式,将 Python open() 风格转换至 QIODevice.OpenModeFlag + https://docs.python.org/zh-cn/3/library/functions.html#open + https://doc.qt.io/qt-6/qiodevicebase.html#OpenModeFlag-enum + :return: mode + """ + + qt_mode: QIODevice = QIODevice.Text + + # 暂不支持写入 + if "r" in py_mode and "+" not in py_mode: + qt_mode = qt_mode | QIODevice.ReadOnly + elif "w" in py_mode: + qt_mode = qt_mode | QIODevice.WriteOnly + elif "+" in py_mode: + qt_mode = qt_mode | QIODevice.ReadWrite + + if "x" in py_mode: + qt_mode = qt_mode | QIODevice.NewOnly + + return qt_mode + + def readable(self) -> bool: + """ + 当前文件是否可读 \n + :return: isReadable + """ + + return self._file.isReadable() + + def read(self, size: int = -1) -> str: + """ + 从流中读取至多 size 个字符并以单个 str 的形式返回。 如果 size 为负值或 None,则读取至 EOF。 \n + https://docs.python.org/3/library/io.html#io.TextIOBase.read + :param size: 读取的字符数,负值或 None 表示一直读取直到 EOF + :return: 文件中读出的文本内容 + """ + + if not self.readable(): + raise OSError(f"File '{self._file.fileName()}' is not Readable.") + + if size < 0 or size is None: + # 读取文件,并将 QByteArray 转为 str + text = str(self._file.readAll(), encoding=self.encoding) + else: + # 已知问题:性能太差 + # PySide6.QtCore.QIODevice.read(maxlen) 以字节而非字符方式计算长度,行为不一致 + # 而 QTextStream 对字符编码支持太差,许多编码并不支持 + text = str(self._file.readAll(), encoding=self.encoding)[0:size] # 性能太差 + + return text + + def readline(self, size: int = -1, /) -> str: + """ + 模仿 io.TextIOBase.readline 的行为,读取文件中的一行。 \n + https://docs.python.org/3/library/io.html#io.TextIOBase.readline + :param size: 如果指定了 size ,最多将读取 size 个字符。 + :return: 单行文本 + """ + + if not self.readable(): + raise OSError(f"File '{self._file.fileName()}' is not Readable.") + + if self._file.atEnd(): + warnings.warn( + f"Trying to read a line at the end of the file '{self._file.fileName()}'." + ) + return "" + else: + if size == 0: + return "" + else: + line = str(self._file.readLine(), encoding=self.encoding) + if size < 0: + return line + else: + return line[0:size] + + def readlines(self, hint: int = -1, /) -> list[str]: + """ + 模仿 Python 中 io.IOBase.readlines() 的行为,返回由所有行组成的字符串列表。 \n + Known issue: slower than `readline()` \n + https://docs.python.org/3/library/io.html#io.IOBase.readlines + :param hint: 要读取的字符数 + :return: 文本内容所有行组成的列表 + """ + + if not self.readable(): + raise OSError(f"File '{self._file.fileName()}' is not Readable.") + + if hint <= 0 or hint is None: + temp = str(self._file.readAll(), encoding=self.encoding) + all_lines = temp.splitlines(keepends=True) + else: + all_lines = [] + char_num = 0 + while char_num <= hint and not self._file.atEnd(): + new_line = self.readline() + all_lines.append(new_line) + char_num += len(new_line) + + return all_lines + + def close(self) -> None: + """ + 关闭打开的文件对象 + """ + + self._file.close() diff --git a/README.md b/README.md index 2ad490f..f3d683b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -logo +logo # PySide6 代码式教程 @@ -7,10 +7,10 @@ ![GitHub Repo stars](https://img.shields.io/github/stars/muziing/PySide6-Code-Tutorial) ![License](https://img.shields.io/github/license/muziing/PySide6-Code-Tutorial) ![GitHub Last Commit](https://img.shields.io/github/last-commit/muziing/PySide6-Code-Tutorial) -[![PySide Version](https://img.shields.io/badge/PySide-6.5-blue)](https://doc.qt.io/qtforpython/index.html) +[![PySide Version](https://img.shields.io/badge/PySide-6.6-blue)](https://doc.qt.io/qtforpython/index.html) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/) -[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/) +[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/) ## 简介 @@ -21,7 +21,7 @@ - 在自己的机器上实际运行一下,仔细观察一下每个属性值的改变会怎样影响控件的外观行为,可能比静态的文档教程更有效 - 前身为 GitHub 热度最高的中文 PyQt5 教程 [PyQt-Practice](https://github.com/muziing/PyQt_practice),目前已有 ![PyQt-Practice Stars](https://img.shields.io/github/stars/muziing/PyQt_practice.svg) 个 Stars - 相比 [PyQt-Practice](https://github.com/muziing/PyQt_practice),改进了项目目录结构,增加了部分内容,更加清晰丰富 -- 使用最新的 Python 与 PySide 版本(目前为`3.10`与`6.4`) +- 使用最新的 Python 与 PySide 版本(目前为`3.11`与`6.6`) 希望本项目对你我的 Python-GUI 学习之旅有所帮助。 @@ -35,34 +35,34 @@ 1. Star 本仓库 2. 通过以下方法之一获取源码 - - 克隆仓库(推荐):`git clone https://github.com/muziing/PySide6-Code-Tutorial.git` - - 下载 zip: - - 查看 [Releases](https://github.com/muziing/PySide6-Code-Tutorial/releases) 界面,下载最新发布版(文件更小) + - 克隆仓库(推荐):`git clone https://github.com/muziing/PySide6-Code-Tutorial.git` + - 下载 zip: + - 查看 [Releases](https://github.com/muziing/PySide6-Code-Tutorial/releases) 界面,下载最新发布版(文件更小) 3. 进入项目目录 ### 二、配置虚拟环境与安装依赖 -**方式 A** :[Poetry](https://python-poetry.org/)(推荐) +**方式 A** :[venv](https://docs.python.org/zh-cn/3/library/venv.html)(简单易用,推荐) + +1. 确保 Python 版本与 [pyproject.toml](./pyproject.toml) 中要求的一致 +2. 创建虚拟环境 + - Windows: `python -m venv --upgrade-deps venv` + - Linux/macOS: `python3 -m venv --upgrade-deps venv` +3. 激活虚拟环境 + - Windows: `venv\Scripts\activate` + - Linux/macOS: `. venv/bin/activate` +4. 安装依赖:`pip install -r requirements.txt` + +**方式 B** :[Poetry](https://python-poetry.org/) 1. 确保 Python 版本与 [pyproject.toml](./pyproject.toml) 中要求的一致 2. 按[官方文档](https://python-poetry.org/docs/#installation)提示安装 Poetry 3. 创建虚拟环境:`poetry env use /full/path/to/python`(注意替换路径) -4. 安装依赖:`poetry install --no-dev` +4. 安装依赖:`poetry install --no-root --only main` 5. 使用该虚拟环境: `poetry shell`(或在 PyCharm 等 IDE 中配置) > 更多 Poetry 使用方法信息,请参阅其[官方文档](https://python-poetry.org/docs/)。 -**方式 B** :[venv](https://docs.python.org/zh-cn/3/library/venv.html)(简单易用) - -1. 确保 Python 版本与 [pyproject.toml](./pyproject.toml) 中要求的一致 -2. 创建虚拟环境 - - Windows: `python -m venv --upgrade-deps venv` - - Linux/macOS: `python3 -m venv --upgrade-deps venv` -3. 激活虚拟环境 - - Windows: `venv\Scripts\activate` - - Linux/macOS: `. venv/bin/activate` -4. 安装依赖:`pip install -r requirements.txt` - **方式 C** :其他包管理工具 1. 使用你喜欢的其他工具创建虚拟环境,如 [Pipenv](https://pipenv.pypa.io/)、[Conda](https://www.anaconda.com/) 等 @@ -86,7 +86,7 @@ | [01. HelloWorld - PySide 基本结构](./01-HelloWorld-基本结构) | 新手上路,PySide6 程序的基本结构 | | [02. QtCore - 非GUI的核心功能](./02-QtCore-非GUI的核心功能) | 元对象系统、「信号与槽」通信机制等 | | [03. QtWidgets - 常用控件](./03-QtWidgets-常用控件) | 按钮、输入框、文本编辑器、下拉菜单、滚动条等等常用控件的功能、用法 | -| [04. QtGui - 使用GUI功能扩展QtCore](./04-QtGui-使用GUI功能扩展QtCore) | 位图、字体、颜色、键盘快捷键等、事件 | +| [04. QtGui - 使用GUI功能扩展QtCore](./04-QtGui-使用GUI功能扩展QtCore) | 位图、字体、颜色、键盘快捷键等、事件(暂未完成) | | [05. QtWidgets - 进阶话题](./05-QtWidgets-进阶话题) | 布局管理器、QSS样式、主窗口控件等 | | [06. Model/View - 模型与视图、数据库](./06-ModelView-模型与视图、数据库) | 模型与视图、与数据库交互 | | [07. Packaging - 静态资源编译、打包](./07-Packaging-资源管理与打包) | 将应用程序打包为 `exe`、将静态资源编译至二进制 `qrc` 文件 | @@ -97,7 +97,6 @@ | 目录/文件 | 描述 | |------------------------------------------------|-------------------| | [requirements.txt](./requirements.txt) | 依赖项,运行本项目必备 | -| [requirements_dev.txt](./requirements_dev.txt) | 开发依赖项,为本项目提交贡献时需要 | | [pyproject.toml](./pyproject.toml) | 项目配置文件 | | [poetry.lock](./poetry.lock) | Poetry 依赖项版本约束文件 | | [.gitignore](./.gitignore) | git 忽略提交规则 | @@ -140,6 +139,6 @@ PySide6 Code Tutorial 是一个开源项目,非常期待以及感谢你的参 ## 打赏 -本项目的[主要作者/维护者](https://muzing.top/about/)是一名还没有收入的在校学生,如果本项目对你有帮助,希望可以请他喝一杯冰可乐 :beer:。 +如果本项目对你有帮助,可以请[主要作者/维护者](https://muzing.top/about/)喝一杯冰可乐 :beer:。 -![微信收款码](./Resources/Images/muzing-WeChat-Collection-QRCode.png) +![微信赞赏码](./Resources/Images/muzing-WeChat-Collection.png) diff --git a/Resources/Images/muzing-WeChat-Collection.png b/Resources/Images/muzing-WeChat-Collection.png new file mode 100644 index 0000000..4f9f8de Binary files /dev/null and b/Resources/Images/muzing-WeChat-Collection.png differ diff --git a/poetry.lock b/poetry.lock index b2457ac..e650ddf 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,38 +1,34 @@ -# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "black" -version = "23.3.0" +version = "24.1.1" description = "The uncompromising code formatter." -category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "black-23.3.0-cp310-cp310-macosx_10_16_arm64.whl", hash = "sha256:0945e13506be58bf7db93ee5853243eb368ace1c08a24c65ce108986eac65915"}, - {file = "black-23.3.0-cp310-cp310-macosx_10_16_universal2.whl", hash = "sha256:67de8d0c209eb5b330cce2469503de11bca4085880d62f1628bd9972cc3366b9"}, - {file = "black-23.3.0-cp310-cp310-macosx_10_16_x86_64.whl", hash = "sha256:7c3eb7cea23904399866c55826b31c1f55bbcd3890ce22ff70466b907b6775c2"}, - {file = "black-23.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:32daa9783106c28815d05b724238e30718f34155653d4d6e125dc7daec8e260c"}, - {file = "black-23.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:35d1381d7a22cc5b2be2f72c7dfdae4072a3336060635718cc7e1ede24221d6c"}, - {file = "black-23.3.0-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:a8a968125d0a6a404842fa1bf0b349a568634f856aa08ffaff40ae0dfa52e7c6"}, - {file = "black-23.3.0-cp311-cp311-macosx_10_16_universal2.whl", hash = "sha256:c7ab5790333c448903c4b721b59c0d80b11fe5e9803d8703e84dcb8da56fec1b"}, - {file = "black-23.3.0-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:a6f6886c9869d4daae2d1715ce34a19bbc4b95006d20ed785ca00fa03cba312d"}, - {file = "black-23.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f3c333ea1dd6771b2d3777482429864f8e258899f6ff05826c3a4fcc5ce3f70"}, - {file = "black-23.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:11c410f71b876f961d1de77b9699ad19f939094c3a677323f43d7a29855fe326"}, - {file = "black-23.3.0-cp37-cp37m-macosx_10_16_x86_64.whl", hash = "sha256:1d06691f1eb8de91cd1b322f21e3bfc9efe0c7ca1f0e1eb1db44ea367dff656b"}, - {file = "black-23.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:50cb33cac881766a5cd9913e10ff75b1e8eb71babf4c7104f2e9c52da1fb7de2"}, - {file = "black-23.3.0-cp37-cp37m-win_amd64.whl", hash = "sha256:e114420bf26b90d4b9daa597351337762b63039752bdf72bf361364c1aa05925"}, - {file = "black-23.3.0-cp38-cp38-macosx_10_16_arm64.whl", hash = "sha256:48f9d345675bb7fbc3dd85821b12487e1b9a75242028adad0333ce36ed2a6d27"}, - {file = "black-23.3.0-cp38-cp38-macosx_10_16_universal2.whl", hash = "sha256:714290490c18fb0126baa0fca0a54ee795f7502b44177e1ce7624ba1c00f2331"}, - {file = "black-23.3.0-cp38-cp38-macosx_10_16_x86_64.whl", hash = "sha256:064101748afa12ad2291c2b91c960be28b817c0c7eaa35bec09cc63aa56493c5"}, - {file = "black-23.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:562bd3a70495facf56814293149e51aa1be9931567474993c7942ff7d3533961"}, - {file = "black-23.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:e198cf27888ad6f4ff331ca1c48ffc038848ea9f031a3b40ba36aced7e22f2c8"}, - {file = "black-23.3.0-cp39-cp39-macosx_10_16_arm64.whl", hash = "sha256:3238f2aacf827d18d26db07524e44741233ae09a584273aa059066d644ca7b30"}, - {file = "black-23.3.0-cp39-cp39-macosx_10_16_universal2.whl", hash = "sha256:f0bd2f4a58d6666500542b26354978218a9babcdc972722f4bf90779524515f3"}, - {file = "black-23.3.0-cp39-cp39-macosx_10_16_x86_64.whl", hash = "sha256:92c543f6854c28a3c7f39f4d9b7694f9a6eb9d3c5e2ece488c327b6e7ea9b266"}, - {file = "black-23.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a150542a204124ed00683f0db1f5cf1c2aaaa9cc3495b7a3b5976fb136090ab"}, - {file = "black-23.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:6b39abdfb402002b8a7d030ccc85cf5afff64ee90fa4c5aebc531e3ad0175ddb"}, - {file = "black-23.3.0-py3-none-any.whl", hash = "sha256:ec751418022185b0c1bb7d7736e6933d40bbb14c14a0abcf9123d1b159f98dd4"}, - {file = "black-23.3.0.tar.gz", hash = "sha256:1c7b8d606e728a41ea1ccbd7264677e494e87cf630e399262ced92d4a8dac940"}, + {file = "black-24.1.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2588021038bd5ada078de606f2a804cadd0a3cc6a79cb3e9bb3a8bf581325a4c"}, + {file = "black-24.1.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1a95915c98d6e32ca43809d46d932e2abc5f1f7d582ffbe65a5b4d1588af7445"}, + {file = "black-24.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2fa6a0e965779c8f2afb286f9ef798df770ba2b6cee063c650b96adec22c056a"}, + {file = "black-24.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:5242ecd9e990aeb995b6d03dc3b2d112d4a78f2083e5a8e86d566340ae80fec4"}, + {file = "black-24.1.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:fc1ec9aa6f4d98d022101e015261c056ddebe3da6a8ccfc2c792cbe0349d48b7"}, + {file = "black-24.1.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:0269dfdea12442022e88043d2910429bed717b2d04523867a85dacce535916b8"}, + {file = "black-24.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b3d64db762eae4a5ce04b6e3dd745dcca0fb9560eb931a5be97472e38652a161"}, + {file = "black-24.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:5d7b06ea8816cbd4becfe5f70accae953c53c0e53aa98730ceccb0395520ee5d"}, + {file = "black-24.1.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:e2c8dfa14677f90d976f68e0c923947ae68fa3961d61ee30976c388adc0b02c8"}, + {file = "black-24.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a21725862d0e855ae05da1dd25e3825ed712eaaccef6b03017fe0853a01aa45e"}, + {file = "black-24.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:07204d078e25327aad9ed2c64790d681238686bce254c910de640c7cc4fc3aa6"}, + {file = "black-24.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:a83fe522d9698d8f9a101b860b1ee154c1d25f8a82ceb807d319f085b2627c5b"}, + {file = "black-24.1.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:08b34e85170d368c37ca7bf81cf67ac863c9d1963b2c1780c39102187ec8dd62"}, + {file = "black-24.1.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7258c27115c1e3b5de9ac6c4f9957e3ee2c02c0b39222a24dc7aa03ba0e986f5"}, + {file = "black-24.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:40657e1b78212d582a0edecafef133cf1dd02e6677f539b669db4746150d38f6"}, + {file = "black-24.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:e298d588744efda02379521a19639ebcd314fba7a49be22136204d7ed1782717"}, + {file = "black-24.1.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:34afe9da5056aa123b8bfda1664bfe6fb4e9c6f311d8e4a6eb089da9a9173bf9"}, + {file = "black-24.1.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:854c06fb86fd854140f37fb24dbf10621f5dab9e3b0c29a690ba595e3d543024"}, + {file = "black-24.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3897ae5a21ca132efa219c029cce5e6bfc9c3d34ed7e892113d199c0b1b444a2"}, + {file = "black-24.1.1-cp39-cp39-win_amd64.whl", hash = "sha256:ecba2a15dfb2d97105be74bbfe5128bc5e9fa8477d8c46766505c1dda5883aac"}, + {file = "black-24.1.1-py3-none-any.whl", hash = "sha256:5cdc2e2195212208fbcae579b931407c1fa9997584f0a415421748aeafff1168"}, + {file = "black-24.1.1.tar.gz", hash = "sha256:48b5760dcbfe5cf97fd4fba23946681f3a81514c6ab8a45b50da67ac8fbc6c7b"}, ] [package.dependencies] @@ -42,29 +38,44 @@ packaging = ">=22.0" pathspec = ">=0.9.0" platformdirs = ">=2" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} +typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} [package.extras] colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.7.4)"] +d = ["aiohttp (>=3.7.4)", "aiohttp (>=3.7.4,!=3.9.0)"] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] uvloop = ["uvloop (>=0.15.2)"] [package.source] type = "legacy" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -reference = "tsinghua" +reference = "tsinghua_mirror" + +[[package]] +name = "cfgv" +version = "3.4.0" +description = "Validate configuration and produce human readable error messages." +optional = false +python-versions = ">=3.8" +files = [ + {file = "cfgv-3.4.0-py2.py3-none-any.whl", hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9"}, + {file = "cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560"}, +] + +[package.source] +type = "legacy" +url = "https://pypi.tuna.tsinghua.edu.cn/simple" +reference = "tsinghua_mirror" [[package]] name = "click" -version = "8.1.3" +version = "8.1.7" description = "Composable command line interface toolkit" -category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"}, - {file = "click-8.1.3.tar.gz", hash = "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"}, + {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, + {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, ] [package.dependencies] @@ -73,13 +84,12 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} [package.source] type = "legacy" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -reference = "tsinghua" +reference = "tsinghua_mirror" [[package]] name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." -category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -90,88 +100,139 @@ files = [ [package.source] type = "legacy" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -reference = "tsinghua" +reference = "tsinghua_mirror" + +[[package]] +name = "distlib" +version = "0.3.8" +description = "Distribution utilities" +optional = false +python-versions = "*" +files = [ + {file = "distlib-0.3.8-py2.py3-none-any.whl", hash = "sha256:034db59a0b96f8ca18035f36290806a9a6e6bd9d1ff91e45a7f172eb17e51784"}, + {file = "distlib-0.3.8.tar.gz", hash = "sha256:1530ea13e350031b6312d8580ddb6b27a104275a31106523b8f123787f494f64"}, +] + +[package.source] +type = "legacy" +url = "https://pypi.tuna.tsinghua.edu.cn/simple" +reference = "tsinghua_mirror" + +[[package]] +name = "filelock" +version = "3.13.1" +description = "A platform independent file lock." +optional = false +python-versions = ">=3.8" +files = [ + {file = "filelock-3.13.1-py3-none-any.whl", hash = "sha256:57dbda9b35157b05fb3e58ee91448612eb674172fab98ee235ccb0b5bee19a1c"}, + {file = "filelock-3.13.1.tar.gz", hash = "sha256:521f5f56c50f8426f5e03ad3b281b490a87ef15bc6c526f168290f0c7148d44e"}, +] + +[package.extras] +docs = ["furo (>=2023.9.10)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.24)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.3.2)", "diff-cover (>=8)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)", "pytest-timeout (>=2.2)"] +typing = ["typing-extensions (>=4.8)"] + +[package.source] +type = "legacy" +url = "https://pypi.tuna.tsinghua.edu.cn/simple" +reference = "tsinghua_mirror" + +[[package]] +name = "identify" +version = "2.5.33" +description = "File identification library for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "identify-2.5.33-py2.py3-none-any.whl", hash = "sha256:d40ce5fcd762817627670da8a7d8d8e65f24342d14539c59488dc603bf662e34"}, + {file = "identify-2.5.33.tar.gz", hash = "sha256:161558f9fe4559e1557e1bff323e8631f6a0e4837f7497767c1782832f16b62d"}, +] + +[package.extras] +license = ["ukkonen"] + +[package.source] +type = "legacy" +url = "https://pypi.tuna.tsinghua.edu.cn/simple" +reference = "tsinghua_mirror" [[package]] name = "isort" -version = "5.12.0" +version = "5.13.2" description = "A Python utility / library to sort Python imports." -category = "dev" optional = false python-versions = ">=3.8.0" files = [ - {file = "isort-5.12.0-py3-none-any.whl", hash = "sha256:f84c2818376e66cf843d497486ea8fed8700b340f308f076c6fb1229dff318b6"}, - {file = "isort-5.12.0.tar.gz", hash = "sha256:8bef7dde241278824a6d83f44a544709b065191b95b6e50894bdc722fcba0504"}, + {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, + {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, ] [package.extras] -colors = ["colorama (>=0.4.3)"] -pipfile-deprecated-finder = ["pip-shims (>=0.5.2)", "pipreqs", "requirementslib"] -plugins = ["setuptools"] -requirements-deprecated-finder = ["pip-api", "pipreqs"] +colors = ["colorama (>=0.4.6)"] [package.source] type = "legacy" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -reference = "tsinghua" +reference = "tsinghua_mirror" [[package]] name = "mypy" -version = "1.2.0" +version = "1.8.0" description = "Optional static typing for Python" -category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "mypy-1.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:701189408b460a2ff42b984e6bd45c3f41f0ac9f5f58b8873bbedc511900086d"}, - {file = "mypy-1.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fe91be1c51c90e2afe6827601ca14353bbf3953f343c2129fa1e247d55fd95ba"}, - {file = "mypy-1.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d26b513225ffd3eacece727f4387bdce6469192ef029ca9dd469940158bc89e"}, - {file = "mypy-1.2.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:3a2d219775a120581a0ae8ca392b31f238d452729adbcb6892fa89688cb8306a"}, - {file = "mypy-1.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:2e93a8a553e0394b26c4ca683923b85a69f7ccdc0139e6acd1354cc884fe0128"}, - {file = "mypy-1.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3efde4af6f2d3ccf58ae825495dbb8d74abd6d176ee686ce2ab19bd025273f41"}, - {file = "mypy-1.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:695c45cea7e8abb6f088a34a6034b1d273122e5530aeebb9c09626cea6dca4cb"}, - {file = "mypy-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d0e9464a0af6715852267bf29c9553e4555b61f5904a4fc538547a4d67617937"}, - {file = "mypy-1.2.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8293a216e902ac12779eb7a08f2bc39ec6c878d7c6025aa59464e0c4c16f7eb9"}, - {file = "mypy-1.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:f46af8d162f3d470d8ffc997aaf7a269996d205f9d746124a179d3abe05ac602"}, - {file = "mypy-1.2.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:031fc69c9a7e12bcc5660b74122ed84b3f1c505e762cc4296884096c6d8ee140"}, - {file = "mypy-1.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:390bc685ec209ada4e9d35068ac6988c60160b2b703072d2850457b62499e336"}, - {file = "mypy-1.2.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:4b41412df69ec06ab141808d12e0bf2823717b1c363bd77b4c0820feaa37249e"}, - {file = "mypy-1.2.0-cp37-cp37m-win_amd64.whl", hash = "sha256:4e4a682b3f2489d218751981639cffc4e281d548f9d517addfd5a2917ac78119"}, - {file = "mypy-1.2.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:a197ad3a774f8e74f21e428f0de7f60ad26a8d23437b69638aac2764d1e06a6a"}, - {file = "mypy-1.2.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:c9a084bce1061e55cdc0493a2ad890375af359c766b8ac311ac8120d3a472950"}, - {file = "mypy-1.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eaeaa0888b7f3ccb7bcd40b50497ca30923dba14f385bde4af78fac713d6d6f6"}, - {file = "mypy-1.2.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bea55fc25b96c53affab852ad94bf111a3083bc1d8b0c76a61dd101d8a388cf5"}, - {file = "mypy-1.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:4c8d8c6b80aa4a1689f2a179d31d86ae1367ea4a12855cc13aa3ba24bb36b2d8"}, - {file = "mypy-1.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:70894c5345bea98321a2fe84df35f43ee7bb0feec117a71420c60459fc3e1eed"}, - {file = "mypy-1.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4a99fe1768925e4a139aace8f3fb66db3576ee1c30b9c0f70f744ead7e329c9f"}, - {file = "mypy-1.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:023fe9e618182ca6317ae89833ba422c411469156b690fde6a315ad10695a521"}, - {file = "mypy-1.2.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4d19f1a239d59f10fdc31263d48b7937c585810288376671eaf75380b074f238"}, - {file = "mypy-1.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:2de7babe398cb7a85ac7f1fd5c42f396c215ab3eff731b4d761d68d0f6a80f48"}, - {file = "mypy-1.2.0-py3-none-any.whl", hash = "sha256:d8e9187bfcd5ffedbe87403195e1fc340189a68463903c39e2b63307c9fa0394"}, - {file = "mypy-1.2.0.tar.gz", hash = "sha256:f70a40410d774ae23fcb4afbbeca652905a04de7948eaf0b1789c8d1426b72d1"}, + {file = "mypy-1.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:485a8942f671120f76afffff70f259e1cd0f0cfe08f81c05d8816d958d4577d3"}, + {file = "mypy-1.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:df9824ac11deaf007443e7ed2a4a26bebff98d2bc43c6da21b2b64185da011c4"}, + {file = "mypy-1.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2afecd6354bbfb6e0160f4e4ad9ba6e4e003b767dd80d85516e71f2e955ab50d"}, + {file = "mypy-1.8.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8963b83d53ee733a6e4196954502b33567ad07dfd74851f32be18eb932fb1cb9"}, + {file = "mypy-1.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:e46f44b54ebddbeedbd3d5b289a893219065ef805d95094d16a0af6630f5d410"}, + {file = "mypy-1.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:855fe27b80375e5c5878492f0729540db47b186509c98dae341254c8f45f42ae"}, + {file = "mypy-1.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4c886c6cce2d070bd7df4ec4a05a13ee20c0aa60cb587e8d1265b6c03cf91da3"}, + {file = "mypy-1.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d19c413b3c07cbecf1f991e2221746b0d2a9410b59cb3f4fb9557f0365a1a817"}, + {file = "mypy-1.8.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9261ed810972061388918c83c3f5cd46079d875026ba97380f3e3978a72f503d"}, + {file = "mypy-1.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:51720c776d148bad2372ca21ca29256ed483aa9a4cdefefcef49006dff2a6835"}, + {file = "mypy-1.8.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:52825b01f5c4c1c4eb0db253ec09c7aa17e1a7304d247c48b6f3599ef40db8bd"}, + {file = "mypy-1.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f5ac9a4eeb1ec0f1ccdc6f326bcdb464de5f80eb07fb38b5ddd7b0de6bc61e55"}, + {file = "mypy-1.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afe3fe972c645b4632c563d3f3eff1cdca2fa058f730df2b93a35e3b0c538218"}, + {file = "mypy-1.8.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:42c6680d256ab35637ef88891c6bd02514ccb7e1122133ac96055ff458f93fc3"}, + {file = "mypy-1.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:720a5ca70e136b675af3af63db533c1c8c9181314d207568bbe79051f122669e"}, + {file = "mypy-1.8.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:028cf9f2cae89e202d7b6593cd98db6759379f17a319b5faf4f9978d7084cdc6"}, + {file = "mypy-1.8.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4e6d97288757e1ddba10dd9549ac27982e3e74a49d8d0179fc14d4365c7add66"}, + {file = "mypy-1.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f1478736fcebb90f97e40aff11a5f253af890c845ee0c850fe80aa060a267c6"}, + {file = "mypy-1.8.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:42419861b43e6962a649068a61f4a4839205a3ef525b858377a960b9e2de6e0d"}, + {file = "mypy-1.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:2b5b6c721bd4aabaadead3a5e6fa85c11c6c795e0c81a7215776ef8afc66de02"}, + {file = "mypy-1.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5c1538c38584029352878a0466f03a8ee7547d7bd9f641f57a0f3017a7c905b8"}, + {file = "mypy-1.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4ef4be7baf08a203170f29e89d79064463b7fc7a0908b9d0d5114e8009c3a259"}, + {file = "mypy-1.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7178def594014aa6c35a8ff411cf37d682f428b3b5617ca79029d8ae72f5402b"}, + {file = "mypy-1.8.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ab3c84fa13c04aeeeabb2a7f67a25ef5d77ac9d6486ff33ded762ef353aa5592"}, + {file = "mypy-1.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:99b00bc72855812a60d253420d8a2eae839b0afa4938f09f4d2aa9bb4654263a"}, + {file = "mypy-1.8.0-py3-none-any.whl", hash = "sha256:538fd81bb5e430cc1381a443971c0475582ff9f434c16cd46d2c66763ce85d9d"}, + {file = "mypy-1.8.0.tar.gz", hash = "sha256:6ff8b244d7085a0b425b56d327b480c3b29cafbd2eff27316a004f9a7391ae07"}, ] [package.dependencies] mypy-extensions = ">=1.0.0" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = ">=3.10" +typing-extensions = ">=4.1.0" [package.extras] dmypy = ["psutil (>=4.0)"] install-types = ["pip"] -python2 = ["typed-ast (>=1.4.0,<2)"] +mypyc = ["setuptools (>=50)"] reports = ["lxml"] [package.source] type = "legacy" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -reference = "tsinghua" +reference = "tsinghua_mirror" [[package]] name = "mypy-extensions" version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -182,164 +243,230 @@ files = [ [package.source] type = "legacy" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -reference = "tsinghua" +reference = "tsinghua_mirror" + +[[package]] +name = "nodeenv" +version = "1.8.0" +description = "Node.js virtual environment builder" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" +files = [ + {file = "nodeenv-1.8.0-py2.py3-none-any.whl", hash = "sha256:df865724bb3c3adc86b3876fa209771517b0cfe596beff01a92700e0e8be4cec"}, + {file = "nodeenv-1.8.0.tar.gz", hash = "sha256:d51e0c37e64fbf47d017feac3145cdbb58836d7eee8c6f6d3b6880c5456227d2"}, +] + +[package.dependencies] +setuptools = "*" + +[package.source] +type = "legacy" +url = "https://pypi.tuna.tsinghua.edu.cn/simple" +reference = "tsinghua_mirror" [[package]] name = "packaging" -version = "23.0" +version = "23.2" description = "Core utilities for Python packages" -category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "packaging-23.0-py3-none-any.whl", hash = "sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2"}, - {file = "packaging-23.0.tar.gz", hash = "sha256:b6ad297f8907de0fa2fe1ccbd26fdaf387f5f47c7275fedf8cce89f99446cf97"}, + {file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"}, + {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, ] [package.source] type = "legacy" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -reference = "tsinghua" +reference = "tsinghua_mirror" [[package]] name = "pathspec" -version = "0.11.1" +version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." -category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pathspec-0.11.1-py3-none-any.whl", hash = "sha256:d8af70af76652554bd134c22b3e8a1cc46ed7d91edcdd721ef1a0c51a84a5293"}, - {file = "pathspec-0.11.1.tar.gz", hash = "sha256:2798de800fa92780e33acca925945e9a19a133b715067cf165b8866c15a31687"}, + {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, + {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, ] [package.source] type = "legacy" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -reference = "tsinghua" +reference = "tsinghua_mirror" [[package]] name = "platformdirs" -version = "3.2.0" +version = "4.2.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "platformdirs-3.2.0-py3-none-any.whl", hash = "sha256:ebe11c0d7a805086e99506aa331612429a72ca7cd52a1f0d277dc4adc20cb10e"}, - {file = "platformdirs-3.2.0.tar.gz", hash = "sha256:d5b638ca397f25f979350ff789db335903d7ea010ab28903f57b27e1b16c2b08"}, + {file = "platformdirs-4.2.0-py3-none-any.whl", hash = "sha256:0614df2a2f37e1a662acbd8e2b25b92ccf8632929bc6d43467e17fe89c75e068"}, + {file = "platformdirs-4.2.0.tar.gz", hash = "sha256:ef0cc731df711022c174543cb70a9b5bd22e5a9337c8624ef2c2ceb8ddad8768"}, ] [package.extras] -docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] +docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] [package.source] type = "legacy" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -reference = "tsinghua" +reference = "tsinghua_mirror" [[package]] -name = "pyside6" -version = "6.5.0" -description = "Python bindings for the Qt cross-platform application and UI framework" -category = "main" +name = "pre-commit" +version = "3.6.0" +description = "A framework for managing and maintaining multi-language pre-commit hooks." optional = false -python-versions = "<3.12,>=3.7" +python-versions = ">=3.9" files = [ - {file = "PySide6-6.5.0-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:cb059a0f3d4b763451a1e8dec440784dff1728e9ace6cb81c541cc1354c5f3dc"}, - {file = "PySide6-6.5.0-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:5102c57841b15facb0aeca1f23d689ebc528a609bf5fb907f1ef2747f6415001"}, - {file = "PySide6-6.5.0-cp37-abi3-win_amd64.whl", hash = "sha256:13e8e96aa7a89840575505f50b9635e6450bf413ff46288d1085b3a9f8b225c1"}, - {file = "PySide6-6.5.0-pp39-pypy39_pp73-macosx_10_9_universal2.whl", hash = "sha256:f30e1d0319ea4d2ddac654c58377079a40f38c4cac7b6fd631902f91190c1fc8"}, - {file = "PySide6-6.5.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c1c7244a4e83b3a4ea965f4a85776ebc64fa3c9b4af77ad70b22e64ccec3d451"}, - {file = "PySide6-6.5.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7242fe09aaeb3399152fa1c6c25098b93df945620a4bd81a37de0ecb2f64fd5d"}, + {file = "pre_commit-3.6.0-py2.py3-none-any.whl", hash = "sha256:c255039ef399049a5544b6ce13d135caba8f2c28c3b4033277a788f434308376"}, + {file = "pre_commit-3.6.0.tar.gz", hash = "sha256:d30bad9abf165f7785c15a21a1f46da7d0677cb00ee7ff4c579fd38922efe15d"}, ] [package.dependencies] -PySide6-Addons = "6.5.0" -PySide6-Essentials = "6.5.0" -shiboken6 = "6.5.0" +cfgv = ">=2.0.0" +identify = ">=1.0.0" +nodeenv = ">=0.11.1" +pyyaml = ">=5.1" +virtualenv = ">=20.10.0" [package.source] type = "legacy" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -reference = "tsinghua" +reference = "tsinghua_mirror" [[package]] -name = "pyside6-addons" -version = "6.5.0" -description = "Python bindings for the Qt cross-platform application and UI framework (Addons)" -category = "main" +name = "pyside6-essentials" +version = "6.6.1" +description = "Python bindings for the Qt cross-platform application and UI framework (Essentials)" optional = false -python-versions = "<3.12,>=3.7" +python-versions = "<3.13,>=3.8" files = [ - {file = "PySide6_Addons-6.5.0-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:d29e84d0b54c5fdeb6cc405d537788a648da975cc58e37f0df3a17cd11a67f1d"}, - {file = "PySide6_Addons-6.5.0-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:29551ca63a1cbc0fcd17fa9e477282857e2c66c3a55fdb9754b75519d5adf89a"}, - {file = "PySide6_Addons-6.5.0-cp37-abi3-win_amd64.whl", hash = "sha256:db7a6117c3f944b4827204ed7f346030fc10c602521f278310a78021567df28f"}, - {file = "PySide6_Addons-6.5.0-pp39-pypy39_pp73-macosx_10_9_universal2.whl", hash = "sha256:fd5bc46cfffac7afa2f76c3dc6cb6f567a0ad1276d8177797c1bc152aec50f35"}, - {file = "PySide6_Addons-6.5.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:9ed197a05f1c279d1589d8535040fe5e21b92fa19933e38de962050cb58f6c05"}, - {file = "PySide6_Addons-6.5.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:1a9545df3e77c656a3708eaa3584d98ff41720c7dadf344d5126d66e83d0ab5a"}, + {file = "PySide6_Essentials-6.6.1-cp38-abi3-macosx_11_0_universal2.whl", hash = "sha256:0c8917b15236956957178a8c9854641b12b11dad79ba0caf26147119164c30cf"}, + {file = "PySide6_Essentials-6.6.1-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:c7185616083eab6f42eaed598d97d49fac4f60ae2e7415194140d54f58c2b42c"}, + {file = "PySide6_Essentials-6.6.1-cp38-abi3-manylinux_2_31_aarch64.whl", hash = "sha256:a383c3d60298392cfb621ec1a0cf24b4799321e6c5bbafc021d4cc8076ea1315"}, + {file = "PySide6_Essentials-6.6.1-cp38-abi3-win_amd64.whl", hash = "sha256:13da926e9e9ee3e26e3f66883a9d5e43726ddee70cdabddca02a07aa1ccf9484"}, ] [package.dependencies] -PySide6-Essentials = "6.5.0" -shiboken6 = "6.5.0" +shiboken6 = "6.6.1" [package.source] type = "legacy" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -reference = "tsinghua" +reference = "tsinghua_mirror" [[package]] -name = "pyside6-essentials" -version = "6.5.0" -description = "Python bindings for the Qt cross-platform application and UI framework (Essentials)" -category = "main" +name = "pyyaml" +version = "6.0.1" +description = "YAML parser and emitter for Python" optional = false -python-versions = "<3.12,>=3.7" +python-versions = ">=3.6" files = [ - {file = "PySide6_Essentials-6.5.0-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:4517e27fc540d9e645ea12dea82c8b29c042d66aaef46960a125cccdf0079800"}, - {file = "PySide6_Essentials-6.5.0-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:f00d4f10758cdc3f49f94465ead788ad294dac7d9cc5e1cc0610e97c2bdfc8d7"}, - {file = "PySide6_Essentials-6.5.0-cp37-abi3-win_amd64.whl", hash = "sha256:bc2e0a9dafe383ab965e98b6ddf73f709da3736197dea8eab265fd3e524db993"}, - {file = "PySide6_Essentials-6.5.0-pp39-pypy39_pp73-macosx_10_9_universal2.whl", hash = "sha256:58a88a099171c55a7e41e519208c9ca93661d277bb73c5897a2e3f2cbe5248b7"}, - {file = "PySide6_Essentials-6.5.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:0287ec94ee1923d430bb20836bc649a5c76a59281245de469d7f759cc73c5ea7"}, - {file = "PySide6_Essentials-6.5.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:987c2ec04c35481c841de9b25931d2d074eb7d2e591aa5628041b2ca2df96d0e"}, + {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, + {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, + {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"}, + {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, + {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, + {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"}, + {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, + {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, + {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, + {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, + {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, + {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, + {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"}, + {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win32.whl", hash = "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa"}, + {file = "PyYAML-6.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win32.whl", hash = "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867"}, + {file = "PyYAML-6.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, + {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, + {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, + {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, + {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, + {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, + {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, + {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, ] -[package.dependencies] -shiboken6 = "6.5.0" +[package.source] +type = "legacy" +url = "https://pypi.tuna.tsinghua.edu.cn/simple" +reference = "tsinghua_mirror" + +[[package]] +name = "setuptools" +version = "69.0.3" +description = "Easily download, build, install, upgrade, and uninstall Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "setuptools-69.0.3-py3-none-any.whl", hash = "sha256:385eb4edd9c9d5c17540511303e39a147ce2fc04bc55289c322b9e5904fe2c05"}, + {file = "setuptools-69.0.3.tar.gz", hash = "sha256:be1af57fc409f93647f2e8e4573a142ed38724b8cdd389706a867bb4efcf1e78"}, +] + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] [package.source] type = "legacy" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -reference = "tsinghua" +reference = "tsinghua_mirror" [[package]] name = "shiboken6" -version = "6.5.0" +version = "6.6.1" description = "Python/C++ bindings helper module" -category = "main" optional = false -python-versions = "<3.12,>=3.7" +python-versions = "<3.13,>=3.8" files = [ - {file = "shiboken6-6.5.0-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:2d7fe6534a51ec9c96b82fc6275cf75e85ab29276a9778aed756465f81adf0c1"}, - {file = "shiboken6-6.5.0-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:46ff977f96c9d45dba3c3a313628356fd40e4423bb65bf2d9870b73396fad8be"}, - {file = "shiboken6-6.5.0-cp37-abi3-win_amd64.whl", hash = "sha256:aee9708517821aaef547c83d689bf524d6f217d47232cb313d9af9e630215eed"}, - {file = "shiboken6-6.5.0-pp39-pypy39_pp73-macosx_10_9_universal2.whl", hash = "sha256:6e2874ea013d4cea7819935977bffa4c634ebcaabcb5287798df9f0c2f10c4c0"}, - {file = "shiboken6-6.5.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:72888ebc5ef7295df27197c0af726bd6731e2a883b346e448e2c740b3e34bc2f"}, - {file = "shiboken6-6.5.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:1bba668221a5cf40186cea93ced018cf788d7476d50968a3f073ebbe41ce712d"}, + {file = "shiboken6-6.6.1-cp38-abi3-macosx_11_0_universal2.whl", hash = "sha256:d756fd1fa945b787e8eef142f2eb571da0b4c4dc2f2eec1a7c12a474a2cf84e4"}, + {file = "shiboken6-6.6.1-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:fb102e4bc210006f0cdd0ce38e1aaaaf792bd871f02a2b3f01d07922c5cf4c59"}, + {file = "shiboken6-6.6.1-cp38-abi3-manylinux_2_31_aarch64.whl", hash = "sha256:a605960e72af5eef915991cee7eef4cc72f5cabe63b9ae1a955ceb3d3b0a00b9"}, + {file = "shiboken6-6.6.1-cp38-abi3-win_amd64.whl", hash = "sha256:072c35c4fe46ec13b364d9dc47b055bb2277ee3aeaab18c23650280ec362f62a"}, ] [package.source] type = "legacy" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -reference = "tsinghua" +reference = "tsinghua_mirror" [[package]] name = "tomli" version = "2.0.1" description = "A lil' TOML parser" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -350,26 +477,50 @@ files = [ [package.source] type = "legacy" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -reference = "tsinghua" +reference = "tsinghua_mirror" [[package]] name = "typing-extensions" -version = "4.5.0" -description = "Backported and Experimental Type Hints for Python 3.7+" -category = "dev" +version = "4.9.0" +description = "Backported and Experimental Type Hints for Python 3.8+" +optional = false +python-versions = ">=3.8" +files = [ + {file = "typing_extensions-4.9.0-py3-none-any.whl", hash = "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd"}, + {file = "typing_extensions-4.9.0.tar.gz", hash = "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783"}, +] + +[package.source] +type = "legacy" +url = "https://pypi.tuna.tsinghua.edu.cn/simple" +reference = "tsinghua_mirror" + +[[package]] +name = "virtualenv" +version = "20.25.0" +description = "Virtual Python Environment builder" optional = false python-versions = ">=3.7" files = [ - {file = "typing_extensions-4.5.0-py3-none-any.whl", hash = "sha256:fb33085c39dd998ac16d1431ebc293a8b3eedd00fd4a32de0ff79002c19511b4"}, - {file = "typing_extensions-4.5.0.tar.gz", hash = "sha256:5cb5f4a79139d699607b3ef622a1dedafa84e115ab0024e0d9c044a9479ca7cb"}, + {file = "virtualenv-20.25.0-py3-none-any.whl", hash = "sha256:4238949c5ffe6876362d9c0180fc6c3a824a7b12b80604eeb8085f2ed7460de3"}, + {file = "virtualenv-20.25.0.tar.gz", hash = "sha256:bf51c0d9c7dd63ea8e44086fa1e4fb1093a31e963b86959257378aef020e1f1b"}, ] +[package.dependencies] +distlib = ">=0.3.7,<1" +filelock = ">=3.12.2,<4" +platformdirs = ">=3.9.1,<5" + +[package.extras] +docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] +test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] + [package.source] type = "legacy" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -reference = "tsinghua" +reference = "tsinghua_mirror" [metadata] lock-version = "2.0" -python-versions = ">=3.9,<3.12" -content-hash = "e4f585835dc06b2c1439f12a1899dfaeb3d81b6ed753ca21544fe6c9c1c04613" +python-versions = ">=3.9,<3.13" +content-hash = "9a69db5a92317df6c62461f504fea9c49c52182ac8863256e91bfdbc9c17ccb9" diff --git a/pyproject.toml b/pyproject.toml index 8fa426d..154b49a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,20 +6,24 @@ authors = ["muzing "] license = "GPL-3.0" repository = "https://github.com/muziing/PySide6-Code-Tutorial" -# 使用清华pypi镜像 +[tool.poetry.urls] +"Bug Tracker" = "https://github.com/muziing/PySide6-Code-Tutorial/issues" + +# 使用清华 pypi 镜像 [[tool.poetry.source]] -name = "tsinghua" +name = "tsinghua_mirror" url = "https://pypi.tuna.tsinghua.edu.cn/simple" -default = true +priority = "default" [tool.poetry.dependencies] -python = ">=3.9,<3.12" -pyside6 = "^6.5.0" +python = ">=3.9,<3.13" +pyside6-essentials = "^6.2.0" -[tool.poetry.dev-dependencies] -black = "^23.3.0" -isort = "^5.12.0" -mypy = "^1.2.0" +[tool.poetry.group.dev.dependencies] +black = "^24.1.0" +isort = "^5.13.0" +mypy = "^1.8.0" +pre-commit = "^3.6.0" [build-system] requires = ["poetry-core>=1.0.0"] @@ -33,5 +37,5 @@ profile = "black" line_length = 100 [tool.mypy] -python_version = "3.10" +python_version = "3.11" warn_return_any = true diff --git a/requirements.txt b/requirements.txt index 1768a8b..52d53dc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,4 @@ --index-url https://pypi.tuna.tsinghua.edu.cn/simple -pyside6-addons==6.4.2 ; python_version >= "3.9" and python_version < "3.12" -pyside6-essentials==6.4.2 ; python_version >= "3.9" and python_version < "3.12" -pyside6==6.4.2 ; python_version >= "3.9" and python_version < "3.12" -shiboken6==6.4.2 ; python_version >= "3.9" and python_version < "3.12" +pyside6-essentials >= 6.2.0 ; python_version >= "3.9" and python_version < "3.13" +shiboken6 >= 6.2.0 ; python_version >= "3.9" and python_version < "3.13" diff --git a/requirements_dev.txt b/requirements_dev.txt deleted file mode 100644 index 2a3562a..0000000 --- a/requirements_dev.txt +++ /dev/null @@ -1,17 +0,0 @@ ---index-url https://pypi.tuna.tsinghua.edu.cn/simple - -black==23.1.0 ; python_version >= "3.9" and python_version < "3.12" -click==8.1.3 ; python_version >= "3.9" and python_version < "3.12" -colorama==0.4.6 ; python_version >= "3.9" and python_version < "3.12" and platform_system == "Windows" -isort==5.12.0 ; python_version >= "3.9" and python_version < "3.12" -mypy-extensions==1.0.0 ; python_version >= "3.9" and python_version < "3.12" -mypy==1.1.1 ; python_version >= "3.9" and python_version < "3.12" -packaging==23.0 ; python_version >= "3.9" and python_version < "3.12" -pathspec==0.11.1 ; python_version >= "3.9" and python_version < "3.12" -platformdirs==3.1.1 ; python_version >= "3.9" and python_version < "3.12" -pyside6-addons==6.4.2 ; python_version >= "3.9" and python_version < "3.12" -pyside6-essentials==6.4.2 ; python_version >= "3.9" and python_version < "3.12" -pyside6==6.4.2 ; python_version >= "3.9" and python_version < "3.12" -shiboken6==6.4.2 ; python_version >= "3.9" and python_version < "3.12" -tomli==2.0.1 ; python_version >= "3.9" and python_version < "3.11" -typing-extensions==4.5.0 ; python_version >= "3.9" and python_version < "3.12"