plain.dev 0.8.0__tar.gz → 0.8.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 (32) hide show
  1. {plain_dev-0.8.0 → plain_dev-0.8.2}/PKG-INFO +1 -1
  2. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/cli.py +27 -15
  3. {plain_dev-0.8.0 → plain_dev-0.8.2}/pyproject.toml +1 -1
  4. {plain_dev-0.8.0 → plain_dev-0.8.2}/LICENSE +0 -0
  5. {plain_dev-0.8.0 → plain_dev-0.8.2}/README.md +0 -0
  6. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/README.md +0 -0
  7. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/__init__.py +0 -0
  8. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/config.py +0 -0
  9. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/contribute/__init__.py +0 -0
  10. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/contribute/cli.py +0 -0
  11. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/db/__init__.py +0 -0
  12. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/db/cli.py +0 -0
  13. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/db/container.py +0 -0
  14. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/debug.py +0 -0
  15. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/default_settings.py +0 -0
  16. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/gunicorn_logging.json +0 -0
  17. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/mkcert.py +0 -0
  18. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/pid.py +0 -0
  19. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/poncho/__init__.py +0 -0
  20. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/poncho/color.py +0 -0
  21. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/poncho/compat.py +0 -0
  22. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/poncho/manager.py +0 -0
  23. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/poncho/printer.py +0 -0
  24. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/poncho/process.py +0 -0
  25. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/precommit/__init__.py +0 -0
  26. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/precommit/cli.py +0 -0
  27. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/requests.py +0 -0
  28. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/services.py +0 -0
  29. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/templates/dev/requests.html +0 -0
  30. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/urls.py +0 -0
  31. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/utils.py +0 -0
  32. {plain_dev-0.8.0 → plain_dev-0.8.2}/plain/dev/views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plain.dev
3
- Version: 0.8.0
3
+ Version: 0.8.2
4
4
  Summary: Local development tools for Plain.
5
5
  Home-page: https://plainframework.com
6
6
  License: BSD-3-Clause
@@ -81,22 +81,30 @@ 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
+ self.gunicorn_bind = str(self.port)
97
+ else:
98
+ self.domain = f"{self.project_name}.localhost"
99
+ self.url = f"https://{self.domain}:{self.port}/"
100
+ self.gunicorn_bind = f"{self.domain}:{self.port}"
101
+
88
102
  def run(self):
89
103
  pid = Pid()
90
104
  pid.write()
91
105
 
92
106
  try:
93
- if "CODESPACES" in os.environ:
94
- codespace_name = os.environ["CODESPACE_NAME"]
95
- codespace_forward_domain = os.environ[
96
- "GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN"
97
- ]
98
- self.domain = f"https://{codespace_name}.{codespace_forward_domain}"
99
- else:
107
+ if not self.is_codespace:
100
108
  mkcert_manager = MkcertManager()
101
109
  mkcert_manager.setup_mkcert(install_path=Path.home() / ".plain" / "dev")
102
110
  self.ssl_cert_path, self.ssl_key_path = mkcert_manager.generate_certs(
@@ -115,9 +123,8 @@ class Dev:
115
123
  self.add_services()
116
124
 
117
125
  # Output the clickable link before starting the manager loop
118
- url = f"https://{self.domain}:{self.port}/"
119
126
  click.secho(
120
- f"\nYour app will run at: {click.style(url, fg='green', underline=True)}\n",
127
+ f"\nYour app will run at: {click.style(self.url, fg='green', underline=True)}\n",
121
128
  bold=True,
122
129
  )
123
130
 
@@ -223,11 +230,7 @@ class Dev:
223
230
  gunicorn_cmd = [
224
231
  "gunicorn",
225
232
  "--bind",
226
- f"{self.domain}:{self.port}",
227
- "--certfile",
228
- str(self.ssl_cert_path),
229
- "--keyfile",
230
- str(self.ssl_key_path),
233
+ self.gunicorn_bind,
231
234
  "--reload",
232
235
  "plain.wsgi:app",
233
236
  "--timeout",
@@ -242,6 +245,15 @@ class Dev:
242
245
  "--log-config-json",
243
246
  str(Path(__file__).parent / "gunicorn_logging.json"),
244
247
  ]
248
+
249
+ if self.ssl_cert_path and self.ssl_key_path:
250
+ gunicorn_cmd += [
251
+ "--certfile",
252
+ str(self.ssl_cert_path),
253
+ "--keyfile",
254
+ str(self.ssl_key_path),
255
+ ]
256
+
245
257
  gunicorn = " ".join(gunicorn_cmd)
246
258
 
247
259
  if plain_db_installed:
@@ -5,7 +5,7 @@ packages = [
5
5
  { include = "plain" },
6
6
  ]
7
7
 
8
- version = "0.8.0"
8
+ version = "0.8.2"
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