├── .github ├── ISSUE_TEMPLATE │ ├── report-issue.md │ ├── report-issue.yml │ └── together-we-build.md └── workflows │ ├── build_qpt.yml │ └── issue.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── MANIFEST.in ├── QPTSFX ├── QPTSFX.cpp ├── QPTSFX.sln ├── QPTSFX.vcxproj ├── QPTSFX.vcxproj.filters └── QPTSFX.vcxproj.user ├── README.MD ├── RELEASE.MD ├── ReleaseTips.md ├── ToDo.MD ├── ago ├── CSharp │ └── launcher │ │ ├── Program.cs │ │ ├── launcher.csproj │ │ └── launcher.sln ├── Debug-收集Debug信息.cmd ├── clr │ └── progressbar.py └── compile │ └── 7z │ ├── 7z.exe │ └── sfx │ └── 7zsd_All_x64.sfx ├── examples ├── advanced │ ├── 使用SubModule添加自定义whl.md │ ├── 增加CUDA的支持.md │ ├── 打包依赖复杂的Python程序.MD │ ├── 打包兼容性更强的Python解释器.md │ ├── 收集用于Debug的用户日志.md │ ├── 更换镜像源.md │ └── 隐藏控制台窗口.md ├── paddle_sandbox │ ├── create_paddle_module.py │ ├── paddle_program │ │ └── run.py │ └── run_paddle_module.py └── sample_sandbox │ ├── create_sample_module.py │ ├── run_sample_module.py │ └── sample_program │ ├── run.py │ └── sample.jpg ├── ext ├── img │ └── jetbrains.png └── rc │ └── 2023.png ├── informal_essay └── README.md ├── pyenv_sdk └── 此处待添加子仓库 ├── qpt ├── RELEASE ├── __init__.py ├── command.py ├── executor.py ├── ext │ ├── ico │ │ └── Logo.ico │ ├── launcher │ │ ├── Main.exe │ │ ├── compatibility_mode.cmd │ │ └── configs │ │ │ └── README.TXT │ ├── launcher_debug │ │ ├── Debug-打印已安装的软件包列表.cmd │ │ ├── Debug-进入Python环境.cmd │ │ ├── Debug-进入虚拟环境.cmd │ │ ├── Debug.exe │ │ └── compatibility_mode.cmd │ └── launcher_entry │ │ ├── entry_debug.cmd │ │ ├── entry_run.cmd │ │ └── entry_run_hidden.cmd ├── gui │ ├── MFC.py │ └── tk_progressbar.py ├── kernel │ ├── __init__.py │ ├── qcode.py │ ├── qinterpreter.py │ ├── qlog.py │ ├── qos.py │ ├── qpackage.py │ ├── qpe.py │ └── qterminal.py ├── memory.py ├── modules │ ├── __init__.py │ ├── auto_requirements.py │ ├── base.py │ ├── cuda.py │ ├── kernel_dependency.txt │ ├── kernel_dependency_GUI.txt │ ├── package.py │ ├── paddle_family.py │ ├── python_env.py │ ├── qpt_lazy_dependency.txt │ └── tools │ │ ├── __init__.py │ │ └── check_paddle_noavx.py ├── run_wrapper.py ├── smart_opt.py └── version.py ├── setup.py └── unit_test ├── cli.py ├── debug_module.py ├── input_test ├── b_input.py └── s_teriminal.py ├── run_ext_test.py ├── run_test.py ├── sanbox_pdm ├── .pdm.toml ├── main.py ├── pdm.lock ├── pyproject.toml └── qpt2exe.py ├── sandbox ├── requirements_with_opt.txt └── run.py ├── sandbox_m ├── .idea │ └── test.py ├── Logo.ico ├── requirements_with_opt.txt ├── run.py └── venv │ ├── pyvenv.cfg │ └── vvvv │ └── test.py ├── sandbox_opencv ├── jetbrains.png ├── requirements_with_opt.txt └── run.py ├── sandbox_paddle_gpu ├── requirements_with_opt.txt └── run.py ├── sandbox_paddleocr ├── 1.jpg ├── favicon.ico ├── qpt2exe.py ├── requirements_with_opt.txt └── run.py ├── sandbox_paddlex ├── requirements_with_opt.txt └── run.py ├── sandbox_qt ├── requirements_with_opt.txt └── run.py ├── sandbox_qt_paddle └── run.py └── sandbox_tk ├── requirements_with_opt.txt └── run.py /.github/ISSUE_TEMPLATE/report-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: [高阶Issue]Report issue 3 | about: 我确定这是个Bug or 遇到了报错/使用问题 4 | title: "[Report]" 5 | labels: Report 6 | assignees: GT-ZhangAcer 7 | 8 | --- 9 | 10 | **简要描述Bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **基本信息** 14 | QPT版本:(如非最新版本,请优先进行升级,不接受测试版issue) 15 | 操作系统版本:(目前仅接受Windows 10 1607+的操作系统,不接受WindowsXP、7、8的Issue) 16 | CPU型号或AVX支持情况: 17 | 18 | **复现步骤/报错截图** 19 | 步骤描述: 20 | Requirements文件内容: 必须 21 | ``` 22 | ↓建议在此处粘贴完整Requirements(Python第三方依赖)列表信息↓ 23 | 24 | ↑建议在此处粘贴完整Requirements(Python第三方依赖)列表信息↑ 25 | ``` 26 | 完整打包日志: 必须 27 | ``` 28 | ↓建议在此处粘贴完整日志↓ 29 | 30 | ↑建议在此处粘贴完整日志↑ 31 | ``` 32 | 33 | 完整运行日志:(如打包时已报错,此处可选) 34 | ``` 35 | ↓建议在此处粘贴完整日志↓ 36 | 37 | ↑建议在此处粘贴完整日志↑ 38 | ``` 39 | 40 | # 以上信息请务必提供,如未提供以上信息,该issue将默认忽略+close,不做任何支持,需要您的配合。 41 | 42 | **我的建议** 43 | A clear and concise description of what you expected to happen. 44 | 45 | 46 | **其他** 47 | Add any other context about the problem here. 48 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/report-issue.yml: -------------------------------------------------------------------------------- 1 | name: "[标准Issue]Report issue" 2 | title: "[Report]→请在此处填写Issue标题←" 3 | description: "我确定这是个Bug or 遇到了报错/使用问题" 4 | labels: [Report] 5 | assignees: 6 | - GT-ZhangAcer 7 | 8 | body: 9 | - type: markdown 10 | attributes: 11 | value: > 12 | ## Issue创建指南 13 | 14 | Hi开发者,当您在使用QPT时如遇到了报错或无法正常使用的问题时,可以通过该模板进行构建,社区维护者将对符合模板要求的Issue进行回复与技术支持,并不会对不符合要求的Issue进行答复,请悉知。 15 | 16 | 当然,该项目仅为社区作品,无团队组织、无直接经济收益,并不会为所有使用者保证其质量,无论是否参与捐赠,交流时还请注意开源礼仪。 17 | - type: input 18 | id: "QPT_Version" 19 | attributes: 20 | label: "QPT版本" 21 | description: "请提供您所使用的QPT详细版本号,可选择pip中提供的版本进行填写。" 22 | placeholder: "例如1.0b1.dev0" 23 | validations: 24 | required: true 25 | - type: dropdown 26 | id: "OS_Version" 27 | attributes: 28 | label: "操作系统版本" 29 | description: "请填写您遇到问题的操作系统版本" 30 | multiple: false 31 | options: 32 | - Windows 11 33 | - Windows 10 34 | - Windows 8 35 | - Windows 7 36 | - Windows XP 37 | - 非上述版本,将在核心信息中提供 38 | validations: 39 | required: true 40 | - type: textarea 41 | id: "Kernel_Info" 42 | attributes: 43 | label: "核心信息填写" 44 | value: > 45 | **复现步骤/报错截图** 46 | 47 | ## 步骤描述 48 | 49 | (可描述您参考了哪些文档中的步骤,或自己在做哪些操作时遇到了问题,社区维护者可以通过该描述来尽可能复现您的情况) 50 | 51 | ## 【如报错则必须提供】Requirements文件内容 52 | 53 | ``` 54 | 55 | ↓建议在此处粘贴完整Requirements(Python第三方依赖)列表信息↓ 56 | 57 | Example: 58 | 59 | paddlepaddle==2.2.2 60 | 61 | opencv-python>=4.1 62 | 63 | ... 64 | 65 | ↑建议在此处粘贴完整Requirements(Python第三方依赖)列表信息↑ 66 | 67 | ``` 68 | 69 | ## 【如报错则必须提供】完整打包日志 70 | 71 | ``` 72 | 73 | ↓建议在此处粘贴完整日志↓ 74 | 75 | ↑建议在此处粘贴完整日志↑ 76 | 77 | ``` 78 | 79 | ## 完整运行日志(如打包时已报错,此处可选) 80 | 81 | ``` 82 | 83 | ↓建议在此处粘贴完整日志↓ 84 | 85 | ↑建议在此处粘贴完整日志↑ 86 | 87 | ``` 88 | 89 | ## 其他信息 90 | 91 | 92 | validations: 93 | required: true 94 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/together-we-build.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Together We Build 3 | about: 共同建设社区,提出建议/代码贡献请求 4 | title: "[TWB]" 5 | labels: 社区建设 6 | assignees: GT-ZhangAcer 7 | 8 | --- 9 | 10 | ## Issue类型 11 | 建议/意见/反馈 or 代码贡献请求 12 | 13 | ## 我的想法 14 | 15 | ## 期待的回应 16 | -------------------------------------------------------------------------------- /.github/workflows/build_qpt.yml: -------------------------------------------------------------------------------- 1 | # This workflow will upload a Python Package using Twine when a release is created 2 | # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries 3 | 4 | # This workflow uses actions that are not certified by GitHub. 5 | # They are provided by a third-party and are governed by 6 | # separate terms of service, privacy policy, and support 7 | # documentation. 8 | 9 | name: QPT Whl Build 10 | 11 | on: 12 | release: 13 | types: [published] 14 | workflow_dispatch: 15 | 16 | jobs: 17 | deploy: 18 | runs-on: ubuntu-latest 19 | 20 | steps: 21 | - uses: actions/checkout@v2 22 | - name: Set up Python 23 | uses: actions/setup-python@v2 24 | with: 25 | python-version: '3.x' 26 | - name: Install dependencies 27 | run: | 28 | python -m pip install --upgrade pip 29 | pip install build 30 | - name: Build package 31 | run: python -m build 32 | - name: Publish package 33 | uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 34 | with: 35 | user: __token__ 36 | password: ${{ secrets.PYPI_API_TOKEN }} 37 | -------------------------------------------------------------------------------- /.github/workflows/issue.yml: -------------------------------------------------------------------------------- 1 | name: Issue info 2 | 3 | on: [issues] 4 | 5 | jobs: 6 | greeting: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/first-interaction@v1 10 | with: 11 | repo-token: ${{ secrets.GITHUB_TOKEN }} 12 | issue-message: "Hi,开发者朋友,鉴于您是首次在QPT下新增Issue,请务必参考给定的Issue模板进行Issue的新增。\n 虽然形如版本号、打包日志等信息可能对你并不重要,但如未提供则可能会严重拖慢Issue的解决效率,因为他们对于QPT的维护者而言非常重要!\n 如您未按Issue模板进行内容补充,可关闭此Issue或Edit该Issue,社区维护者会对低效Issue直接Close,请悉知!" 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | # build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | CCCC. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # 贡献方式 2 | 直接提PR就好,欢迎贡献 3 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include qpt * 2 | include README.MD 3 | -------------------------------------------------------------------------------- /QPTSFX/QPTSFX.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | // 切记,不能是64位,不然PE不好修改了 - 项目->属性->C/C++->代码生成->运行库->多线程MT 6 | // 无窗口模式 7 | #pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" ) 8 | 9 | int main(int argc, char** argv) { 10 | 11 | struct stat buffer; 12 | const char *configsFile = ".\\configs\\entry.cmd"; 13 | if (stat(configsFile, &buffer) != 0) { 14 | MessageBox(NULL, TEXT("QPT:configs文件夹存在文件缺失,已终止!"), TEXT("执行失败 - QPT封装工具"), MB_OK | MB_ICONSTOP); 15 | return 1; 16 | }; 17 | //配置UTF-8 18 | SetConsoleCP(CP_UTF8); 19 | SetConsoleOutputCP(CP_UTF8); 20 | 21 | string shell = "cmd /c configs\\entry.cmd"; 22 | if (argc > 1) { 23 | std::string subShell = " "; 24 | for (int i = 1; i < argc; i++) { 25 | subShell += "QPT_ARGS_FLAG\"" + string(argv[i]) + "\""; 26 | } 27 | shell += subShell; 28 | } 29 | else { 30 | shell += " QPT_ARGS_FLAG"; // DOS命令是我琢磨不透的东西,这个地方还是有个符号占位吧 - 下个版本用%* 31 | }; 32 | 33 | WinExec(shell.c_str(), SW_HIDE); 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /QPTSFX/QPTSFX.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31911.196 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QPTSFX", "QPTSFX.vcxproj", "{A772E599-71CD-4317-B1D8-BB435896281D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {A772E599-71CD-4317-B1D8-BB435896281D}.Debug|x64.ActiveCfg = Debug|x64 17 | {A772E599-71CD-4317-B1D8-BB435896281D}.Debug|x64.Build.0 = Debug|x64 18 | {A772E599-71CD-4317-B1D8-BB435896281D}.Debug|x86.ActiveCfg = Debug|Win32 19 | {A772E599-71CD-4317-B1D8-BB435896281D}.Debug|x86.Build.0 = Debug|Win32 20 | {A772E599-71CD-4317-B1D8-BB435896281D}.Release|x64.ActiveCfg = Release|x64 21 | {A772E599-71CD-4317-B1D8-BB435896281D}.Release|x64.Build.0 = Release|x64 22 | {A772E599-71CD-4317-B1D8-BB435896281D}.Release|x86.ActiveCfg = Release|Win32 23 | {A772E599-71CD-4317-B1D8-BB435896281D}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {B60B6C2A-1764-4FEB-BDE3-B1946E9E5464} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /QPTSFX/QPTSFX.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {a772e599-71cd-4317-b1d8-bb435896281d} 25 | QPTSFX 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v143 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v143 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v143 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v143 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | 76 | 77 | false 78 | 79 | 80 | true 81 | 82 | 83 | false 84 | 85 | 86 | 87 | Level3 88 | true 89 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 90 | true 91 | 92 | 93 | Console 94 | true 95 | 96 | 97 | 98 | 99 | Level3 100 | true 101 | true 102 | true 103 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 104 | true 105 | /utf-8 %(AdditionalOptions) 106 | MultiThreaded 107 | 108 | 109 | Console 110 | true 111 | true 112 | true 113 | 114 | 115 | 116 | 117 | Level3 118 | true 119 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 120 | true 121 | 122 | 123 | Console 124 | true 125 | 126 | 127 | 128 | 129 | Level3 130 | true 131 | true 132 | true 133 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 134 | true 135 | stdc11 136 | MultiThreaded 137 | 138 | 139 | Console 140 | true 141 | true 142 | true 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /QPTSFX/QPTSFX.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 23 | 24 | 头文件 25 | 26 | 27 | 28 | 29 | 资源文件 30 | 31 | 32 | 33 | 34 | 资源文件 35 | 36 | 37 | -------------------------------------------------------------------------------- /QPTSFX/QPTSFX.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | # QPT - Python程序模块化封装工具(Py转EXE) 2 | [![Downloads](https://static.pepy.tech/personalized-badge/qpt?period=total&units=international_system&left_color=grey&right_color=orange&left_text=Pypi%20User)](https://pepy.tech/project/qpt) 3 | ![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/GT-ZhangAcer/QPT?include_prereleases) 4 | ![GitHub forks](https://img.shields.io/github/forks/GT-ZhangAcer/QPT) 5 | ![GitHub Repo stars](https://img.shields.io/github/stars/GT-ZhangAcer/QPT) 6 | ![GitHub](https://img.shields.io/github/license/GT-ZhangAcer/QPT) 7 | ![](https://img.shields.io/badge/%E6%B7%B1%E5%BA%A6%E9%80%82%E9%85%8D-Win10_1806+-9cf) 8 | [![QQGroup](https://img.shields.io/badge/QQ群-1128826410-9cf?logo=tencent-qq&logoColor=000&logoWidth=15)](https://jq.qq.com/?_wv=1027&k=49HB5ymm) 9 | ![](https://img.shields.io/badge/%E5%8F%91%E8%B5%B7%E4%BA%BA-GTZhangAcer-9cf) 10 | 11 |

