create-pywire-app 0.1.1__tar.gz → 0.1.2__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.
Files changed (44) hide show
  1. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/PKG-INFO +18 -2
  2. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/README.md +17 -1
  3. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/pyproject.toml +1 -1
  4. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/main.py +90 -17
  5. create_pywire_app-0.1.2/src/create_pywire_app/templates/common/extensions.json +5 -0
  6. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/common/main-explicit.py.j2 +1 -1
  7. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/common/main-path.py.j2 +1 -1
  8. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/.gitignore +0 -0
  9. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/LICENSE +0 -0
  10. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/__init__.py +0 -0
  11. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/blog/explicit/about.wire +0 -0
  12. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/blog/explicit/blog-posts.wire +0 -0
  13. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/blog/explicit/home.wire +0 -0
  14. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/blog/explicit/layout.wire.j2 +0 -0
  15. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/blog/path-based/__layout__.wire.j2 +0 -0
  16. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/blog/path-based/index.wire +0 -0
  17. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/blog/path-based/posts__layout__.wire.j2 +0 -0
  18. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/blog/path-based/posts_index.wire +0 -0
  19. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/blog/path-based/posts_slug.wire +0 -0
  20. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/common/.gitignore +0 -0
  21. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/common/Dockerfile +0 -0
  22. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/common/README.md.j2 +0 -0
  23. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/common/__error__.wire +0 -0
  24. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/common/pyproject.toml.j2 +0 -0
  25. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/common/render.yaml.j2 +0 -0
  26. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/counter/explicit/home.wire +0 -0
  27. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/counter/explicit/layout.wire.j2 +0 -0
  28. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/counter/path-based/__layout__.wire.j2 +0 -0
  29. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/counter/path-based/index.wire +0 -0
  30. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/saas/explicit/auth-layout.wire.j2 +0 -0
  31. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/saas/explicit/dashboard-pages.wire +0 -0
  32. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/saas/explicit/landing.wire +0 -0
  33. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/saas/explicit/login.wire +0 -0
  34. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/saas/explicit/pricing.wire +0 -0
  35. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/saas/explicit/public-layout.wire.j2 +0 -0
  36. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/saas/models.py +0 -0
  37. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/saas/path-based/__layout__.wire.j2 +0 -0
  38. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/saas/path-based/dashboard__layout__.wire.j2 +0 -0
  39. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/saas/path-based/dashboard_index.wire +0 -0
  40. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/saas/path-based/dashboard_settings.wire +0 -0
  41. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/saas/path-based/index.wire +0 -0
  42. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/saas/path-based/login.wire +0 -0
  43. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/src/create_pywire_app/templates/saas/path-based/pricing.wire +0 -0
  44. {create_pywire_app-0.1.1 → create_pywire_app-0.1.2}/tests/test_smoke.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: create-pywire-app
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Init wizard for new pywire projects
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.11
@@ -17,12 +17,28 @@ Description-Content-Type: text/markdown
17
17
 
18
18
  Quick start wizard for new pywire projects.
19
19
 
