plain.dev 0.7.6__tar.gz → 0.8.1__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 (32) hide show
  1. {plain_dev-0.7.6 → plain_dev-0.8.1}/PKG-INFO +1 -1
  2. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/cli.py +23 -10
  3. {plain_dev-0.7.6 → plain_dev-0.8.1}/pyproject.toml +1 -1
  4. {plain_dev-0.7.6 → plain_dev-0.8.1}/LICENSE +0 -0
  5. {plain_dev-0.7.6 → plain_dev-0.8.1}/README.md +0 -0
  6. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/README.md +0 -0
  7. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/__init__.py +0 -0
  8. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/config.py +0 -0
  9. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/contribute/__init__.py +0 -0
  10. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/contribute/cli.py +0 -0
  11. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/db/__init__.py +0 -0
  12. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/db/cli.py +0 -0
  13. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/db/container.py +0 -0
  14. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/debug.py +0 -0
  15. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/default_settings.py +0 -0
  16. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/gunicorn_logging.json +0 -0
  17. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/mkcert.py +0 -0
  18. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/pid.py +0 -0
  19. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/poncho/__init__.py +0 -0
  20. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/poncho/color.py +0 -0
  21. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/poncho/compat.py +0 -0
  22. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/poncho/manager.py +0 -0
  23. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/poncho/printer.py +0 -0
  24. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/poncho/process.py +0 -0
  25. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/precommit/__init__.py +0 -0
  26. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/precommit/cli.py +0 -0
  27. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/requests.py +0 -0
  28. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/services.py +0 -0
  29. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/templates/dev/requests.html +0 -0
  30. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/urls.py +0 -0
  31. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/utils.py +0 -0
  32. {plain_dev-0.7.6 → plain_dev-0.8.1}/plain/dev/views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plain.dev
3
- Version: 0.7.6
3
+ Version: 0.8.1
4
4
  Summary: Local development tools for Plain.
5
5
  Home-page: https://plainframework.com
6
6
  License: BSD-3-Clause
@@ -81,22 +81,36 @@ class Dev:
81
81
  "PYTHONPATH": os.path.join(APP_PATH.parent, "app"),
82
82
  }
83
83
  self.project_name = os.path.basename(os.getcwd())
84
- self.domain = f"{self.project_name}.localhost"
85
84
  self.ssl_cert_path = None
86
85
  self.ssl_key_path = None
87
86
 
87
+ self.is_codespace = "CODESPACES" in os.environ
88
+
89
+ if self.is_codespace:
90
+ codespace_name = os.environ["CODESPACE_NAME"]
91
+ codespace_forward_domain = os.environ[
92
+ "GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN"
93
+ ]
94
+ self.domain = f"{codespace_name}-{self.port}.{codespace_forward_domain}"
95
+ self.url = f"https://{self.domain}/"
96
+ else:
97
+ self.domain = f"{self.project_name}.localhost"
98
+ self.url = f"https://{self.domain}:{self.port}/"
99
+
88
100
  def run(self):
89
101
  pid = Pid()
90
102
  pid.write()
91
103
 
92
104
  try:
93
- mkcert_manager = MkcertManager()
94
- mkcert_manager.setup_mkcert(install_path=Path.home() / ".plain" / "dev")
95
- self.ssl_cert_path, self.ssl_key_path = mkcert_manager.generate_certs(
96
- domain=self.domain,
97
- storage_path=Path(settings.PLAIN_TEMP_PATH) / "dev" / "certs",
98
- )
99
- self.modify_hosts_file()
105
+ if not self.is_codespace:
106
+ mkcert_manager = MkcertManager()
107
+ mkcert_manager.setup_mkcert(install_path=Path.home() / ".plain" / "dev")
108
+ self.ssl_cert_path, self.ssl_key_path = mkcert_manager.generate_certs(
109
+ domain=self.domain,
110
+ storage_path=Path(settings.PLAIN_TEMP_PATH) / "dev" / "certs",
111
+ )
112
+ self.modify_hosts_file()
113
+
100
114
  self.set_csrf_and_allowed_hosts()
101
115
  self.run_preflight()
102
116
 
@@ -107,9 +121,8 @@ class Dev:
107
121
  self.add_services()
108
122
 
109
123
  # Output the clickable link before starting the manager loop
110
- url = f"https://{self.domain}:{self.port}/"
111
124
  click.secho(
112
- f"\nYour app will run at: {click.style(url, fg='green', underline=True)}\n",
125
+ f"\nYour app will run at: {click.style(self.url, fg='green', underline=True)}\n",
113
126
  bold=True,
114
127
  )
115
128
 
@@ -5,7 +5,7 @@ packages = [
5
5
  { include = "plain" },
6
6
  ]
7
7
 
8
- version = "0.7.6"
8
+ version = "0.8.1"
9
9
  description = "Local development tools for Plain."
10
10
  authors = ["Dave Gaeddert <dave.gaeddert@dropseed.dev>"]
11
11
  license = "BSD-3-Clause"
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