fastws-cli 0.0.6__tar.gz → 0.0.7__tar.gz
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.
- {fastws_cli-0.0.6 → fastws_cli-0.0.7}/CHANGELOG.md +7 -0
- {fastws_cli-0.0.6/fastws_cli.egg-info → fastws_cli-0.0.7}/PKG-INFO +1 -1
- fastws_cli-0.0.7/fastws/__init__.py +5 -0
- {fastws_cli-0.0.6 → fastws_cli-0.0.7}/fastws/core.py +12 -13
- {fastws_cli-0.0.6 → fastws_cli-0.0.7/fastws_cli.egg-info}/PKG-INFO +1 -1
- fastws_cli-0.0.6/fastws/__init__.py +0 -4
- {fastws_cli-0.0.6 → fastws_cli-0.0.7}/LICENSE +0 -0
- {fastws_cli-0.0.6 → fastws_cli-0.0.7}/MANIFEST.in +0 -0
- {fastws_cli-0.0.6 → fastws_cli-0.0.7}/README.md +0 -0
- {fastws_cli-0.0.6 → fastws_cli-0.0.7}/fastws_cli.egg-info/SOURCES.txt +0 -0
- {fastws_cli-0.0.6 → fastws_cli-0.0.7}/fastws_cli.egg-info/dependency_links.txt +0 -0
- {fastws_cli-0.0.6 → fastws_cli-0.0.7}/fastws_cli.egg-info/entry_points.txt +0 -0
- {fastws_cli-0.0.6 → fastws_cli-0.0.7}/fastws_cli.egg-info/requires.txt +0 -0
- {fastws_cli-0.0.6 → fastws_cli-0.0.7}/fastws_cli.egg-info/top_level.txt +0 -0
- {fastws_cli-0.0.6 → fastws_cli-0.0.7}/pyproject.toml +0 -0
- {fastws_cli-0.0.6 → fastws_cli-0.0.7}/setup.cfg +0 -0
- {fastws_cli-0.0.6 → fastws_cli-0.0.7}/tests/test_sync.py +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
__all__ = ["ws_clone", "ws_clone_cli", "ws_pull", "ws_pull_cli", "ws_status", "ws_status_cli", "ws_branches", "ws_branches_cli",
|
|
4
4
|
"ws_sync", "ws_sync_cli", "ws_add", "ws_add_cli"]
|
|
5
5
|
|
|
6
|
-
import ast, fnmatch, os, re, shutil, subprocess
|
|
6
|
+
import ast, fnmatch, json, os, re, shutil, subprocess
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
9
9
|
|
|
@@ -193,18 +193,17 @@ def _site_packages(root: Path) -> Path|None:
|
|
|
193
193
|
if candidates: return candidates[0]
|
|
194
194
|
return None
|
|
195
195
|
|
|
196
|
-
def
|
|
196
|
+
def _write_pyright_config(root: Path):
|
|
197
197
|
site = _site_packages(root)
|
|
198
198
|
if not site:
|
|
199
199
|
print("No site-packages directory found for editable Pyright paths")
|
|
200
|
-
return
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
return created
|
|
200
|
+
return
|
|
201
|
+
paths = sorted({str(Path(p).parent) for f in site.glob("__editable__*_finder.py") for p in _editable_mapping(f).values()})
|
|
202
|
+
cfg_path = root / 'pyrightconfig.json'
|
|
203
|
+
cfg = json.loads(cfg_path.read_text()) if cfg_path.exists() else {}
|
|
204
|
+
cfg['extraPaths'] = paths
|
|
205
|
+
cfg_path.write_text(json.dumps(cfg, indent=2) + '\n')
|
|
206
|
+
for pth in site.glob('_pyright_editable_*.pth'): pth.unlink()
|
|
208
207
|
|
|
209
208
|
def _clone_one(repo: str, root: str = ".") -> str:
|
|
210
209
|
d = Path(root)/_repo_dir(repo)
|
|
@@ -323,7 +322,7 @@ def ws_sync(
|
|
|
323
322
|
pyproject_file: str = "pyproject.toml", # Workspace pyproject to update
|
|
324
323
|
template_file: str = "pyproject.tmpl", # Template copied when pyproject.toml is missing
|
|
325
324
|
):
|
|
326
|
-
"Sync workspace metadata, run uv sync -U, and
|
|
325
|
+
"Sync workspace metadata, run uv sync -U, and update Pyright config."
|
|
327
326
|
root = _ws_root(workspace, repos_file, pyproject_file, template_file)
|
|
328
327
|
repos_path = _resolve_path(root, repos_file)
|
|
329
328
|
pyproject_path = _resolve_path(root, pyproject_file)
|
|
@@ -335,8 +334,8 @@ def ws_sync(
|
|
|
335
334
|
|
|
336
335
|
if missing_projects := _sync_ws_pyproject(pyproject_path, template_path, _ws_projects(root)): print(f"Added workspace projects: {', '.join(missing_projects)}")
|
|
337
336
|
|
|
337
|
+
_write_pyright_config(root)
|
|
338
338
|
subprocess.run(["uv", "sync", "-U"], check=True, cwd=root)
|
|
339
|
-
_write_pyright_pth_files(root)
|
|
340
339
|
|
|
341
340
|
@call_parse
|
|
342
341
|
def ws_sync_cli(
|
|
@@ -345,7 +344,7 @@ def ws_sync_cli(
|
|
|
345
344
|
pyproject_file: str = "pyproject.toml", # Workspace pyproject to update
|
|
346
345
|
template_file: str = "pyproject.tmpl", # Template copied when pyproject.toml is missing
|
|
347
346
|
):
|
|
348
|
-
"Sync workspace metadata, run uv sync -U, and
|
|
347
|
+
"Sync workspace metadata, run uv sync -U, and update Pyright config."
|
|
349
348
|
ws_sync(workspace, repos_file, pyproject_file, template_file)
|
|
350
349
|
|
|
351
350
|
def ws_add(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|