bcmd 0.2.8__py3-none-any.whl → 0.3.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of bcmd might be problematic. Click here for more details.

@@ -0,0 +1,76 @@
1
+ {
2
+ "files.exclude": {
3
+ ".pytest_cache": true,
4
+ "**/__pycache__": true,
5
+ ".gitignore": true,
6
+ ".venv": true,
7
+ ".venv-lock": true,
8
+ "venv": true,
9
+ },
10
+ "python.defaultInterpreterPath": "${workspaceFolder}/venv/Scripts/python.exe",
11
+ // coommon ------------------------------------------------------------------------------------
12
+ "window.menuBarVisibility": "classic", // 顶部中间
13
+ // "breadcrumbs.enabled": false, // 代码顶部导航
14
+ // "http.proxy": "http://localhost:15236",
15
+ "security.workspace.trust.enabled": false,
16
+ "redhat.telemetry.enabled": false,
17
+ "window.restoreWindows": "none",
18
+ "workbench.startupEditor": "none",
19
+ "files.eol": "\n",
20
+ "explorer.autoReveal": false, // 取消文件自动定位跟踪
21
+ "editor.renderWhitespace": "none", // 不高亮显示空白
22
+ "editor.unicodeHighlight.allowedLocales": { // 注释里的全角符号不提示警告
23
+ "zh-hans": true,
24
+ "zh-hant": true,
25
+ },
26
+ "github.copilot.enable": {
27
+ "*": true,
28
+ "plaintext": true,
29
+ "markdown": true,
30
+ "scminput": false,
31
+ "yaml": true
32
+ },
33
+ "github.copilot.editor.enableAutoCompletions": true,
34
+ "github.copilot.chat.localeOverride": "zh-CN",
35
+ "git.openRepositoryInParentFolders": "never",
36
+ "workbench.colorTheme": "Default Dark+",
37
+ "editor.stickyScroll.enabled": false,
38
+ "workbench.editor.enablePreview": false,
39
+ "window.commandCenter": false,
40
+ "editor.inlineSuggest.enabled": true,
41
+ "[markdown]": {
42
+ "editor.defaultFormatter": "yzhang.markdown-all-in-one"
43
+ },
44
+ // python -------------------------------------------------------------------------------------
45
+ "python.languageServer": "Pylance",
46
+ "python.analysis.autoImportCompletions": true,
47
+ "python.analysis.diagnosticMode": "workspace", // 针对整个workspace做检查提示
48
+ "python.analysis.typeCheckingMode": "strict",
49
+ "[python]": {
50
+ "editor.defaultFormatter": "ms-python.autopep8",
51
+ },
52
+ "autopep8.args": [
53
+ "--ignore=E501",
54
+ ],
55
+ "python.testing.pytestArgs": [
56
+ "test", // 指定单元测试查找的目录
57
+ "-s", // 支持print输出
58
+ ],
59
+ "python.testing.unittestEnabled": false,
60
+ "python.testing.pytestEnabled": false,
61
+ "python.analysis.diagnosticSeverityOverrides": {
62
+ "reportMissingTypeStubs": "none",
63
+ "reportUnknownMemberType": "none",
64
+ // "reportUnknownParameterType": "none",
65
+ // "reportUnknownVariableType": "none",
66
+ // "reportUnknownArgumentType": "none",
67
+ // "reportMatchNotExhaustive": "none", // match 没有匹配所有,会提示添加一个 _
68
+ // "reportUnusedCallResult": "warning",
69
+ "reportUnusedClass": "warning",
70
+ "reportUnusedCoroutine": "warning",
71
+ "reportUnusedFunction": "warning",
72
+ "reportUnusedImport": "warning",
73
+ "reportUnusedVariable": "warning",
74
+ "reportImportCycles": "warning",
75
+ },
76
+ }
@@ -7,7 +7,7 @@
7
7
  "command": "TortoiseGitProc.exe",
8
8
  "args": [
9
9
  "/command:commit",
10
- "/path:${workspaceFolder}/../",
10
+ "/path:${workspaceFolder}/",
11
11
  ],
12
12
  },
13
13
  {
@@ -25,7 +25,7 @@
25
25
  "command": "TortoiseGitProc.exe",
26
26
  "args": [
27
27
  "/command:revert",
28
- "/path:${workspaceFolder}/../",
28
+ "/path:${workspaceFolder}/",
29
29
  ],
30
30
  },
