plain.dev 0.21.0__py3-none-any.whl → 0.22.0__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.
plain/dev/cli.py CHANGED
@@ -219,9 +219,14 @@ class Dev:
219
219
  ).parent.parent
220
220
  if not settings.PLAIN_TEMP_PATH.exists():
221
221
  settings.PLAIN_TEMP_PATH.mkdir()
222
- src_path = settings.PLAIN_TEMP_PATH / "src"
223
- if plain_path.exists() and not src_path.exists():
224
- src_path.symlink_to(plain_path)
222
+ symlink_path = settings.PLAIN_TEMP_PATH / "src"
223
+
224
+ # Remove a broken symlink if it changed
225
+ if symlink_path.is_symlink() and not symlink_path.exists():
226
+ symlink_path.unlink()
227
+
228
+ if plain_path.exists() and not symlink_path.exists():
229
+ symlink_path.symlink_to(plain_path)
225
230
 
226
231
  def modify_hosts_file(self):
227
232
  """Modify the hosts file to map the custom domain to 127.0.0.1."""
@@ -10,8 +10,11 @@ import click
10
10
  @click.option(
11
11
  "--reset", is_flag=True, help="Undo any changes to pyproject.toml and uv.lock"
12
12
  )
13
+ @click.option(
14
+ "--all", "all_packages", is_flag=True, help="Link all installed plain packages"
15
+ )
13
16
  @click.argument("packages", nargs=-1)
14
- def cli(packages, repo, reset):
17
+ def cli(packages, repo, reset, all_packages):
15
18
  """Contribute to plain by linking packages locally."""
16
19
 
17
20
  if reset:
@@ -52,6 +55,21 @@ def cli(packages, repo, reset):
52
55
  plain_packages = []
53
56
  plainx_packages = []
54
57
 
58
+ if all_packages:
59
+ # get all installed plain packages
60
+ output = subprocess.check_output(["uv", "pip", "freeze"])
61
+
62
+ installed_packages = output.decode()
63
+ if not installed_packages:
64
+ click.secho("No installed packages found", fg="red")
65
+ sys.exit(1)
66
+
67
+ packages = [
68
+ line.split("==")[0]
69
+ for line in installed_packages.splitlines()
70
+ if line.startswith("plain")
71
+ ]
72
+
55
73
  for package in packages:
56
74
  package = package.replace(".", "-")
57
75
  click.secho(f"Linking {package} to {repo}", bold=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.dev
3
- Version: 0.21.0
3
+ Version: 0.22.0
4
4
  Summary: Local development tools for Plain.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-Expression: BSD-3-Clause
@@ -1,6 +1,6 @@
1
1
  plain/dev/README.md,sha256=r_sONnN4zVlDdQrst_51iScrm3PlrcoPNmX9yX3MKXo,3658
2
2
  plain/dev/__init__.py,sha256=nRX1B0Br8gmqhJLqo5Z9PqzReDahBtbmwH6C-7hzuls,103
3
- plain/dev/cli.py,sha256=DkuMpWpfP0FxSFyl4jI7iXkChDWs7cfv_u4RM34rwH4,12911
3
+ plain/dev/cli.py,sha256=op9FTibH2RbM9QXo5lG6P_Ur5Inn1bhPQ9CJtzV_Kf4,13075
4
4
  plain/dev/debug.py,sha256=Ka84K8zUdF0kMYNyqiLYDrdzU1jU8LSOkts3hcw_Gok,1005
5
5
  plain/dev/default_settings.py,sha256=uXWYORWP_aRDwXIFXdu5kHyiBFUZzARIJdhPeFaX35c,75
6
6
  plain/dev/entrypoints.py,sha256=TCjX9aCLQag_0UjWE6PU5MnuaNWHAqsZQh7opSjr8zM,386
@@ -15,7 +15,7 @@ plain/dev/utils.py,sha256=4wMzpvj1Is_c0QxhsTu34_P9wAYlzw4glNPfVtZr_0A,123
15
15
  plain/dev/views.py,sha256=r2Ivk7OXytpRhXq4DZpsb7FXNP9vzmEE3D5kLajYG4w,1073
16
16
  plain/dev/contribute/README.md,sha256=v9Ympugu2wvDEe_045WJnF1dmC4ZH7v_Bnxkpfaf_rM,329
17
17
  plain/dev/contribute/__init__.py,sha256=9ByBOIdM8DebChjNz-RH2atdz4vWe8somlwNEsbhwh4,40
18
- plain/dev/contribute/cli.py,sha256=mIK4u1rhee8iMovUpuHTNjfWolqNgS24_gTb8ZaSY-8,2432
18
+ plain/dev/contribute/cli.py,sha256=bjwOaLyYbKh-loaVlqivobXu7bBTi2h4hP9vTPsVQ8o,3008
19
19
  plain/dev/poncho/__init__.py,sha256=MDOk2rhhoR3V-I-rg6tMHFeX60vTGJuQ14RI-_N6tQY,97
20
20
  plain/dev/poncho/color.py,sha256=Dk77inPR9qNc9vCaZOGk8W9skXfRgoUlxp_E6mhPNns,610
21
21
  plain/dev/poncho/compat.py,sha256=l66WZLR7kRpO8P8DI5-aUsbNlohPaXEurQ5xXESQYDs,1276
@@ -25,8 +25,8 @@ plain/dev/poncho/process.py,sha256=JJOKy-C6vMCg7-6JMCtu6C649h7HmOBSJqDP_hnX49I,2
25
25
  plain/dev/precommit/__init__.py,sha256=9ByBOIdM8DebChjNz-RH2atdz4vWe8somlwNEsbhwh4,40
26
26
  plain/dev/precommit/cli.py,sha256=Zh-lCIbAH0LYwmFtH2wP2UzTiHKf2kIid2sO8p1wu2k,3378
27
27
  plain/dev/templates/dev/requests.html,sha256=kQKJZq5L77juuL_t8UjcAehEU61U4RXNnKaAET-wAm8,7627
28
- plain_dev-0.21.0.dist-info/METADATA,sha256=ALn8-6e0A_67cXxcsr80Xp1TKuvH-DfZIdwLXJQweEw,4163
29
- plain_dev-0.21.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
30
- plain_dev-0.21.0.dist-info/entry_points.txt,sha256=UtjUbxI-2TMZJGCfRTeU-YGr48XLwnc_pMuzDGD9uTg,219
31
- plain_dev-0.21.0.dist-info/licenses/LICENSE,sha256=Cx4Dq9yR2fLHthf8Ke36B8QJvE1bZFXVzDIGE8wGzsY,4132
32
- plain_dev-0.21.0.dist-info/RECORD,,
28
+ plain_dev-0.22.0.dist-info/METADATA,sha256=_7kEioOgpeIk-NSLmXuk-kcWNM83XUMz78MRy0kBzec,4163
29
+ plain_dev-0.22.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
30
+ plain_dev-0.22.0.dist-info/entry_points.txt,sha256=UtjUbxI-2TMZJGCfRTeU-YGr48XLwnc_pMuzDGD9uTg,219
31
+ plain_dev-0.22.0.dist-info/licenses/LICENSE,sha256=Cx4Dq9yR2fLHthf8Ke36B8QJvE1bZFXVzDIGE8wGzsY,4132
32
+ plain_dev-0.22.0.dist-info/RECORD,,