plain.dev 0.11.0__tar.gz → 0.12.0__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 (33) hide show
  1. {plain_dev-0.11.0 → plain_dev-0.12.0}/PKG-INFO +1 -1
  2. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/cli.py +13 -8
  3. {plain_dev-0.11.0 → plain_dev-0.12.0}/pyproject.toml +1 -1
  4. {plain_dev-0.11.0 → plain_dev-0.12.0}/LICENSE +0 -0
  5. {plain_dev-0.11.0 → plain_dev-0.12.0}/README.md +0 -0
  6. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/README.md +0 -0
  7. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/__init__.py +0 -0
  8. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/config.py +0 -0
  9. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/contribute/__init__.py +0 -0
  10. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/contribute/cli.py +0 -0
  11. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/db/__init__.py +0 -0
  12. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/db/cli.py +0 -0
  13. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/db/container.py +0 -0
  14. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/debug.py +0 -0
  15. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/default_settings.py +0 -0
  16. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/entrypoints.py +0 -0
  17. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/gunicorn_logging.json +0 -0
  18. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/mkcert.py +0 -0
  19. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/pid.py +0 -0
  20. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/poncho/__init__.py +0 -0
  21. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/poncho/color.py +0 -0
  22. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/poncho/compat.py +0 -0
  23. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/poncho/manager.py +0 -0
  24. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/poncho/printer.py +0 -0
  25. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/poncho/process.py +0 -0
  26. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/precommit/__init__.py +0 -0
  27. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/precommit/cli.py +0 -0
  28. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/requests.py +0 -0
  29. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/services.py +0 -0
  30. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/templates/dev/requests.html +0 -0
  31. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/urls.py +0 -0
  32. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/utils.py +0 -0
  33. {plain_dev-0.11.0 → plain_dev-0.12.0}/plain/dev/views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plain.dev
3
- Version: 0.11.0
3
+ Version: 0.12.0
4
4
  Summary: Local development tools for Plain.
5
5
  Home-page: https://plainframework.com
6
6
  License: BSD-3-Clause
@@ -71,6 +71,13 @@ class Dev:
71
71
  def __init__(self, *, port):
72
72
  self.poncho = PonchoManager()
73
73
  self.port = port
74
+ self.project_name = os.path.basename(os.getcwd())
75
+ self.domain = f"{self.project_name}.localhost"
76
+ self.ssl_cert_path = None
77
+ self.ssl_key_path = None
78
+
79
+ self.url = f"https://{self.domain}:{self.port}"
80
+
74
81
  self.plain_env = {
75
82
  **os.environ,
76
83
  "PYTHONUNBUFFERED": "true",
@@ -78,11 +85,8 @@ class Dev:
78
85
  self.custom_process_env = {
79
86
  **self.plain_env,
80
87
  "PORT": str(self.port),
88
+ "PLAIN_DEV_URL": self.url,
81
89
  }
82
- self.project_name = os.path.basename(os.getcwd())
83
- self.domain = f"{self.project_name}.localhost"
84
- self.ssl_cert_path = None
85
- self.ssl_key_path = None
86
90
 
87
91
  def run(self):
88
92
  pid = Pid()
@@ -106,9 +110,8 @@ class Dev:
106
110
  self.add_services()
107
111
 
108
112
  # Output the clickable link before starting the manager loop
109
- url = f"https://{self.domain}:{self.port}/"
110
113
  click.secho(
111
- f"\nYour app will run at: {click.style(url, fg='green', underline=True)}\n",
114
+ f"\nYour app will run at: {click.style(self.url, fg='green', underline=True)}\n",
112
115
  bold=True,
113
116
  )
114
117
 
@@ -156,7 +159,7 @@ class Dev:
156
159
 
157
160
  # Entry does not exist; append it using sudo
158
161
  click.secho(
159
- "Modifying /etc/hosts file. You may be prompted for your password.\n",
162
+ f"Adding {self.domain} to /etc/hosts file. You may be prompted for your password.\n",
160
163
  bold=True,
161
164
  )
162
165
  cmd = f"echo '{hosts_entry}' | sudo tee -a {hosts_path} >/dev/null"
@@ -178,7 +181,7 @@ class Dev:
178
181
  def set_csrf_and_allowed_hosts(self):
179
182
  csrf_trusted_origins = json.dumps(
180
183
  [
181
- f"https://{self.domain}:{self.port}",
184
+ self.url,
182
185
  ]
183
186
  )
184
187
  allowed_hosts = json.dumps([self.domain])
@@ -255,6 +258,7 @@ class Dev:
255
258
  )
256
259
 
257
260
  def add_pyproject_run(self):
261
+ """Additional processes that only run during `plain dev`."""
258
262
  if not has_pyproject_toml(APP_PATH.parent):
259
263
  return
260
264
 
@@ -272,6 +276,7 @@ class Dev:
272
276
  self.poncho.add_process(name, data["cmd"], env=env)
273
277
 
274
278
  def add_services(self):
279
+ """Services are things that also run during tests (like a database), and are critical for the app to function."""
275
280
  services = Services.get_services(APP_PATH.parent)
276
281
  for name, data in services.items():
277
282
  env = {
@@ -5,7 +5,7 @@ packages = [
5
5
  { include = "plain" },
6
6
  ]
7
7
 
8
- version = "0.11.0"
8
+ version = "0.12.0"
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