31
31
  {
@@ -43,7 +43,7 @@
43
43
  "command": "TortoiseGitProc.exe",
44
44
  "args": [
45
45
  "/command:sync",
46
- "/path:${workspaceFolder}/../",
46
+ "/path:${workspaceFolder}/",
47
47
  ],
48
48
  },
49
49
  {
@@ -52,7 +52,7 @@
52
52
  "command": "TortoiseGitProc.exe",
53
53
  "args": [
54
54
  "/command:log",
55
- "/path:${workspaceFolder}/../",
55
+ "/path:${workspaceFolder}/",
56
56
  ],
57
57
  },
58
58
  {
bcmd/tasks/lib.py CHANGED
@@ -23,8 +23,8 @@ async def tidy_dependencies(
23
23
  workspace_path = Path.cwd()
24
24
  pyprojectTomlFile = workspace_path / 'pyproject.toml'
25
25
  btask.check(pyprojectTomlFile.is_file(), 'pyproject.toml 不存在', pyprojectTomlFile)
26
- targetVenvFileName = 'venv.lock' if with_version else 'venv.list'
27
- targetVenvFile = bpath.get(workspace_path, f'./../{targetVenvFileName}')
26
+ targetVenvFileName = '.venv-lock' if with_version else '.venv'
27
+ targetVenvFile = bpath.get(workspace_path, f'./{targetVenvFileName}')
28
28
  btask.check(targetVenvFile.is_file(), '文件不存在', targetVenvFile)
29
29
  libAry = (await bfile.readText(targetVenvFile)).strip().replace('\r\n', '\n').split('\n')
30
30
  oldContent = await bfile.readText(pyprojectTomlFile)
@@ -79,7 +79,7 @@ async def update_version(
79
79
  @app.command()
80
80
  @syncCall
81
81
  async def build(
82
- src_path: Path = typer.Argument(None, help='src 路径'),
82
+ workspace_path: Path = typer.Argument(None, help='workspace 路径'),
83
83
  keep_build_files: bool = typer.Option(False, '--keep-build-files', '-k', help='是否保留构建文件'),
84
84
  ):
85
85
  '发布项目'
@@ -87,22 +87,21 @@ async def build(
87
87
  # 获取用户名和密码
88
88
  u, p = await password.getPypi()
89
89
 
90
- if not src_path:
91
- src_path = Path.cwd()
92
- src_path = src_path.resolve()
90
+ if not workspace_path:
91
+ workspace_path = Path.cwd()
92
+ workspace_path = workspace_path.resolve()
93
93
 
94
94
  def removeUnusedPath():
95
- bpath.remove(src_path / 'dist')
96
- paths = bpath.listDir(src_path)
95
+ bpath.remove(workspace_path / 'dist')
96
+ paths = bpath.listDir(workspace_path)
97
97
  for x in paths:
98
98
  if x.name.endswith('.egg-info'):
99
99
  bpath.remove(x)
100
100
 
101
101
  try:
102
- with bpath.changePath(src_path):
102
+ with bpath.changePath(workspace_path):
103
103
  removeUnusedPath()
104
- scriptPath = (src_path / './../venv/Scripts').resolve()
105
- os.system(f'{scriptPath / "pip.exe"} install setuptools -U -i https://mirrors.aliyun.com/pypi/simple')
104
+ scriptPath = (workspace_path / './venv/Scripts').resolve()
106
105
  os.system(f'{scriptPath / "python.exe"} -m build')
107
106
  os.system(f'{scriptPath / "twine.exe"} upload dist/* -u {u} -p {p}')
108
107
  finally:
bcmd/tasks/proxy.py CHANGED
@@ -17,7 +17,7 @@ async def proxy(
17
17
  port: int = typer.Option(15236, help="代理服务器端口"),
18
18
  ):
19
19
  '生成终端设置代理服务器的命令'
20
- processNameAry = []
20
+ processNameAry:list[str] = []
21
21
  process = psutil.Process().parent()
22
22
  while process:
23
23
  processNameAry.append(process.name())
bcmd/tasks/venv.py CHANGED
@@ -24,6 +24,7 @@ async def venv(
24
24
  disabled_mirror: bool = typer.Option(False, '--disabled-mirror', '-d', help='是否禁用镜像'),
25
25
  new_project: bool = typer.Option(False, '--new-project', '-n', help='是否新建项目'),
26
26
  quiet: bool = typer.Option(False, '--quiet', '-q', help='是否安静模式'),
27
+ no_lock: bool = typer.Option(False, '--no-lock', help='是否不使用.venv-lock文件来安装(使用在不同系统上增量安装)'),
27
28
  ):
28
29
  'python 虚拟环境配置'
29
30
  path = path or Path(os.getcwd())
@@ -42,14 +43,14 @@ async def venv(
42
43
  await binput.confirm('指定目录为非venv目录,是否确认新创建?')
43
44
  if not venvPath.exists():
44
45
  await bexecute.run(f'python -m venv {venvPath}')
45
- venvLockFile = bpath.get(path, 'venv.lock')
46
+ venvLockFile = bpath.get(path, '.venv-lock')
46
47
  assertFile(venvLockFile)
47
- venvListFile = bpath.get(path, 'venv.list')
48
+ venvListFile = bpath.get(path, '.venv')
48
49
  assertFile(venvListFile)
49
50
  if not venvListFile.exists():
50
51
  await bfile.writeText(venvListFile, '')
51
52
  await tidyVenvFile(venvListFile, packages)
52
- if venvLockFile.exists():
53
+ if venvLockFile.exists() and not no_lock:
53
54
  await tidyVenvFile(venvLockFile, packages)
54
55
  targetFile = venvLockFile
55
56
  else:
@@ -69,10 +70,8 @@ async def venv(
69
70
  )
70
71
  # 新建项目
71
72
  if new_project:
72
- with bpath.changePath(path):
73
- await bexecute.run('beni venv --quiet')
74
73
  with importlib.resources.path('bcmd.resources', 'project') as sourceProjectPath:
75
- for p in bpath.listDir(sourceProjectPath):
74
+ for p in bpath.listPath(sourceProjectPath):
76
75
  bpath.copy(p, path / p.name)
77
76
  bcolor.printGreen('OK')
78
77
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bcmd
3
- Version: 0.2.8
3
+ Version: 0.3.4
4
4
  Summary: Commands for Beni
5
5
  Author-email: Beni Mang <benimang@126.com>
6
6
  Maintainer-email: Beni Mang <benimang@126.com>
@@ -3,10 +3,10 @@ bcmd/main.py,sha256=1HRCHLt_jeF6ImgjG_MX9N2x9H1f6FyqTX7UADzedfA,131
3
3
  bcmd/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  bcmd/common/password.py,sha256=25fA1h9ttZuUobnZ_nA0Ouhmk43etBfGeM40dgxJnFY,1347
5
5
  bcmd/resources/project/.gitignore,sha256=m8wh9WahP29_Ci866EEuj07Wfn0wnkomj7wldbxd29E,26
6
- bcmd/resources/project/src/main.py,sha256=xdskz_sf05fYA1SRMFCIxDjx8SnegxTbCmHpW86ItLs,11
7
- bcmd/resources/project/src/.vscode/launch.json,sha256=Wpghb9lW9Y1wtrjqlTbyjeejDuU8BQJmBjwsLyPRh1g,478
8
- bcmd/resources/project/src/.vscode/settings.json,sha256=roHbI_6eQNeaU2-LXZNbqwezf96p8_0dq_EgvA1wp7U,188
9
- bcmd/resources/project/src/.vscode/tasks.json,sha256=vajOT61PFvnrOHpfAy2yLjz0pN2ZWti0elR-OnbVCDw,1795
6
+ bcmd/resources/project/main.py,sha256=xdskz_sf05fYA1SRMFCIxDjx8SnegxTbCmHpW86ItLs,11
7
+ bcmd/resources/project/.vscode/launch.json,sha256=Wpghb9lW9Y1wtrjqlTbyjeejDuU8BQJmBjwsLyPRh1g,478
8
+ bcmd/resources/project/.vscode/settings.json,sha256=aoy95AVsUWz-UpnY6P1Of7E_ORSSrd8cFT7YKAWVqGA,3079
9
+ bcmd/resources/project/.vscode/tasks.json,sha256=gouhpkrqiPz7v65Jw1Rz-BCYU3sSdmphzXIYCzVnoe0,1783
10
10
  bcmd/tasks/__init__.py,sha256=XDE4eW0mPkUCSK9tyg1DQRGLA7A9DuTmjq5MyUiPoXs,294
11
11
  bcmd/tasks/bin.py,sha256=rdag8IJv081CKflnJKo0IkVbi5wqBGowrl6gLMtP6Eg,3133
12
12
  bcmd/tasks/code.py,sha256=MEfzE879dplraLtZ59EZu94HrPkEohHCo7PNEoF_xmM,3089
@@ -15,15 +15,15 @@ bcmd/tasks/debian.py,sha256=B9aMIIct3vNqMJr5hTr1GegXVf20H49C27FMvRRGIzI,3004
15
15
  bcmd/tasks/download.py,sha256=0TYdoeEkXL--GTZ8ZSnSNzh8pC42kZhrTu6WVY5e7Fo,1824
16
16
  bcmd/tasks/image.py,sha256=OSqShLb_lwa77aQOnRNksXNemtuAnQDGg-VfiDy9fEM,2310
17
17
  bcmd/tasks/json.py,sha256=WWOyvcZPYaqQgp-Tkm-uIJschNMBKPKtZN3yXz_SC5s,635
18
- bcmd/tasks/lib.py,sha256=6J1amKBMSd9noRrsJ9vfbdgaRLeos8o7oNlqc5HOCU4,4689
18
+ bcmd/tasks/lib.py,sha256=sUITLkSJwpPSCIu3PrxKH59XLXga-DMesCWpgHYGaPg,4625
19
19
  bcmd/tasks/math.py,sha256=M7-mmyQPx1UW7JiU1knY5Ty0hBw9zv9L4NNJf9eEjZ4,2857
20
20
  bcmd/tasks/mirror.py,sha256=-ztGkkxVk81npIo4cpmyLdHa1w4ZFdiJ3mv5WIBMI5Y,1556
21
21
  bcmd/tasks/project.py,sha256=ESWyRvRu4tesoYrlBtYMrQvQoxzMnFkI-jTN2hsYruI,939
22
- bcmd/tasks/proxy.py,sha256=6-qXy5_aFAJs8ikVsHTqC2R-QrMfjuJkyyVTxO7M0tk,1314
22
+ bcmd/tasks/proxy.py,sha256=mdiBR2vah5qKt9o7dXE7rg8Lz_A6GheVJDts0m1gmSs,1324
23
23
  bcmd/tasks/time.py,sha256=nSIVYov2LsGdxsZAtC91UKXcUtVAqR9o-JmzeuevFhA,2586
24
- bcmd/tasks/venv.py,sha256=u2Ogke5hU2eFb0YrFQ2JtxGiEcgfiHQj6lg0lqVUcF8,4602
25
- bcmd-0.2.8.dist-info/METADATA,sha256=UTakK1CwhfC4FBn-A53BI1lyaIBkqt742nWR2UMjX3M,486
26
- bcmd-0.2.8.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
27
- bcmd-0.2.8.dist-info/entry_points.txt,sha256=rHJrP6KEQpB-YaQqDFzEL2v88r03rxSfnzAayRvAqHU,39
28
- bcmd-0.2.8.dist-info/top_level.txt,sha256=-KrvhhtBcYsm4XhcjQvEcFbBB3VXeep7d3NIfDTrXKQ,5
29
- bcmd-0.2.8.dist-info/RECORD,,
24
+ bcmd/tasks/venv.py,sha256=8AjQqxlOnw37WqwBzC2gBd8Lm4uLHcVcD7V2iPrxBpg,4672
25
+ bcmd-0.3.4.dist-info/METADATA,sha256=x7eN_zToE0jwj-BTShR7Z8UTYIPH9Vop0kHmn6fv4tA,486
26
+ bcmd-0.3.4.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
27
+ bcmd-0.3.4.dist-info/entry_points.txt,sha256=rHJrP6KEQpB-YaQqDFzEL2v88r03rxSfnzAayRvAqHU,39
28
+ bcmd-0.3.4.dist-info/top_level.txt,sha256=-KrvhhtBcYsm4XhcjQvEcFbBB3VXeep7d3NIfDTrXKQ,5
29
+ bcmd-0.3.4.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- {
2
- "files.exclude": {
3
- ".pytest_cache": true,
4
- "**/__pycache__": true,
5
- },
6
- "python.defaultInterpreterPath": "${workspaceFolder}/../venv/Scripts/python.exe",
7
- }
File without changes
File without changes