update project configuration and add development tools
- Add Python virtual environment patterns to .gitignore - Replace .codebuddy with .clinerules in .gitignore - Add .pid file for process tracking - Add comprehensive .pylintrc configuration for Python linting - Update start.bat with English translations and simplified functions
This commit is contained in:
188
.vscode/launch.json
vendored
Normal file
188
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,188 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "FutureOSS: 启动服务",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"module": "oss.cli",
|
||||
"args": ["serve"],
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false,
|
||||
"env": {
|
||||
"PYTHONPATH": "${workspaceFolder}",
|
||||
"PYTHONUNBUFFERED": "1"
|
||||
},
|
||||
"cwd": "${workspaceFolder}",
|
||||
"python": "${command:python.interpreterPath}"
|
||||
},
|
||||
{
|
||||
"name": "FutureOSS: 调试模式启动",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"module": "oss.cli",
|
||||
"args": ["serve", "--debug"],
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false,
|
||||
"env": {
|
||||
"PYTHONPATH": "${workspaceFolder}",
|
||||
"PYTHONUNBUFFERED": "1",
|
||||
"LOG_LEVEL": "DEBUG"
|
||||
},
|
||||
"cwd": "${workspaceFolder}",
|
||||
"python": "${command:python.interpreterPath}"
|
||||
},
|
||||
{
|
||||
"name": "FutureOSS: 运行测试",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"module": "pytest",
|
||||
"args": [
|
||||
"-v",
|
||||
"--tb=short",
|
||||
"--cov=oss",
|
||||
"--cov-report=html",
|
||||
"--cov-report=term"
|
||||
],
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false,
|
||||
"env": {
|
||||
"PYTHONPATH": "${workspaceFolder}"
|
||||
},
|
||||
"cwd": "${workspaceFolder}",
|
||||
"python": "${command:python.interpreterPath}"
|
||||
},
|
||||
{
|
||||
"name": "FutureOSS: 调试插件加载器",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/oss/plugin/loader.py",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false,
|
||||
"env": {
|
||||
"PYTHONPATH": "${workspaceFolder}",
|
||||
"PYTHONUNBUFFERED": "1"
|
||||
},
|
||||
"cwd": "${workspaceFolder}",
|
||||
"python": "${command:python.interpreterPath}"
|
||||
},
|
||||
{
|
||||
"name": "FutureOSS: 调试日志终端插件",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/store/@{FutureOSS}/log-terminal/main.py",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false,
|
||||
"env": {
|
||||
"PYTHONPATH": "${workspaceFolder}",
|
||||
"PYTHONUNBUFFERED": "1"
|
||||
},
|
||||
"cwd": "${workspaceFolder}",
|
||||
"python": "${command:python.interpreterPath}"
|
||||
},
|
||||
{
|
||||
"name": "FutureOSS: 调试WebUI",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/store/@{FutureOSS}/webui/main.py",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false,
|
||||
"env": {
|
||||
"PYTHONPATH": "${workspaceFolder}",
|
||||
"PYTHONUNBUFFERED": "1"
|
||||
},
|
||||
"cwd": "${workspaceFolder}",
|
||||
"python": "${command:python.interpreterPath}"
|
||||
},
|
||||
{
|
||||
"name": "FutureOSS: 调试HTTP API",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/store/@{FutureOSS}/http-api/main.py",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false,
|
||||
"env": {
|
||||
"PYTHONPATH": "${workspaceFolder}",
|
||||
"PYTHONUNBUFFERED": "1"
|
||||
},
|
||||
"cwd": "${workspaceFolder}",
|
||||
"python": "${command:python.interpreterPath}"
|
||||
},
|
||||
{
|
||||
"name": "FutureOSS: 调试WS API",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/store/@{FutureOSS}/ws-api/main.py",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false,
|
||||
"env": {
|
||||
"PYTHONPATH": "${workspaceFolder}",
|
||||
"PYTHONUNBUFFERED": "1"
|
||||
},
|
||||
"cwd": "${workspaceFolder}",
|
||||
"python": "${command:python.interpreterPath}"
|
||||
},
|
||||
{
|
||||
"name": "FutureOSS: 调试特定文件",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${file}",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false,
|
||||
"env": {
|
||||
"PYTHONPATH": "${workspaceFolder}",
|
||||
"PYTHONUNBUFFERED": "1"
|
||||
},
|
||||
"cwd": "${workspaceFolder}",
|
||||
"python": "${command:python.interpreterPath}"
|
||||
},
|
||||
{
|
||||
"name": "FutureOSS: 附加到进程",
|
||||
"type": "python",
|
||||
"request": "attach",
|
||||
"processId": "${command:pickProcess}",
|
||||
"host": "localhost",
|
||||
"port": 5678,
|
||||
"pathMappings": [
|
||||
{
|
||||
"localRoot": "${workspaceFolder}",
|
||||
"remoteRoot": "."
|
||||
}
|
||||
],
|
||||
"justMyCode": false
|
||||
},
|
||||
{
|
||||
"name": "FutureOSS: 运行CLI命令",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"module": "oss.cli",
|
||||
"args": ["${input:cliCommand}"],
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false,
|
||||
"env": {
|
||||
"PYTHONPATH": "${workspaceFolder}",
|
||||
"PYTHONUNBUFFERED": "1"
|
||||
},
|
||||
"cwd": "${workspaceFolder}",
|
||||
"python": "${command:python.interpreterPath}"
|
||||
}
|
||||
],
|
||||
"inputs": [
|
||||
{
|
||||
"id": "cliCommand",
|
||||
"type": "promptString",
|
||||
"description": "输入要执行的CLI命令(如:install, uninstall, list等)",
|
||||
"default": "help"
|
||||
}
|
||||
],
|
||||
"compounds": [
|
||||
{
|
||||
"name": "FutureOSS: 完整调试环境",
|
||||
"configurations": [
|
||||
"FutureOSS: 启动服务",
|
||||
"FutureOSS: 调试日志终端插件"
|
||||
],
|
||||
"stopAll": true
|
||||
}
|
||||
]
|
||||
}
|
||||
153
.vscode/settings.json
vendored
Normal file
153
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
{
|
||||
"python.defaultInterpreterPath": "/usr/bin/python3",
|
||||
"python.terminal.activateEnvironment": true,
|
||||
"python.terminal.activateEnvInCurrentTerminal": true,
|
||||
"python.analysis.extraPaths": [
|
||||
"${workspaceFolder}",
|
||||
"${workspaceFolder}/oss",
|
||||
"${workspaceFolder}/store/@{FutureOSS}"
|
||||
],
|
||||
"python.analysis.typeCheckingMode": "basic",
|
||||
"python.analysis.autoImportCompletions": true,
|
||||
"python.linting.enabled": true,
|
||||
"python.linting.pylintEnabled": true,
|
||||
"python.linting.pylintPath": "pylint",
|
||||
"python.linting.pylintArgs": [
|
||||
"--rcfile=${workspaceFolder}/.pylintrc"
|
||||
],
|
||||
"python.formatting.provider": "black",
|
||||
"python.formatting.blackPath": "black",
|
||||
"python.formatting.blackArgs": [
|
||||
"--line-length=88"
|
||||
],
|
||||
"python.testing.pytestEnabled": true,
|
||||
"python.testing.unittestEnabled": false,
|
||||
"python.testing.nosetestsEnabled": false,
|
||||
"python.testing.pytestPath": "pytest",
|
||||
"python.testing.pytestArgs": [
|
||||
"-v",
|
||||
"--tb=short",
|
||||
"--cov=oss",
|
||||
"--cov-report=html",
|
||||
"--cov-report=term"
|
||||
],
|
||||
"python.testing.cwd": "${workspaceFolder}",
|
||||
"debug.internalConsoleOptions": "neverOpen",
|
||||
"debug.javascript.usePreview": true,
|
||||
"debug.onTaskErrors": "showErrors",
|
||||
"debug.openDebug": "openOnDebugBreak",
|
||||
"debug.openExplorerOnEnd": false,
|
||||
"debug.saveBeforeStart": "allEditorsInActiveGroup",
|
||||
"debug.showInStatusBar": "always",
|
||||
"debug.toolBarLocation": "floating",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.organizeImports": "explicit"
|
||||
},
|
||||
"files.exclude": {
|
||||
"**/__pycache__": true,
|
||||
"**/.pytest_cache": true,
|
||||
"**/.coverage": true,
|
||||
"**/.mypy_cache": true,
|
||||
"**/.ruff_cache": true,
|
||||
"**/*.pyc": true,
|
||||
"**/.git": true,
|
||||
"**/.svn": true,
|
||||
"**/.hg": true,
|
||||
"**/CVS": true,
|
||||
"**/.DS_Store": true,
|
||||
"**/Thumbs.db": true,
|
||||
"**/node_modules": true
|
||||
},
|
||||
"files.watcherExclude": {
|
||||
"**/__pycache__/**": true,
|
||||
"**/.pytest_cache/**": true,
|
||||
"**/.git/**": true,
|
||||
"**/node_modules/**": true,
|
||||
"**/.venv/**": true
|
||||
},
|
||||
"search.exclude": {
|
||||
"**/__pycache__": true,
|
||||
"**/.pytest_cache": true,
|
||||
"**/.git": true,
|
||||
"**/node_modules": true,
|
||||
"**/.venv": true
|
||||
},
|
||||
"terminal.integrated.env.linux": {
|
||||
"PYTHONPATH": "${workspaceFolder}",
|
||||
"PYTHONUNBUFFERED": "1"
|
||||
},
|
||||
"terminal.integrated.defaultProfile.linux": "bash",
|
||||
"terminal.integrated.profiles.linux": {
|
||||
"bash": {
|
||||
"path": "bash",
|
||||
"icon": "terminal-bash"
|
||||
},
|
||||
"zsh": {
|
||||
"path": "zsh"
|
||||
},
|
||||
"fish": {
|
||||
"path": "fish"
|
||||
},
|
||||
"tmux": {
|
||||
"path": "tmux",
|
||||
"icon": "terminal-tmux"
|
||||
},
|
||||
"pwsh": {
|
||||
"path": "pwsh",
|
||||
"icon": "terminal-powershell"
|
||||
}
|
||||
},
|
||||
"task.problemMatchers.neverPrompt": true,
|
||||
"task.autoDetect": "on",
|
||||
"task.saveBeforeRun": "always",
|
||||
"explorer.autoReveal": true,
|
||||
"explorer.compactFolders": false,
|
||||
"explorer.confirmDelete": true,
|
||||
"explorer.confirmDragAndDrop": false,
|
||||
"workbench.editor.enablePreview": false,
|
||||
"workbench.editor.enablePreviewFromQuickOpen": false,
|
||||
"workbench.startupEditor": "none",
|
||||
"workbench.colorTheme": "Default Dark Modern",
|
||||
"workbench.iconTheme": "vs-seti",
|
||||
"breadcrumbs.enabled": true,
|
||||
"editor.minimap.enabled": true,
|
||||
"editor.renderWhitespace": "boundary",
|
||||
"editor.rulers": [
|
||||
88
|
||||
],
|
||||
"editor.wordWrap": "on",
|
||||
"editor.suggestSelection": "first",
|
||||
"editor.quickSuggestions": {
|
||||
"strings": true
|
||||
},
|
||||
"editor.acceptSuggestionOnEnter": "smart",
|
||||
"editor.suggest.showClasses": true,
|
||||
"editor.suggest.showColors": true,
|
||||
"editor.suggest.showConstants": true,
|
||||
"editor.suggest.showConstructors": true,
|
||||
"editor.suggest.showCustomcolors": true,
|
||||
"editor.suggest.showDeprecated": true,
|
||||
"editor.suggest.showEnumMembers": true,
|
||||
"editor.suggest.showEvents": true,
|
||||
"editor.suggest.showFields": true,
|
||||
"editor.suggest.showFiles": true,
|
||||
"editor.suggest.showFolders": true,
|
||||
"editor.suggest.showFunctions": true,
|
||||
"editor.suggest.showInterfaces": true,
|
||||
"editor.suggest.showIssues": true,
|
||||
"editor.suggest.showKeywords": true,
|
||||
"editor.suggest.showMethods": true,
|
||||
"editor.suggest.showModules": true,
|
||||
"editor.suggest.showOperators": true,
|
||||
"editor.suggest.showProperties": true,
|
||||
"editor.suggest.showReferences": true,
|
||||
"editor.suggest.showSnippets": true,
|
||||
"editor.suggest.showStructs": true,
|
||||
"editor.suggest.showTypeParameters": true,
|
||||
"editor.suggest.showUnits": true,
|
||||
"editor.suggest.showUsers": true,
|
||||
"editor.suggest.showValues": true,
|
||||
"editor.suggest.showVariables": true,
|
||||
"editor.suggest.showWords": true
|
||||
}
|
||||
219
.vscode/tasks.json
vendored
Normal file
219
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,219 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "FutureOSS: 安装依赖",
|
||||
"type": "shell",
|
||||
"command": "pip install -r requirements.txt",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "always",
|
||||
"focus": false,
|
||||
"panel": "shared",
|
||||
"showReuseMessage": true,
|
||||
"clear": true
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "FutureOSS: 启动开发服务器",
|
||||
"type": "shell",
|
||||
"command": "python -m oss.cli serve",
|
||||
"group": "none",
|
||||
"isBackground": true,
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "always",
|
||||
"focus": true,
|
||||
"panel": "dedicated",
|
||||
"showReuseMessage": true,
|
||||
"clear": false
|
||||
},
|
||||
"problemMatcher": [
|
||||
{
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": ".",
|
||||
"file": 1,
|
||||
"location": 2,
|
||||
"message": 3
|
||||
}
|
||||
],
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": ".*启动 FutureOSS 服务.*",
|
||||
"endsPattern": ".*服务已启动.*"
|
||||
}
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "FutureOSS: 运行测试",
|
||||
"type": "shell",
|
||||
"command": "pytest -v --tb=short",
|
||||
"group": "test",
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "always",
|
||||
"focus": false,
|
||||
"panel": "dedicated",
|
||||
"showReuseMessage": true,
|
||||
"clear": true
|
||||
},
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "python",
|
||||
"fileLocation": ["relative", "${workspaceFolder}"],
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^test_(.*)\\.py::(.*) (PASSED|FAILED|ERROR)$",
|
||||
"file": 1,
|
||||
"location": 2,
|
||||
"severity": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "FutureOSS: 代码检查",
|
||||
"type": "shell",
|
||||
"command": "python -m pylint oss/ store/@{FutureOSS}/ --rcfile=${workspaceFolder}/.pylintrc || echo 'Pylint检查完成'",
|
||||
"group": "build",
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "always",
|
||||
"focus": false,
|
||||
"panel": "dedicated",
|
||||
"showReuseMessage": true,
|
||||
"clear": true
|
||||
},
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "python",
|
||||
"fileLocation": ["relative", "${workspaceFolder}"],
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(.*):(\\d+):(\\d+): (\\w+): (.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "FutureOSS: 格式化代码",
|
||||
"type": "shell",
|
||||
"command": "python -m black oss/ store/@{FutureOSS}/",
|
||||
"group": "build",
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "always",
|
||||
"focus": false,
|
||||
"panel": "dedicated",
|
||||
"showReuseMessage": true,
|
||||
"clear": true
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "FutureOSS: 清理缓存文件",
|
||||
"type": "shell",
|
||||
"command": "find . -type f -name '*.pyc' -delete && find . -type d -name '__pycache__' -delete && find . -type f -name '.pid' -delete",
|
||||
"group": "build",
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "always",
|
||||
"focus": false,
|
||||
"panel": "dedicated",
|
||||
"showReuseMessage": true,
|
||||
"clear": true
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "FutureOSS: 查看服务状态",
|
||||
"type": "shell",
|
||||
"command": "if [ -f .pid ]; then echo '服务正在运行,PID: ' && cat .pid; else echo '服务未运行'; fi",
|
||||
"group": "none",
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "always",
|
||||
"focus": false,
|
||||
"panel": "new",
|
||||
"showReuseMessage": true,
|
||||
"clear": true
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "FutureOSS: 停止服务",
|
||||
"type": "shell",
|
||||
"command": "if [ -f .pid ]; then kill $(cat .pid) && rm -f .pid && echo '服务已停止'; else echo '服务未运行'; fi",
|
||||
"group": "none",
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "always",
|
||||
"focus": false,
|
||||
"panel": "new",
|
||||
"showReuseMessage": true,
|
||||
"clear": true
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "FutureOSS: 重启服务",
|
||||
"type": "shell",
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOn": [
|
||||
"FutureOSS: 停止服务",
|
||||
"FutureOSS: 启动开发服务器"
|
||||
],
|
||||
"group": "none",
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "always",
|
||||
"focus": true,
|
||||
"panel": "dedicated",
|
||||
"showReuseMessage": true,
|
||||
"clear": true
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user