20
- ## Usage
20
+ <!-- INSTALL_MESSAGE_TEMPLATE_START -->
21
+ ## 🚀 Quick Start
22
+
23
+ If you already have [uv](https://docs.astral.sh/uv/) installed, you can get started instantly:
21
24
 
22
25
  ```bash
23
26
  uvx create-pywire-app
24
27
  ```
25
28
 
29
+ If you don't have `uv` installed or aren't sure, use our installer script which handles the setup for you:
30
+
31
+ ### macOS / Linux
32
+ ```bash
33
+ curl -fsSL pywire.dev/install | sh
34
+ ```
35
+
36
+ ### Windows (PowerShell)
37
+ ```powershell
38
+ irm pywire.dev/install.ps1 | iex
39
+ ```
40
+ <!-- INSTALL_MESSAGE_TEMPLATE_END -->
41
+
26
42
  <!-- SUPPORT_MESSAGE_TEMPLATE_START -->
27
43
  ## ❤️ Support pywire
28
44
 
@@ -2,12 +2,28 @@
2
2
 
3
3
  Quick start wizard for new pywire projects.
4
4
 
5
- ## Usage
5
+ <!-- INSTALL_MESSAGE_TEMPLATE_START -->
6
+ ## 🚀 Quick Start
7
+
8
+ If you already have [uv](https://docs.astral.sh/uv/) installed, you can get started instantly:
6
9
 
7
10
  ```bash
8
11
  uvx create-pywire-app
9
12
  ```
10
13
 
14
+ If you don't have `uv` installed or aren't sure, use our installer script which handles the setup for you:
15
+
16
+ ### macOS / Linux
17
+ ```bash
18
+ curl -fsSL pywire.dev/install | sh
19
+ ```
20
+
21
+ ### Windows (PowerShell)
22
+ ```powershell
23
+ irm pywire.dev/install.ps1 | iex
24
+ ```
25
+ <!-- INSTALL_MESSAGE_TEMPLATE_END -->
26
+
11
27
  <!-- SUPPORT_MESSAGE_TEMPLATE_START -->
12
28
  ## ❤️ Support pywire
13
29
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "create-pywire-app"
3
- version = "0.1.1"
3
+ version = "0.1.2"
4
4
  description = "Init wizard for new pywire projects"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -113,6 +113,7 @@ class ProjectGenerator:
113
113
  self._generate_gitignore()
114
114
  self._generate_main()
115
115
  self._generate_error_page()
116
+ self._generate_vscode_settings()
116
117
 
117
118
  # Generate template-specific files
118
119
  if self.template == "counter":
@@ -150,10 +151,19 @@ class ProjectGenerator:
150
151
  """Generate .gitignore."""
151
152
  self.renderer.copy_static("common/.gitignore", self.project_path / ".gitignore")
152
153
 
154
+ def _generate_vscode_settings(self) -> None:
155
+ """Generate VS Code settings."""
156
+ vscode_dir = self.project_path / ".vscode"
157
+ vscode_dir.mkdir(exist_ok=True)
158
+ self.renderer.copy_static("common/extensions.json", vscode_dir / "extensions.json")
159
+
153
160
  def _generate_main(self) -> None:
154
161
  """Generate main.py."""
155
162
  template_name = "main-path.py.j2" if self.routing_strategy == "path" else "main-explicit.py.j2"
156
- content = self.renderer.render(f"common/{template_name}", {})
163
+ context = {
164
+ "pages_dir": "src/pages" if self.use_src else "pages",
165
+ }
166
+ content = self.renderer.render(f"common/{template_name}", context)
157
167
  (self.app_root / "main.py").write_text(content)
158
168
 
159
169
  def _generate_error_page(self) -> None:
@@ -341,6 +351,7 @@ def main():
341
351
  generator.generate()
342
352
 
343
353
  # Initialize git repo
354
+ git_initialized = False
344
355
  try:
345
356
  subprocess.run(
346
357
  ["git", "init"],
@@ -349,8 +360,33 @@ def main():
349
360
  capture_output=True,
350
361
  text=True,
351
362
  )
363
+ git_initialized = True
352
364
  except (FileNotFoundError, subprocess.CalledProcessError):
353
365
  pass # Silently skip if git is not available
366
+ if git_initialized:
367
+ try:
368
+ subprocess.run(
369
+ ["git", "add", "."],
370
+ cwd=project_path,
371
+ check=True,
372
+ capture_output=True,
373
+ text=True,
374
+ )
375
+ subprocess.run(
376
+ ["git", "commit", "-m", "feat: initial project structure"],
377
+ cwd=project_path,
378
+ check=True,
379
+ capture_output=True,
380
+ text=True,
381
+ )
382
+ except subprocess.CalledProcessError as e:
383
+ console.print(
384
+ "[yellow]![/yellow] Git commit skipped (configure user.name/email to enable)."
385
+ )
386
+ if e.stderr:
387
+ console.print(e.stderr)
388
+ except FileNotFoundError:
389
+ console.print("[yellow]![/yellow] Git not found, skipping commit")
354
390
 
355
391
  console.print("[green]✓[/green] Project structure created")
356
392
 
@@ -377,32 +413,69 @@ def main():
377
413
  except FileNotFoundError:
378
414
  console.print("[yellow]![/yellow] uv not found, skipping sync")
379
415
 
380
- # Success message
381
- console.print()
416
+ next_action = questionary.select(
417
+ "What would you like to do next?",
418
+ choices=[
419
+ questionary.Choice("Start development server", value="start"),
420
+ questionary.Choice("Show instructions and exit", value="instructions"),
421
+ ],
422
+ pointer=">",
423
+ ).unsafe_ask()
382
424
 
383
- commands = [f"cd {project_location}"]
384
- if not sync_success:
385
- commands.append("uv sync")
386
- commands.append("pywire dev")
425
+ should_show_instructions = next_action == "instructions"
426
+ if next_action == "start":
427
+ try:
428
+ subprocess.run(
429
+ ["uv", "run", "pywire", "dev"],
430
+ cwd=project_path,
431
+ check=True,
432
+ )
433
+ return
434
+ except subprocess.CalledProcessError:
435
+ console.print("[red]✗[/red] Failed to start the dev server")
436
+ should_show_instructions = True
437
+ except FileNotFoundError:
438
+ console.print("[yellow]![/yellow] uv not found, cannot start server")
439
+ should_show_instructions = True
440
+
441
+ if should_show_instructions:
442
+ console.print()
443
+
444
+ is_windows = os.name == "nt"
445
+ commands = [f"cd {project_location}"]
446
+ if not sync_success:
447
+ commands.append("uv sync")
448
+ if is_windows:
449
+ activate_cmd = r".venv\Scripts\activate"
450
+ else:
451
+ activate_cmd = "source .venv/bin/activate"
452
+ commands.extend(
453
+ [
454
+ activate_cmd,
455
+ "pywire dev",
456
+ ]
457
+ )
387
458
 
388
- cmd_text = "\n ".join(commands)
459
+ cmd_text = "\n ".join(commands)
389
460
 
390
- console.print(
391
- Panel(
392
- Markdown(
393
- f"""
461
+ console.print(
462
+ Panel(
463
+ Markdown(
464
+ f"""
394
465
  # System Online 🟢
395
466
 
396
467
  Run the following commands to enter the environment:
397
468
 
398
469
  {cmd_text}
470
+
471
+ > **Tip:** Install the **PyWire** extension (id: `pywire.pywire`) in VS Code for syntax highlighting and snippets.
399
472
  """
400
- ),
401
- border_style="cyan",
402
- title="Initialization Complete",
403
- title_align="left",
473
+ ),
474
+ border_style="cyan",
475
+ title="Initialization Complete",
476
+ title_align="left",
477
+ )
404
478
  )
405
- )
406
479
  except KeyboardInterrupt:
407
480
  console.print("\n[bold red]System Aborted.[/bold red]")
408
481
  sys.exit(1)
@@ -0,0 +1,5 @@
1
+ {
2
+ "recommendations": [
3
+ "pywire.pywire"
4
+ ]
5
+ }
@@ -3,7 +3,7 @@ from pywire import PyWire
3
3
  # Create application instance
4
4
  app = PyWire(
5
5
  path_based_routing=False,
6
- pages_dir="pages",
6
+ pages_dir="{{ pages_dir }}",
7
7
  enable_pjax=True,
8
8
  debug=True,
9
9
  )
@@ -2,7 +2,7 @@ from pywire import PyWire
2
2
 
3
3
  # Create application instance
4
4
  app = PyWire(
5
- pages_dir="pages",
5
+ pages_dir="{{ pages_dir }}",
6
6
  enable_pjax=True,
7
7
  debug=True,
8
8
  )