From 0f3bc1b5ae3ba879c0195012f7e8a45a4634d446 Mon Sep 17 00:00:00 2001 From: ut005790 Date: Tue, 27 Aug 2024 13:56:59 +0800 Subject: [PATCH] Basic init --- .env | 4 + .gitignore | 6 ++ README.md | 46 ++++---- case/__init__.py | 0 case/assert_res/README.md | 3 + .../assert_res/all_categories_in_launcher.png | Bin 0 -> 1314 bytes case/assert_res/deepin_manager_cn.png | Bin 0 -> 1566 bytes case/assert_res/firefox_icon_in_window.png | Bin 0 -> 789 bytes case/assert_res/keyboard_layout_hanyu.png | Bin 0 -> 829 bytes case/assert_res/launcher_window.png | Bin 0 -> 1782 bytes case/base_case.py | 12 +++ case/test_mycase_001.py | 17 +++ case/test_mycase_002.py | 20 ++++ config.py | 20 ++++ conftest.py | 10 ++ env.sh | 7 ++ method/__init__.py | 0 method/assert_method.py | 22 ++++ method/base_method.py | 10 ++ method/dde_autotest_euler_method.py | 99 ++++++++++++++++++ method/image_res/README.md | 3 + method/image_res/close_window_btn.png | Bin 0 -> 357 bytes .../image_res/delete_keyboard_layout_icon.png | Bin 0 -> 374 bytes method/static_res/README.md | 3 + method/ui.ini | 14 +++ mycase.csv | 3 + pytest.ini | 18 ++++ requirements.txt | 3 + ruff.toml | 90 ++++++++++++++++ 29 files changed, 383 insertions(+), 27 deletions(-) create mode 100644 .env create mode 100644 .gitignore create mode 100644 case/__init__.py create mode 100644 case/assert_res/README.md create mode 100644 case/assert_res/all_categories_in_launcher.png create mode 100644 case/assert_res/deepin_manager_cn.png create mode 100644 case/assert_res/firefox_icon_in_window.png create mode 100644 case/assert_res/keyboard_layout_hanyu.png create mode 100644 case/assert_res/launcher_window.png create mode 100644 case/base_case.py create mode 100644 case/test_mycase_001.py create mode 100644 case/test_mycase_002.py create mode 100644 config.py create mode 100644 conftest.py create mode 100644 env.sh create mode 100644 method/__init__.py create mode 100644 method/assert_method.py create mode 100644 method/base_method.py create mode 100644 method/dde_autotest_euler_method.py create mode 100644 method/image_res/README.md create mode 100644 method/image_res/close_window_btn.png create mode 100644 method/image_res/delete_keyboard_layout_icon.png create mode 100644 method/static_res/README.md create mode 100644 method/ui.ini create mode 100644 mycase.csv create mode 100644 pytest.ini create mode 100644 requirements.txt create mode 100644 ruff.toml diff --git a/.env b/.env new file mode 100644 index 0000000..59e96ba --- /dev/null +++ b/.env @@ -0,0 +1,4 @@ +PIPENV_VENV_IN_PROJECT=true +PIPENV_PYPI_MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple +PIPENV_QUIET=true +PIPENV_DEFAULT_PYTHON_VERSION=3 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a9d4f07 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.idea +.vscode +__pycache__ +Pipfile +Pipfile.lock +report diff --git a/README.md b/README.md index d0213ed..e2d3c2a 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,29 @@ -# dde_autotest_euler +# ${app_name} -#### 介绍 -dde autotest case for openEuler +## 环境部署 -#### 软件架构 -软件架构说明 +```bash +pip3 install youqu3 +youqu3 envx +``` -#### 安装教程 +## Ruff -1. xxxx -2. xxxx -3. xxxx +## 安装 Ruff -#### 使用说明 +```bash +pip3 install ruff +``` -1. xxxx -2. xxxx -3. xxxx +### 代码检查 -#### 参与贡献 +```bash +ruff check . +``` -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request +### 代码格式化 - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +```bash +ruff format . +``` \ No newline at end of file diff --git a/case/__init__.py b/case/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/case/assert_res/README.md b/case/assert_res/README.md new file mode 100644 index 0000000..5f38070 --- /dev/null +++ b/case/assert_res/README.md @@ -0,0 +1,3 @@ +# assert_res + +用例断言资源 \ No newline at end of file diff --git a/case/assert_res/all_categories_in_launcher.png b/case/assert_res/all_categories_in_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..42d2e72cf5db2500418acacc062cf31f0058d874 GIT binary patch literal 1314 zcmV+-1>O3IP)4R$oY3Z5V%yl+tw3Y-(j>(-m26>q0OQ8$%gv1tCE} z47%7_FetkSpQ zzf<|`gT6o8@9KG<=l49%?|nJXd0$E}7=&L68UM9_zm4BZF^ZxnivFYRF$}|vSS+@) zvyC?@d zH>akiC=?2YVH65wYimoXRHivEx7%G@Tzt@x^mKG|NTpJT!%jZd$+c>3WY*~6OBgCo;}NCG6CTI z`}bC>^`K$^KoBGzkK?x8Za0}sbUIxkk@WTT6%-WU{%|;~)9FZwckbLdN-kNk)9Ji^ z{W`JK>-B_fHk$$9!Gi}Xm1=8iODdJ7DT<@9v5~M93Po92SwlmE*X#B9eC_S+`T6;N zzdss{zJ2@FCYPFh7Cc-Ze2ngHd za+Q>npeXwM`SZ=q&6Smv`uh6q?QIlAb8~ZdcX#XR>hN!!#bU+d@sg5~t5>fQ>0Bti)#-09spH+uGVPGcy6e=kr;u*1^F+f|-|> z2LK3y;M)TLp-?Ck3Ktg_1Azd7AlI&4Bgh2>1^6`oJP!Z6SuB>d6xi+d)Tlrp@caEv zr<23soIH6lD=Uk`;keyypU=nPaHv!&07N1YI-Q=H6$k|2z^G|78o>cHH8rJCOrAU( zTCFyfzrQ~*G11l4 z_2kJDnM{_NI6XZr5{d5Ky(^c?FJ8R3yu5tx-n}%64?p9fp&?HS9zJ|Xg!cCK?%%(! z(P%0vDpFHKB9Ts~GZ+lXWO8F;gUjWnev59m8^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2nM@{%qUPr2D2l>ndcFSGv17Y;@BRsG z;c&R8r^n;*SS%JUm#fq19zJ}iR;#~uw7!8eXU=qWb!9T4Q0VU6yQQV26B84IgM)lN z|K-b-7L&wOUuKSbjSy<56;DgH)3 zg1Nc5cswo^i=)vfi^WQ%QUpN=g~CWA!r^chFJ7E?*KgPM2l03RfBWy^ADZLY#;oPE Qt^fc407*qoM6N<$f=u`b;{X5v literal 0 HcmV?d00001 diff --git a/case/assert_res/firefox_icon_in_window.png b/case/assert_res/firefox_icon_in_window.png new file mode 100644 index 0000000000000000000000000000000000000000..8b407dfce5c1c1af72129fb7089859a3135f2e51 GIT binary patch literal 789 zcmV+w1M2*VP)K)lFyf$ zf`Z~j5cH%L6cjxwo)x6vp%)L{#DfPB#TG$4s0gC?nS)X__QTRNCTVu_v74ReK@seS z@uMCD-))9BKOT=aGsMi8*AVl|{TKhb$YA;15ZpuNtsQ!|E|XrFiCCQ0Dp$5I?z$r?9v8xt2vADHt|iJGDXuPkBG(@-Huv2* z;b_ZDGZa^xu;%%bhBsa{9Enf>C*Z0|3u=j8Y-u=akj*45V;or?D@m4Qpsb6W-d&&6 zCju^N)S5@imTmEwLo~gQa@C4bCPt2sd8=vEJ-py@opi+-#&&bHgz`*eC z!zV$0UPea7&!4|CFfyVktIbo5o5PwNdbb3+8`wySdESS_$tg0-FEW(HuL?1tWJ$vE0pdep;`>ZKlC9JG0 z3=9nW4xKr5?%KrmA_fMA_a8o2G)^(n*GP`_`}6zH?TWT`@|NFmj+o3s& zHbMmV9Xi9nz>u33=H+UIW&y&&Q)jQG6}Hb=wDIT9UyO{5#`+p(&R>TF-GwW+Elji- z7#LQp+nrh5Sy0jU?)}GLU&r}VY8e?B7td(ezIuYFuz;wr00Ra<38IIOUvy1cT$UFr zFDr5U^yMkDRxg-VcjC;IsdLsWnbpX`%nVT$o>c8*XR=}IK}_RZ9n6Zdqp$}N0|SG+ zti+^_;?G~cGB7Y$nCL86wq@tO6PtG&@o~3-n+^dc2Ab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O$_U%jPWb@|DEiEmu&+hE( zlt?6y9h=Q&Hk(hJH~|1~I-QM;ja5}uH*eldNl6(P7{GBnGc)ttxpS{xy=rS~yK?0U z-I22B?V%`2rTKAsp`)WiEEWR*y1Kd`UjP6M!_;autww)&3=Itx78XJo$8ma}xw*L= z9UUAF2mI5HWoBlE!(jk`TrR(G;R0NmLka+Z&*v{S*CrC-!tkdc8^75cO zONu}s@caF-Wq)C?SS2z+{vSrPhH9ymT^5hA9QoLSoMMXvI zDvslNy}r7-nsyin1n3Cmayd-21VP-pchBv1b2yx=tSq%!J-<-QlEP#%MIzDY=;$K1 zBo>R8`MKSnM`SEXnBGK|cl(}4PettfbCnqPfva%Ek1srbOx|MFF;y@5YRaF&>#j35Xg&A#p ze7wHC{?MUA3WWkekWeV3R4M@gN~KaRmqRPN-LBW`w{PEm>eQ*++*~-R(P&&Q*NYb~ zy1Tm%9y~}VBgXtorbr}$Vc5@FeinLrPEOAJ zOQzMUS0^VYuhb>e!euTlFEE+R3BX`5mf6Ms8}T2%ZT&U; Y1^8S42+^^z$^ZZW07*qoM6N<$f|YPhkpKVy literal 0 HcmV?d00001 diff --git a/case/base_case.py b/case/base_case.py new file mode 100644 index 0000000..57b4256 --- /dev/null +++ b/case/base_case.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/22 13:15:47 +""" + +from method.assert_method import AssertMethod + + +class BaseCase(AssertMethod): + """用例基类""" diff --git a/case/test_mycase_001.py b/case/test_mycase_001.py new file mode 100644 index 0000000..462ea6c --- /dev/null +++ b/case/test_mycase_001.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/27 13:42:04 +""" +from case.base_case import BaseCase +from method.dde_autotest_euler_method import DdeAutotestEulerMethod + +class TestMyCase(BaseCase): + + def test_mycase_001(self): + """this is my test case title""" + # 用例步骤,调用方法层封装好的方法进行操作 + DdeAutotestEulerMethod().click_dde_file_manager_on_dock_by_attr() + # 在关键节点进行断言 + self.assert_true(True) diff --git a/case/test_mycase_002.py b/case/test_mycase_002.py new file mode 100644 index 0000000..7f7b047 --- /dev/null +++ b/case/test_mycase_002.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/27 13:42:04 +""" +from case.base_case import BaseCase +from youqu3 import sleep +from youqu3.gui import pylinuxauto + +class TestMyCase(BaseCase): + + def test_mycase_002(self, check): + """快捷键 ctrl + alt + t 启动终端""" + # 用例步骤,调用方法层封装好的方法进行操作 + pylinuxauto.ctrl_alt_t() + # 在关键节点进行断言 + # 等待 2 秒,判断终端是否启动 + sleep(2) + check.asset_true(True) diff --git a/config.py b/config.py new file mode 100644 index 0000000..5b8744b --- /dev/null +++ b/config.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/22 13:15:47 +""" + +import pathlib +import os + + +class _Config: + ROOTDIR = pathlib.Path(__file__).parent + ASSERT_RES = ROOTDIR / "case/assert_res" + IMAGE_RES = ROOTDIR / "method/image_res" + STATIC_RES = ROOTDIR / "method/static_res" + BASE_PATH = os.getcwd() + + +config = _Config() diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..a0b0c1a --- /dev/null +++ b/conftest.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/22 13:15:47 +""" + +import pytest + +# fixtures diff --git a/env.sh b/env.sh new file mode 100644 index 0000000..77deca0 --- /dev/null +++ b/env.sh @@ -0,0 +1,7 @@ +python3-pyatspi + +pyscreenshot + + +python3-pillow +xdotool \ No newline at end of file diff --git a/method/__init__.py b/method/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/method/assert_method.py b/method/assert_method.py new file mode 100644 index 0000000..a7f221c --- /dev/null +++ b/method/assert_method.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/22 13:15:47 +""" + +from dbus.decorators import method +from youqu3.assertx import Assert +from config import config + + +class AssertMethod(Assert): + """AssertMethod""" + + @classmethod + def assert_image_exist_in_dde(cls, img_name, rate=0.8): + cls.assert_image_exist(f"{config.ASSERT_RES}/{img_name}", rate=rate) + + @classmethod + def assert_image_not_exist_in_dde(cls, img_name, rate=0.8): + cls.assert_image_not_exist(f"{config.ASSERT_RES}/{img_name}", rate=rate) diff --git a/method/base_method.py b/method/base_method.py new file mode 100644 index 0000000..568b87c --- /dev/null +++ b/method/base_method.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/22 13:15:47 +""" + + +class BaseMethod: + """应用的方法基类""" diff --git a/method/dde_autotest_euler_method.py b/method/dde_autotest_euler_method.py new file mode 100644 index 0000000..7cd0907 --- /dev/null +++ b/method/dde_autotest_euler_method.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/22 13:15:47 +""" + +from time import sleep + +from dnf.yum.misc import import_key_to_pubring +from funnylog2.config import config as funnylog2_config + +funnylog2_config.CLASS_NAME_ENDSWITH = ["Method"] + +from youqu3 import log +from youqu3.gui import pylinuxauto +from config import config +from method.base_method import BaseMethod + + +@log +class DdeMethod(BaseMethod): + """应用方法主类""" + + def dde_method_click_dde_file_manager_on_dock_by_attr(self): + """在任务栏点击文件管理器""" + pylinuxauto.find_element_by_attr_path("/dde-dock/Btn_文件管理器").click() + + def dde_method_click_by_ocr(self, text): + pylinuxauto.find_element_by_ocr(text).click() + + def dde_method_click_by_attr(self, PATH): + pylinuxauto.find_element_by_attr_path(PATH).click() + + def dde_method_click_by_img(self, img_name): + pylinuxauto.find_element_by_image(f"{config.IMAGE_RES}/{img_name}").click() + + def dde_method_click_launcher_on_dock_by_attr(self): + DdeMethod().dde_method_click_by_attr( + "/dde-dock/Form_mainwindow/Btn_mainpanelcontrol/Form_fixedarea/Btn_launcheritem" + ) + + def dde_method_search_software_in_dock(self): + DdeMethod().dde_method_click_launcher_on_dock_by_attr() + DdeMethod().dde_method_click_by_attr( + "/dde-launcher/Form_windowedframe/Form_rightwidget/Form_searcheredit/Editable_dlineeditchildlineedit" + ) + + def dde_method_click_all_categories_in_launcher(self): + DdeMethod().dde_method_click_launcher_on_dock_by_attr() + DdeMethod().dde_method_click_by_attr( + "/dde-launcher/Form_windowedframe/Form_rightwidget/Btn_switchbtn/AllIcon" + ) + + def dde_method_click_back_in_all_categories_view(self): + DdeMethod().dde_method_click_by_attr( + "/dde-launcher/Form_windowedframe/Form_rightwidget/Btn_switchbtn/AllIcon" + ) + + def dde_method_click_system_manager_in_all_categories_view(self): + DdeMethod().dde_method_click_by_img("system_manager_in_all_categories_view.png") + + def dde_method_open_control_center_by_dock(self): + pylinuxauto.find_element_by_attr_path("/dde-dock/Btn_控制中心").click() + + def dde_method_click_keyboard_and_language_in_control_center(self): + pylinuxauto.find_element_by_attr_path( + "/dde-control-center/DMainWindow/contentwindow/键盘和语言" + ).click() + + def dde_method_click_keyboard_layout_in_control_center(self): + DdeMethod().dde_method_click_by_attr( + "/dde-control-center/DMainWindow/contentwindow/Form_modulepage/Form_keyboardwidget/List_keyboardlist/键盘布局" + ) + + def dde_method_close_control_center_by_window(self): + DdeMethod().dde_method_click_by_img("close_window_btn.png") + + def dde_method_add_keyboard_layout_in_control_center(self): + DdeMethod().dde_method_open_control_center_by_dock() + sleep(3) + DdeMethod().dde_method_click_keyboard_and_language_in_control_center() + DdeMethod().dde_method_click_keyboard_layout_in_control_center() + DdeMethod().dde_method_click_by_attr( + "/dde-control-center/DMainWindow/contentwindow/Form_modulepage/Form_kblayoutsettingwidget/Btn_addlayout" + ) + DdeMethod().dde_method_click_by_attr( + "/dde-control-center/DMainWindow/contentwindow/Form_modulepage/ContentWidget_contentArea/TranslucentFrame/List_keyboardmenulist/汉语" + ) + DdeMethod().dde_method_click_by_attr( + "/dde-control-center/DMainWindow/contentwindow/Form_modulepage/ContentWidget_contentArea/ButtonTuple/Btn_添加" + ) + + + + +if __name__ == "__main__": + sleep(3) + DdeMethod().dde_method_close_control_center_by_window() \ No newline at end of file diff --git a/method/image_res/README.md b/method/image_res/README.md new file mode 100644 index 0000000..5239ba2 --- /dev/null +++ b/method/image_res/README.md @@ -0,0 +1,3 @@ +# image_res + +用于图像识别定位的图片资源 \ No newline at end of file diff --git a/method/image_res/close_window_btn.png b/method/image_res/close_window_btn.png new file mode 100644 index 0000000000000000000000000000000000000000..fd0dc5fe7e2499cca7b31c347d0d750f404d1b8a GIT binary patch literal 357 zcmV-r0h<1aP)zlud2|F${&DLk@-5b%k0XkZ9o=L(MIa2tW4#Q6Vvd zRJGmo=TJyxk(puaNj5MGB5z{9e0s8z(8KH>H!n+cI|SA=0BOpLf*hv+(49vQ1OPLxgHPx?Gn{p-NeSaLxguq`eUERDe>xBvTfMcd+nc2=(YK@-qj9 zAsi&)gIMXQ=c2c6|0=c~@kv})>b_K?zto5?!(nlM5%uym5!=BsqN`83j1u8pcxX%< z?(R+^hO2zLn*_urIO%O75Z^5(;JE;8laLqHr;SAX*h@QK)_G}@=YT(2pwUXtsC{w({%qi0!~`^6H}Tiq@h^2Pr3uU#;p0r4nU5xF00000NkvXXu0mjf DcrcW= literal 0 HcmV?d00001 diff --git a/method/image_res/delete_keyboard_layout_icon.png b/method/image_res/delete_keyboard_layout_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ed7c7ae9e36104cf3902d83841846fad365ca659 GIT binary patch literal 374 zcmV-+0g3*JP)Tlsk@tFc5~vkL{CG;Q*K$fCP8&EmGw?X>tn0A$VK? zr-v$Ok=BnbkQS4SysVPHLZkV=`90D=rfGurMBns(2EoxP83xw2R4H=51AsdmtPm#4 zTofVA&%4l?mnCZ&aPB2BHF>V31il))Mri$Yz0%t)5ZlJ__vz$QR=eP38TJDJRf<>D zsF$Yg^>~sH|mOhajj@oBVTg-~WCuTOp6fs_Sxj_MOjYv$sw{ zwx{s5q;R{Pza)R=tK5E%q_9G4pKOx^L6|H9y6t2rHED_Y46+%ntSFkgyDpuEEEt0<|w3NVD5HVNBk#!yI`{me^#H6X8{}05!^nt(D52jjp UNXvR|oB#j-07*qoM6N<$g3M5&zW@LL literal 0 HcmV?d00001 diff --git a/method/static_res/README.md b/method/static_res/README.md new file mode 100644 index 0000000..b95a396 --- /dev/null +++ b/method/static_res/README.md @@ -0,0 +1,3 @@ +# static_res + +用例执行需要用到的测试资源 \ No newline at end of file diff --git a/method/ui.ini b/method/ui.ini new file mode 100644 index 0000000..d4ba153 --- /dev/null +++ b/method/ui.ini @@ -0,0 +1,14 @@ +[播放按钮] +direction = left_bottom +location = 0, 0, 0, 0 + +# section 是你根据对应的元素按钮命名,你可以任意命名,但最好有具体含义,且能明确表示这个元素按钮的名称; + +# direction 是配置该元素的参考系,分别为: +# left_top 左上 +# left_bottom 左下 +# right_top 右上 +# right_bottom 右下 + +# location 是该元素按钮的相对与参考系的x, y的距离,及大小(w, h),这四个数据可以通过 UI 设计图上 +# 获取数据,在编辑模式下,点击 UI 图上的按钮,右侧就会出现该元素按钮的x, y, w, h数据。 diff --git a/mycase.csv b/mycase.csv new file mode 100644 index 0000000..6ecae0b --- /dev/null +++ b/mycase.csv @@ -0,0 +1,3 @@ +脚本ID,跳过原因,确认修复,废弃用例 +test_euler_104633, +002, diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..fb20844 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,18 @@ +[pytest] +addopts = + -s + --no-header + --verbosity=2 + --show-capture=no + --reruns-delay=1 + --color=auto + --code-highlight=yes + --tb=auto + -r fEs + --continue-on-collection-errors +filterwarnings = + ignore + ignore::UserWarning + ignore:.*U.*mode is deprecated:DeprecationWarning + +console_output_style = count diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1d57132 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +-i https://pypi.tuna.tsinghua.edu.cn/simple + +youqu3[gui] \ No newline at end of file diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..d1a61de --- /dev/null +++ b/ruff.toml @@ -0,0 +1,90 @@ +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + ".idea", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", +] + +# Same as Black. +line-length = 100 +indent-width = 4 + +# Assume Python 3.7 +target-version = "py37" + +[lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = ["E4", "E7", "E9", "F"] +ignore = [ + "E402", + "E711", + "E721", + "E722", + "E731", + "E712", + "F401", + "F403", + "F507", + "F541", + "F841", +] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[format] +# Like Black, use double quotes for strings. +quote-style = "double" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" + +# Enable auto-formatting of code examples in docstrings. Markdown, +# reStructuredText code/literal blocks and doctests are all supported. +# +# This is currently disabled by default, but it is planned for this +# to be opt-out in the future. +docstring-code-format = false + +# Set the line length limit used when formatting code snippets in +# docstrings. +# +# This only has an effect when the `docstring-code-format` setting is +# enabled. +docstring-code-line-length = "dynamic" \ No newline at end of file -- Gitee