12 | 13 | 14 | [Gitee主页](https://gitee.com/GT-zhangacer/QPT) | [GitHub主页](https://github.com/GT-ZhangAcer/QPT) | [快速使用](https://github.com/QPT-Family/QPT#%E5%BF%AB%E9%80%9F%E4%BD%BF%E7%94%A8) | [进阶教程](https://github.com/QPT-Family/QPT#%E8%BF%9B%E9%98%B6%E4%BD%BF%E7%94%A8qpt) | [开发进度 GitHub Project](https://github.com/orgs/QPT-Family/projects/3/views/3?layout=board) | [踩坑笔记](https://github.com/QPT-Family/QPT/tree/开发分支/informal_essay) 15 | [社区&赞助支持](https://github.com/QPT-Family/QPT#%E7%A4%BE%E5%8C%BA%E6%94%AF%E6%8C%81) | [QPT SDK仓库](https://github.com/QPT-Family/QPT-SDK) 16 |

17 | 18 | # 项目停止更新 19 | > ~~因工作原因、个人健康状态,再加上硬盘坏了导致拓展Python环境的源码完全丢失(未开源是因为体积太大),项目恢复更新成本过高,故无法进行更新。~~ 20 | > 2024.4.23 硬盘再次坏掉,本项目停止更新 https://github.com/QPT-Family/QPT/issues/107 21 | 22 | 23 | QPT是一款致力于让**开源项目**更好通往互联网世界的Python项目打包工具,以此期望更多计算机用户能够分享开源的乐趣与价值。 24 | 在设计之初,我们发现较多深度学习开源项目仅能够在专业开发者手中运行,想要让普通人参与其中并非易事(CUDA支持、MKL、NoAVX支持等),故在灵活性和易用性上做出额外设计,使其更利于高阶开发者定制封装策略,也能够满足入门开发者基础封装需要。 25 | 26 | **QPT并非一天建成,涉及编译、性能的项目通常需要长时间建设,考虑到当前建设进度,建议使用时在指导下投入生产环境,以此避免被老板暴打hhh~** 27 | 28 | 如果对您有帮助,欢迎来点个⭐Star吧 29 | 30 | ### 版本说明 31 | #### EAP - The Early Access Program [更新日志](https://github.com/QPT-Family/QPT/releases) | [开发进度](https://github.com/orgs/QPT-Family/projects/3/views/3?layout=board) 32 | 33 | 当前版本为V1.0b7,该版本已放弃对Python3.7及更低版本支持,同时我们仍仅支持Windows10 1806+的适配(不支持MAC和Linux纯粹是维护不过来,而不支持低版本Windows是因为真的太难) 34 | 35 | `如在Win7中不能运行,可考虑在cmd中输入sfc/scannow修复系统进行解决,Win7+系统在输入前需添加DISM/Online/Cleanup-Image/RestoreHealth 或许还能有抢救的机会` 36 | 37 | * 使用QPT的优势 38 | ``` 39 | 【打包逻辑自由】默认打包不及预期,可通过自定义SubModule来让QPT来捕捉你的封装需求。 可参考 [进阶教程](https://github.com/QPT-Family/QPT#%E8%BF%9B%E9%98%B6%E4%BD%BF%E7%94%A8qpt) 40 | 【图形化/代码/命令打包】图形化界面是最易于使用的方式,同时支持代码控制打包逻辑,以及属于一行命令进行打包。(图形化打包方式正在建设中,预计V1.0a版本发布) 41 | 【源码形态自由】默认打包后源码可见,也可编译为pyd以保护源码内容。(源码可见也意味着可以使用git来帮助用户更新你的源代码) 42 | 【内置CUDA打包逻辑】深度学习项目有福了。(AMD的ROCm如果支持Windows,可及时通知我来加入适配) 43 | 【Debug与日志】提供几个实用的Debug工具以及日志系统,方便用户使用出现问题时更快追踪异常情况。 44 | 【EXE的体积/速度可定制】支持三种打包方式:秒安装、首次安装、在线安装三种方式,对应了三种:普通、较小、Mini三种打包体积,未来还将支持1M+大小的在线部署模块。 45 | ``` 46 | * QPT的缺陷 47 | ``` 48 | 【环境模拟】由于是“模拟”开发环境,所以相较传统打包对项目的规范程度有一定要求,越规范的项目越不容易出问题。(在努力想办法增加容错率了,在努力了,在努力了,打包中弹出的提示信息一定要多看几眼,每个字符都是血汗啊) 49 | 【依赖处理】QPT只会打包源码中出现的Python包,但如果该包的依赖部分书写不规范(当然,大部分Python包是规范的)则可能会出现依赖缺失的问题。若您没有Requirements文件,那么在QPT自动生成Requirements.txt文件后需要您确认依赖是否完备,否则可能会有依赖漏掉的情况。 50 | 【踩坑继承】您搭建项目时所踩下的坑,QPT在模拟时可能并不会自动打包进去,极端情况下仍需要您手动撰写SubModule来保证用户可以正常使用。 51 | 【仍在测试】当前版本并非正式版,所以会有坑,放心吧。 52 | 【兼容性】仅兼容Windows10 1806+,低版本Windows只能碰运气,Linux和MAC的适配还没新建文件夹。 53 | ``` 54 | 55 | ## 快速使用 56 | ### 安装/更新QPT到当前环境 57 | #### 安装 58 | * 通用方式:`python -m pip install qpt` 59 | * 国内推荐:`python -m pip install qpt -i https://mirrors.bfsu.edu.cn/pypi/web/simple` 60 | #### 更新 - 强烈建议先卸载后安装 61 | * Step1 卸载:`python -m pip uninstall qpt` 62 | * Step2 安装:`python -m pip install qpt` 63 | ### 开始打包 64 | 65 | #### 方式一、撰写打包脚本[推荐] 66 | * 撰写以下代码即可完成打包: 67 | 68 | ```python 69 | # 导入QPT 70 | from qpt.executor import CreateExecutableModule as CEM 71 | 72 | # -----关于路径的部分,强烈建议使用绝对路径避免出现问题----- 73 | module = CEM(work_dir="./sample_program", # [项目文件夹]待打包的目录,并且该目录下需要有↓下方提到的py文件 74 | launcher_py_path="./sample_program/run.py", # [主程序文件]用户启动EXE文件后,QPT要执行的py文件 75 | save_path="./out") # [输出目录]打包后相关文件的输出目录 76 | # requirements_file="auto" # [Python依赖]此处可填入依赖文件路径,也可设置为auto自动搜索依赖 77 | # hidden_terminal=False # [终端窗口]设置为True后,运行时将不会展示黑色终端窗口 78 | # interpreter_version=38 # [跨版本编译]填写38、39、310数字格式的版本号即可生成指定的环境 79 | # 好奇什么时候需要跨版本编译?可参考下方"进阶使用QPT"一节的《打包兼容性更强的Python解释器》 80 | # icon="your_ico.ico" # [自定义图标文件]支持将exe文件设置为ico/JPG/PNG等格式的自定义图标 81 | # 开始打包 82 | module.make() 83 | ``` 84 | #### 方式二、使用命令打包[快捷] 85 | 注意:使用命令打包的前提是当前**默认Python环境**中使用pip安装了`qpt`,否则可能存在形如`qpt不是内部或外部命令,也不是可运行的程序`的报错信息。此外,若需要自动搜索依赖,强烈建议将QPT安装在开发环境,并且在开发环境中执行QPT,因为QPT会在搜索文件的import和pip list进行比对来确保搜索结果精确。 86 | 87 | * 打开cmd/终端并输入以下命令即可完成打包: 88 | ```pwsh 89 | chcp 65001 90 | qpt.exe -f ./sample_program -p ./sample_program/run.py -s ./out -h False 91 | ``` 92 | > `chcp 65001` 命令可使得终端转为utf-8形式,避免出现编码问题 93 | 94 | * 完整命令列表可使用`qpt --help`获取: 95 | ```python 96 | Options: 97 | -f, --folder TEXT [项目文件夹]待打包的文件夹路径,该目录也应当为整个项目的根目录或工作目录,否则可能会导致出现找不到模块等P 98 | ython基础报错。 [required] 99 | -p, --py TEXT [主程序文件]待打包的主要Py脚本文件所在的路径,例如要yyy/xxx.py中xxx.py是需要打包的主要P 100 | ython文件,那么该处填写xxx.py即可。 [required] 101 | -s, --save TEXT [输出目录]打包后文件保存的路径。 [required] 102 | -r, --require TEXT [Python依赖]自动检测软件包依赖,填写auto后将会自动查找待打包的文件夹路径中所有py文件的impo 103 | rt使用情况,最终生成requirements文件 104 | 当然,也可传入requirements.txt文件路径,这样即可指定依赖列表进行安装。 105 | -h, --hidden BOOLEAN [终端窗口]是否隐藏全部终端窗口,若输入true或判定为真则隐藏全部Terminal窗口(适用于使用了PyQ 106 | T、TK等桌面级可视化程序),输入false或判定为否则不隐藏(适用于Console & 终端程序)。 107 | -i, --icon TEXT [自定义图标文件]传入自定义图标文件路径,为EXE设置属于你的图标样式,支持将exe文件设置为ico/JPG/PNG等格式的自定义图标。 108 | --help Show this message and exit. 109 | ``` 110 | 111 | ## 进阶使用QPT/FAQ 112 | - [x] [1. 更改QPT全局镜像源](examples/advanced/更换镜像源.md) 113 | - [x] [2. 隐藏运行时的终端窗口](examples/advanced/隐藏控制台窗口.md) 114 | - [x] [3. 能够更快定位用户问题的日志系统](examples/advanced/收集用于Debug的用户日志.md) 115 | - [x] [4. 增加CUDA加速模块](examples/advanced/增加CUDA的支持.md) 116 | - [x] [5. 打包兼容性更强的Python解释器](examples/advanced/打包兼容性更强的Python解释器.md) 117 | - [x] [6. 使用 SubModule 添加自定义 whl](examples/advanced/使用SubModule添加自定义whl.md) 118 | - [x] [7. 打包PaddleOCR、PaddleX等业务程序](https://aistudio.baidu.com/aistudio/projectdetail/3571518) 119 | - [x] [8. PaddleOCR和QPT的落地实战 via:@ITerydh](https://github.com/ITerydh/OCRandQPTandIS) 120 | 121 | 完整进阶使用文档详见[examples/advanced](examples/advanced) 122 | 123 | ## 高阶开发手册/项目贡献指南 124 | 预计V1.0RC版本发布 125 | ## 设计思想 126 | 还没来得及写,和Pyinstaller、Nutika、Czfreeze等打包工具思路不太一样。(他们几个的思路本来也不太一样哈哈哈) 127 | 128 | ## 社区相关 129 | ### 这些项目也在用 130 | 以下为内测初期QPT提供支持的开源项目,在此非常感谢这些作者与测试组用户为QPT提供的宝贵建议以及多次的调试与沟通,这也是QPT走向成熟的关键,同时也要感谢各位大佬~~在面对Bug时的不杀之恩。~~ 131 | 1. 交互式语义分割标注软件 - [PaddleCV-SIG/iann](https://github.com/PaddleCV-SIG/iann) 132 | 2. 景观健康效益辅助评估工具 - [JiehangXie/Landscape-Heath-Score](https://github.com/JiehangXie/Landscape-Heath-Score) 133 | 3. 团子翻译器-OCR部分 - [PantsuDango/Dango-Translator](https://github.com/PantsuDango/Dango-Translator) 134 | 135 | ### 社区支持 136 | 137 | #### 来一杯咖啡☕ 138 | 一杯咖啡提神醒脑,代码更新会更快更好! 139 | (不介意的话可以在请咖啡时加个备注,例如QPT项目+昵称,后续将更新至[支持与致谢](https://github.com/QPT-Family/.github/blob/%E5%BC%80%E5%8F%91%E5%88%86%E6%94%AF/%E6%94%AF%E6%8C%81%E8%87%B4%E8%B0%A2.MD)中) 140 | 141 | | 捐赠者 | 累计捐赠金额 | 赞助席位 | 142 | | --- | --- | --- | 143 | | | 5,000 .00 RMB | 金牌赞助席位 | 144 | | 社区ID 23\*\*\*\*770 | 200 .00 RMB | 银牌赞助席位 | 145 | | 上海大学 曾老师 | 200 .00 RMB | 银牌赞助席位 |赞助席位 | 146 | | [Viggo(wxbool)](https://github.com/wxbool) | 100 .00 RMB | 银牌赞助席位 | 147 | | [YaoFANGUK](https://github.com/YaoFANGUK) | 100 .00 RMB | 银牌赞助席位 | 148 | | 厦门大学 愚者 | 100 .00 RMB | 银牌赞助席位 | 149 | | 社区ID \*头 | 66 .00 RMB | 支持赞助席位 | 150 | | 社区ID iterhui | 50 .00 RMB | 支持赞助席位 | 151 | | 社区ID LFeightyFour | 23 .33 RMB | 支持赞助席位 | 152 | | 社区ID \*猪 | 20 .00 RMB | 支持赞助席位 | 153 | | 社区ID super松 | 20 .00 RMB | 支持赞助席位 | 154 | | 社区ID \*\*辉 | 20 .00 RMB | 支持赞助席位 | 155 | | 社区ID jerrychoices | 20 .00 RMB | 支持赞助席位 | 156 | | 社区ID 14\*\*\*\*650 | 10 .00 RMB | 支持赞助席位 | 157 | | 社区ID yangy996 | 10 .00 RMB | 支持赞助席位 | 158 | | 社区ID 未知 | 1 .00 RMB | 兴趣赞助席位 | 159 | 160 | 完整支持名单&规则详见[支持致谢.MD](https://github.com/QPT-Family/.github/blob/%E5%BC%80%E5%8F%91%E5%88%86%E6%94%AF/%E6%94%AF%E6%8C%81%E8%87%B4%E8%B0%A2.MD) 161 | 162 |

图片
163 | 164 | #### Jetbrains 全家桶支持 165 | 本项目开发所使用的IDE由[Jetbrains](https://jb.gg/OpenSource)支持。 166 |
https://jb.gg/OpenSource
167 | 168 | ### 开源协议 169 | 本项目使用GNU LESSER GENERAL PUBLIC LICENSE(LGPL)开源协议。 170 | #### Other情况 171 | 1. 形如使用QPT简单打包了自己的“强化学习小游戏”等操作,该情况无需申请QPT授权以及更换个人代码仓库完整的开源协议。 172 | 2. 若对QPT源代码进行了修改,尽管这些代码非恶意代码,但为了保证开发者和使用者权益和安全,在未取得QPT授权的情况下需要开源完整的源代码等LGPL协议中所要求的内容。 173 | -------------------------------------------------------------------------------- /RELEASE.MD: -------------------------------------------------------------------------------- 1 | # Release 更新日志 2 | 3 | ## 后续更新总体迁移至[https://github.com/QPT-Family/QPT/releases](https://github.com/QPT-Family/QPT/releases) 4 | 5 | ## V1.0b1 - 2021.7.26 6 | ### 常规迭代 7 | 1. 增加TK组件支持。当前版本中使用了完整Python包,LZMA标准64-64压缩后体积相较嵌入式版本增加10M左右,但提供了TK等非高频Python内置库的支持,同样pip也是满血状态。 8 | 2. 增加CUDA版本选择。当Requirements文件中`paddlapaddle-gpu`后无任何`postxxx`版本号时,默认不进行搜索,而且提示用户输入想要安装的CUDA版本。需要注意的是,该版本中仍不提供已安装的本地CUDA列表信息,此处可能需要多尝试几次才会熟悉。使用说明详见[增加CUDA模块 - 无需用户手动安装CUDA也可使用GPU加速](https://github.com/GT-ZhangAcer/QPT/blob/main/examples/advanced/%E5%A2%9E%E5%8A%A0CUDA%E7%9A%84%E6%94%AF%E6%8C%81.md) 9 | 3. 增加系统漏洞检测机制。在盗版/早期的Win7系统中,向用户提供的安装镜像可能不带有重要的运行库修补补丁,然而没有这些补丁会影响到Python的使用,在该版本中验性增加了检测机制,引导用户在遇到该问题时安装杀毒软件并修复系统漏洞。 10 | 4. 增加对临时目录运行检测。考虑到部分用户可能在使用打包后的软件时会直接在压缩软件里运行,这样可能会引起部分Python依赖库安装失败的情况,例如日常内鬼的OpenCV。在该版本中会向用户弹出警告框,以此劝他解压一下吧~ 11 | 5. 修改了Release文案。目的很简单,这次明确提示了这个警告框只会在自己的系统中运行! 12 | 6. 增加Logging统计模块。由于打包过程中可能会有很多的输出信息,若遇到了报错也可能会被忽略,在该版本中我们增加了统计模块,若打包中遇到了报错则会在打包尾声时告知开发者有了什么样的报错信息,并需要开发者进行确认。 13 | 7. copytree增加乞丐版进度条表示,这样就能清楚的认识到,不是卡了,真的不是卡了,是他在复制文件! 14 | 8. SubModule对opt目录下的op文件加判断。避免部分用户的“有损”压缩软件最后多造出了几个文件,然而这些文件会被QPT误以为是Op文件。 15 | 9. 增加在打包后默认弹出资源管理器的功能。作为一个懒人,实在是不想手动参加`此电脑->某盘->某文件夹->...->打包后的那个文件夹`这样频繁的找目录环节,该版本直接弹出,解决问题。 16 | 10. 加个全局安装状态。还在发愁用户在安装一半就关掉对话框吗?他可能以为软件卡了,抱着试试看的态度关掉了对话框,然后重新打卡时确又发现不对劲,它怎么没救了!救命啊!然后就找到了你,你也只能告诉他,重新解压!要删除之前的!要多等他一会儿!在这个版本中,大概率不用这样的操作了,因为如果第一次没有运行成功,后续仍会进行安装,直到他安装成功为止。 17 | ### Fix Bugs 18 | 1. 对用户名为空格的情况进行判断,避免临时文件释放至带有空格的用户名路径下 19 | 2. 对Terminal也设置环境变量,这样就能防止因用户本地安装了Conda家族产品而导致的“找不到入口”这样人畜无害但又精神污染的警告框。 20 | 3. 对BatchInstall模块速度进行优化,并不会像之前那样为了稳定而把Python包重新安装,毕竟现在Pip是满血的不是。 21 | 4. 对copytree增加freeze,避免打包了被打包的那个文件,然后反复套娃最终导致硬盘被噎住的可怜表情。 22 | 23 | ## V1.0a9 - 2021.7.12 24 | ### 重要更新 25 | 1. 增加PaddlePaddle的CUDA支持,CUDA支持方案为在打包时搜索开发者CUDA安装情况,抽取CUDA驱动至打包后的资源文件列表中,最后进行兼容性适配。该方案为QPT内测QQ群中赞同数量最高的方案。 26 | 2. 增加PaddlePaddle的增加自动的NoAVX的适配,10年前的老年台式机或许也可以跑深度学习啦~实测PaddleOCR也可以在这类旧平台上跑出1.5~4s的推理速度。 27 | 3. 增加了多个Debug小工具:快速进入Debug的Python环境、QPT环境以及收集Debug信息和打印当前pip list共4个小工具。 28 | 4. 增加PIPTools的强制模式,提升QPT下的pip的兼容性,再也不担心pip会认为0.18.0小于0.2.0啦~ 29 | 5. 在用户使用时加入UA获取,进一步保障安装顺利。 30 | 6. 修复可能来自已经安装的Python冲突。 31 | 7. 修复可能来自已经安装的Conda冲突。 32 | 8. 增加跨版本编译的功能,暂时未开放跨版本模式。 33 | 9. SubModule增加ExtModule支持,允许SubModule产出新的ExtModule。 34 | ### Fix Bug 35 | 1. 修复打包路径判断Bug,现在允许在被打包的源码文件夹中保存打包后的文件。 36 | 2. 修复在用户使用时仍会弹出的Release警告窗,现在只会对开发者进行警告。 37 | ### 不兼容更新 38 | 1. 由于1.0a8中取消了PyQT的依赖,在a9版本中也暂时移除了QTerminal。(希望没有人用到啊啊啊) 39 | 40 | ## V1.0a8 - 2021.7.4 41 | ### 重要更新 42 | 1. 在打包时增加“是否隐藏终端”的接口,若待打包的程序为PyQT、WxPython等含有可视化界面的程序,在不需要控制台/终端界面时可配置该接口进行隐藏。 43 | 当然,若本身为控制台/终端界面的程序,这个隐藏就会很令人抓狂,QPT默认该接口为“不隐藏”。[使用文档](https://github.com/GT-ZhangAcer/QPT/blob/main/examples/advanced/%E9%9A%90%E8%97%8F%E6%8E%A7%E5%88%B6%E5%8F%B0%E7%AA%97%E5%8F%A3.md) 44 | 2. Kernel中增加copytree忽略文件级别的功能,后续将在开发自定义OP时暴露该接口。 45 | 3. 修改了CIL部分的文案,同时增加hidden_terminal的指令。 46 | 4. 增加WPF、MFC的进度条 47 | 5. 增加Debug、Run、Run-Hidden三种运行模式,开发者在Debug时仍可获取全量输出信息,用户则只会感知重要信息输出。 48 | 6. 打包前会对路径做判断,避免出现.和空格路径. 49 | 7. 运行后会对路径做判断,若出现空格、中文等当前Windows兼容不完善的路径则会提示使用者更换目录。 50 | 8. 加入PaddleHub、PaddleNLP、PaddleSeg深度适配方案,保证用户在使用中文用户名时可以读取参数。 51 | 9. PaddlePaddle增加对非AVX版本安装适配。 52 | 10. 增加VC2019运行库支持。 53 | 11. 增加MFC运行库支持。 54 | 12. 增加日志系统,当用户使用出现问题时,可将configs/logs目录下日志信息收集,进而快速定位报错情况。 55 | 13. 自动控制Logging颜色,避免用户侧无法出现带有颜色的输出信息。 56 | 57 | ### Fix Bug 58 | 1. 修复了打包时传入的源文件路径与保存路径一致但没有报错的情况,当前若打包时两目录为同一目录则会raise一个报错信息,提示用户需要更改路径而不是强制覆盖文件。 59 | 2. 修复不同盘符打包可能出现失败的问题。 60 | 3. 修复了镜像源设置无效的问题。 61 | 62 | ### 不兼容更新 63 | 1. 进度条部分可能会从PyQT(约150M)更换为TK(25M 需要编译)、CLR+WPF(10M 难度较大)、Win32+MFC(0M 资料较少)三种方案中任一种,在选择hidden_terminal接口为False后将会取消所有依赖 64 | 2. 原none_gui接口更名为hidden_terminal,增加了可读性。 65 | 3. 调整目录结构,只保留exe与调试文件在目录外。 66 | 67 | ### 下个版本ToDO 68 | 1. 增加自定义图标接口 69 | 2. 增加CUDA支持 70 | 4. 取消PyQT作为必须依赖(可能需要重写自动化依赖搜索脚本) 71 | 5. 更新README 72 | 73 | Tips:在未来两个版本中,仍不会出现V1.0RC版本,待大量测试验证后发布1.0RC 74 | -------------------------------------------------------------------------------- /ReleaseTips.md: -------------------------------------------------------------------------------- 1 | # 发版贴士 2 | 3 | ## 1. 版本号 4 | ### 版本命名 5 | 正式版直接`x.y`数字命名,概念版为`x.ya`,测试版为`x.yb`,预览版`x.yrc`,开发版在后缀中增加.dev+数字。 6 | 必要时需要做pre-release。 7 | ### 版本写入 8 | 在`qpt.version`下写入最新版本号 9 | 10 | ## 2. 第三方Check 11 | ### PaddlePaddle 12 | #### 1.NoAVX 13 | 据说可能会修订地址,需要额外关注该情况,在预修改时通知全体开发者。 14 | #### 2.CUDA适配 15 | 1. 每次PaddlePaddle发版后需要第一时间确定默认版本号的CUDA版本,避免`modules.paddle_family.PaddlePaddlePackage`中发生异常 16 | 2。 CUDA目前只搜索到9-12+0-4版本,请注意最新CUDA驱动适配情况 17 | 18 | ## 3. 格式化代码 19 | 至少保证可以在LGTM中不出现Warning。 -------------------------------------------------------------------------------- /ToDo.MD: -------------------------------------------------------------------------------- 1 | ## b1.dev7 ToDo 2 | - [ ] 支持Conda版本的CUDA 3 | - [ ] 简单加密 4 | - [ ] OneFile 5 | - [ ] 重构Module管理器 6 | - [ ] 同目录打包 7 | - 8 | ## b1.dev5 ToDO 9 | - [x] 用户表示会有QPT找不到模块的情况,初步判断可能是环境变量的问题 10 | - [x] 重写依赖搜索 - Requirements里加QPT 过滤掉的包除去依赖后加入上去 11 | - [x] 修改依赖的文案 12 | - [x] 高兼容版本编译入口 13 | - [x] 增加37、39编译方案 14 | - [x] 提升路径判断机制,避免在特殊路径下解压 15 | - [x] 统一输出函数为Logging 16 | - [x] 统一终端环境为UTF-8而非GBK 17 | - [x] 增加跨应用调用支持 18 | - [x] 增加自定义图标 19 | - [x] Python部分解压到临时目录 20 | ## b1.dev6To 21 | - [x] 使用TK进度条,完全取消PyQT5依赖 22 | - [x] 内部更换CMD为PowerShell(外部下个版本更新) 23 | - [x] configs文件保存为二进制,360实在太笨了,文件里加base64就算是病毒也是服了,误报率不算KPI这是? 24 | - [x] 【实验性】解决多进程输出卡死 25 | - [x] Conda中打包可能存在~情况 https://github.com/QPT-Family/QPT/issues/22 26 | - [x] multiprocessing无限循环情况 https://github.com/QPT-Family/QPT/issues/23 27 | - [x] UA统一使用cmd开启 28 | - 29 | ## b2.dev3 30 | - [x] 增强pwsh兼容性 31 | - [ ] 增加CUDA选择 32 | - [ ] 文件夹重复问题还是没解决 - 以后统一迁移吧顺便支持个中文路径 33 | - [x] BS多次安装以及为什么wget还需要安装 34 | - [x] 增加PaddleOCR部署的文档/依赖列表的适配 35 | 36 | ## 下版本可能的ToDo 37 | - [ ] 增加多程序入口 38 | - [ ] 开发整体工具包迁移至smart_opt 39 | - [x] sys_info更改为sys_swap并增加warmup和mem 40 | - [ ] Debug状态文件删除,借助环境变量统一在sys_info注册 41 | - [ ] 增加进程锁 42 | - [ ] 增加pytorch的pip支持https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/win-64/ 43 | ## Other 44 | - [ ] 增加跨应用CLI的文档 45 | - [ ] Pyd支持 46 | - [ ] 增加防修改部分 - 增加安装状态文件+状态文件增加GUID+哈希校验 47 | - [ ] 增加跨平台需求 48 | - [ ] Requirements类缺乏前瞻性考虑,或增加互斥Module概念 49 | - [ ] 要不要杀进程 - PID互斥锁 50 | - [ ] EXE、txt、cmd加入QPT元素 51 | - [ ] QPT拓展名支持 52 | - [ ] 超轻量级在线环境部署能力 - 环境部分完全在线部署,可轻松控制在1M文件大小 53 | - [ ] QPT图形化封装界面 54 | - [ ] 自定义封装算子 - 提供自定义封装OP支持 55 | - [ ] Module集市 56 | - [ ] 增加多镜像源 57 | 58 | 59 | git config --global --unset url.https://hub.fastgit.org/.insteadof 60 | git config --global url."https://hub.fastgit.org/".insteadOf "https://github.com/" 61 | 62 | NVIDIA Kepler (GTX 600 series) and above 63 | AMD GCN 1st Gen (Radeon HD 7000 series) and above 64 | Intel Haswell (4th-gen core) HD Integrated Graphics and above 65 | 66 | Start-Process powershell -Verb runAs -NoNewWindow 67 | -------------------------------------------------------------------------------- /ago/CSharp/launcher/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Runtime.InteropServices; 5 | 6 | // Debug需要修改UseShellExecute和ConsoleHelper.hideConsole(); 7 | namespace QPTLauncher 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | //ConsoleHelper.hideConsole(); 14 | Process p = new Process(); 15 | Console.Title = "QPT-Debug"; 16 | Console.WriteLine("传入参数为:" + args); 17 | 18 | string launcherPath = Environment.CurrentDirectory; 19 | Console.WriteLine("当前目录为:" + launcherPath); 20 | 21 | string python_file_path = Path.Combine(launcherPath, @"Python/python.exe"); 22 | p.StartInfo.FileName = python_file_path; 23 | if (!File.Exists(python_file_path)) 24 | { 25 | ConsoleHelper.showConsole(); 26 | Console.WriteLine("未找到Python解释器,程序运行失败" ); 27 | Console.ReadKey(); 28 | } 29 | p.StartInfo.Arguments = "-c " + "\"import sys\n" + 30 | "sys.path.append('./Python')\n" + 31 | "sys.path.append('./Python/Lib/site-packages')\n" + 32 | "sys.path.append('./Python/Scripts')\n" + 33 | "import qpt.run as run\n\""; 34 | p.StartInfo.UseShellExecute = false; 35 | //p.StartInfo.UseShellExecute = true; 36 | p.StartInfo.CreateNoWindow = false; 37 | p.Start(); 38 | p.WaitForExit(); 39 | Console.ReadKey(); 40 | ////获取cmd窗口的输出信息 41 | //string result = p.StandardOutput.ReadToEnd(); 42 | //p.WaitForExit();//等待程序执行完退出进程 43 | //p.Close(); 44 | //Console.WriteLine(result); 45 | //Console.ReadKey(); 46 | } 47 | } 48 | } 49 | 50 | 51 | public static class ConsoleHelper 52 | { 53 | [System.Runtime.InteropServices.DllImport("user32.dll", SetLastError = true)] 54 | private static extern IntPtr FindWindow(string lpClassName, string lpWindowName); 55 | 56 | [DllImport("user32.dll", SetLastError = true)] 57 | private static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow); 58 | public static void hideConsole(string ConsoleTitle = "QPT-Release") 59 | { 60 | ConsoleTitle = String.IsNullOrEmpty(ConsoleTitle) ? Console.Title : ConsoleTitle; 61 | IntPtr hWnd = FindWindow("ConsoleWindowClass", ConsoleTitle); 62 | if (hWnd != IntPtr.Zero) 63 | { 64 | ShowWindow(hWnd, 0); 65 | } 66 | } 67 | public static void showConsole(string ConsoleTitle = "QPT-Release") 68 | { 69 | ConsoleTitle = String.IsNullOrEmpty(ConsoleTitle) ? Console.Title : ConsoleTitle; 70 | IntPtr hWnd = FindWindow("ConsoleWindowClass", ConsoleTitle); 71 | if (hWnd != IntPtr.Zero) 72 | { 73 | ShowWindow(hWnd, 1); 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /ago/CSharp/launcher/launcher.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | QPTLauncher.Program 7 | false 8 | false 9 | GT_KEY.pfx 10 | GT 11 | QPT_launcher 12 | 13 | 14 | 15 | 1 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ago/CSharp/launcher/launcher.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30804.86 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "launcher", "launcher.csproj", "{4B4ACF4E-C48A-4C99-97C5-F277A1C7ECFA}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {4B4ACF4E-C48A-4C99-97C5-F277A1C7ECFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {4B4ACF4E-C48A-4C99-97C5-F277A1C7ECFA}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {4B4ACF4E-C48A-4C99-97C5-F277A1C7ECFA}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {4B4ACF4E-C48A-4C99-97C5-F277A1C7ECFA}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {007C89B2-2977-4B5B-A5BF-3FEB1916E081} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /ago/Debug-收集Debug信息.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | chcp 65001 3 | cd /d %~dp0 4 | set QPT_COLOR=False 5 | set QPT_MODE=Debug 6 | set PYTHONIOENCODING=utf-8 7 | set PYTHONUNBUFFERED=1 8 | set PYTHONPATH=Python/Lib/site-packages;Python/Lib;Python 9 | set PATH=Python/Lib/site-package;Python/Lib;Python;Python/Scripts;%PATH% 10 | set PROMPT=(QPT_VENV) %PROMPT% 11 | for /f "tokens=2 delims=:." %%a in ('"%SystemRoot%\System32\chcp.com"') do ( 12 | set _OLD_CODEPAGE=%%a 13 | ) 14 | if defined _OLD_CODEPAGE ( 15 | "%SystemRoot%\System32\chcp.com" 65001 > nul 16 | ) 17 | cls 18 | set /P VAR=该脚本会模拟您在点击启动程序时的所有操作,并记录下尽可能多的输出信息。因此在收集Debug信息前需要保证该文件下任何程序均出于全新未运行过的状态,若您在使用本Debug信息收集脚本前执行了本文件夹下的某些程序,请重新使用QPT打包后再启动这个收集脚本!需要注意的是,为了更好Debug该脚本会收集基本的系统和硬件信息,当然这些信息只会存储在configs目录下,其用途将由您决定。(按任意键同意收集) 19 | if defined _OLD_CODEPAGE ( 20 | "%SystemRoot%\System32\chcp.com" %_OLD_CODEPAGE% > nul 21 | set _OLD_CODEPAGE= 22 | ) 23 | 24 | set QPT_CONFIGS=./configs/ 25 | echo "Step1: Collecting Python package installation list" 26 | "./Python/python.exe" "-m" "pip" "list" > %QPT_CONFIGS%pip_list.txt 27 | 28 | echo "Step2: Collecting system info" 29 | Systeminfo > %QPT_CONFIGS%sys_info.txt 30 | 31 | echo "Step3: Collecting CPU and GPU info" 32 | wmic cpu > %QPT_CONFIGS%cpu_info.txt 33 | (for /f "tokens=1,2 delims==" %%a in ('wmic path Win32_VideoController get AdapterRAM^,Name /value^|findstr "AdapterRAM Name"') do echo %%a:%%b) > %QPT_CONFIGS%gpu_info.txt 34 | 35 | echo "Step4: Collecting env vars" 36 | set > %QPT_CONFIGS%env_vars_info.txt 37 | 38 | echo "Step5: Try running the QPT-Program" 39 | set QPT_COLOR=False 40 | set QPT_MODE=Debug 41 | "./Python/python.exe" 42 | 43 | echo "Step6: Collecting Python package installation list" 44 | "./Python/python.exe" "-m" "pip" "list" > %QPT_CONFIGS%pip_list_final.txt 45 | 46 | echo "All operations completed" 47 | pause 48 | -------------------------------------------------------------------------------- /ago/clr/progressbar.py: -------------------------------------------------------------------------------- 1 | # Author: Acer Zhang 2 | # Datetime:2021/6/27 3 | # Copyright belongs to the author. 4 | # Please indicate the source for reprinting. 5 | 6 | import clr 7 | 8 | clr.AddReference("PresentationFramework.Classic, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") 9 | clr.AddReference("PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") 10 | 11 | from System.Windows import Application 12 | from System.Windows import Window 13 | from System.Windows import LogicalTreeHelper 14 | from System.Windows.Markup import XamlReader 15 | from System.Threading import Thread 16 | from System.Threading import ApartmentState 17 | from System.Threading import ThreadStart 18 | from System import * 19 | 20 | __all__ = ["MainWindow", "main"] 21 | 22 | TITLE = "QPT Initializer - " 23 | KEYS_1 = [60, 59, 63, 18] # QPT 24 | KEYS_10 = [68, 48, 62, 18] # YES 25 | 26 | 27 | class MainWindow(Window): 28 | 29 | def __init__(self): 30 | Window.__init__(self) 31 | self.keys = [0, 0, 0, 0] 32 | xaml = """ 33 | 36 | 37 | 38 | 41 |