plain.dev 0.10.0__py3-none-any.whl → 0.12.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 +13 -8
- plain/dev/entrypoints.py +5 -0
- {plain_dev-0.10.0.dist-info → plain_dev-0.12.0.dist-info}/METADATA +2 -1
- {plain_dev-0.10.0.dist-info → plain_dev-0.12.0.dist-info}/RECORD +7 -6
- {plain_dev-0.10.0.dist-info → plain_dev-0.12.0.dist-info}/entry_points.txt +3 -0
- {plain_dev-0.10.0.dist-info → plain_dev-0.12.0.dist-info}/LICENSE +0 -0
- {plain_dev-0.10.0.dist-info → plain_dev-0.12.0.dist-info}/WHEEL +0 -0
plain/dev/cli.py
CHANGED
@@ -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
|
-
"
|
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
|
-
|
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 = {
|
plain/dev/entrypoints.py
ADDED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: plain.dev
|
3
|
-
Version: 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
|
@@ -17,6 +17,7 @@ Requires-Dist: debugpy (>=1.6.3,<2.0.0)
|
|
17
17
|
Requires-Dist: gunicorn (>20)
|
18
18
|
Requires-Dist: plain (<1.0.0)
|
19
19
|
Requires-Dist: psycopg[binary] (>=3.2.2,<4.0.0)
|
20
|
+
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
|
20
21
|
Requires-Dist: requests (>=2.0.0)
|
21
22
|
Project-URL: Documentation, https://plainframework.com/docs/
|
22
23
|
Project-URL: Repository, https://github.com/dropseed/plain
|
@@ -1,6 +1,6 @@
|
|
1
1
|
plain/dev/README.md,sha256=BQDaRKfsafIPzx7vtVt-zS-a8l6sxbQThhQTvu7tp3Y,3699
|
2
2
|
plain/dev/__init__.py,sha256=C1JrkNE5XX2DLgBXXLAV_UyhofwVd0ZPL59fPUMbOKo,139
|
3
|
-
plain/dev/cli.py,sha256=
|
3
|
+
plain/dev/cli.py,sha256=NZTxG_iF_eauRZUtF-DqlRrCz7rCKHuoGQUoYGMhwso,9476
|
4
4
|
plain/dev/config.py,sha256=h6o5YZtJhg-cFIWoqIDWuMCC5T09cxEsBaa3BP4Nii0,632
|
5
5
|
plain/dev/contribute/__init__.py,sha256=9ByBOIdM8DebChjNz-RH2atdz4vWe8somlwNEsbhwh4,40
|
6
6
|
plain/dev/contribute/cli.py,sha256=qZ7YmE_upbw-Y5NRpvaHnJTPp9kvn21fPQ7G0n1LAkg,2277
|
@@ -9,6 +9,7 @@ plain/dev/db/cli.py,sha256=058HjRKLGz-FxauQEpwsPoh_LCiy-_NEIpRZl9W1ZKM,2855
|
|
9
9
|
plain/dev/db/container.py,sha256=RlPJU_CCMKA-zN8Kp0sYAu3jabOizxYAj8fSCsjCf60,5147
|
10
10
|
plain/dev/debug.py,sha256=fIrecLfAK_lXSDyn3WmYikzZSse3KY47xcVVbZqJGhk,294
|
11
11
|
plain/dev/default_settings.py,sha256=uXWYORWP_aRDwXIFXdu5kHyiBFUZzARIJdhPeFaX35c,75
|
12
|
+
plain/dev/entrypoints.py,sha256=qBTP2A9pgxQmZ9hGV0OiBL92v9wa7TeJdOXnKZcX6AE,81
|
12
13
|
plain/dev/gunicorn_logging.json,sha256=yU23jzs5G4YGdDWBNiyAc3KypR4HirR6afIkD7w6DhU,1113
|
13
14
|
plain/dev/mkcert.py,sha256=u284XXQeTgwSkKKh0gMrYpnNGdd9OOUJKLQAXcvGnr4,3459
|
14
15
|
plain/dev/pid.py,sha256=gRMBf7aGndrra1TnmKtPghTijnd0i0Xeo63mzfPWp7M,436
|
@@ -26,8 +27,8 @@ plain/dev/templates/dev/requests.html,sha256=kQKJZq5L77juuL_t8UjcAehEU61U4RXNnKa
|
|
26
27
|
plain/dev/urls.py,sha256=b4NL2I6Ok-t7nTPjRnKoz_LQRttE3_mp8l2NlmeYQ9I,146
|
27
28
|
plain/dev/utils.py,sha256=4wMzpvj1Is_c0QxhsTu34_P9wAYlzw4glNPfVtZr_0A,123
|
28
29
|
plain/dev/views.py,sha256=r2Ivk7OXytpRhXq4DZpsb7FXNP9vzmEE3D5kLajYG4w,1073
|
29
|
-
plain_dev-0.
|
30
|
-
plain_dev-0.
|
31
|
-
plain_dev-0.
|
32
|
-
plain_dev-0.
|
33
|
-
plain_dev-0.
|
30
|
+
plain_dev-0.12.0.dist-info/LICENSE,sha256=YDg-l_Rj7LVP5uDXy04eQPGb_DYVXAHAHYd9r3pU1Cg,2713
|
31
|
+
plain_dev-0.12.0.dist-info/METADATA,sha256=pcyEDMZo6vR0bJv8_KgOdsI6TdyalpWHiRaTQ37Y7_Q,4722
|
32
|
+
plain_dev-0.12.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
33
|
+
plain_dev-0.12.0.dist-info/entry_points.txt,sha256=1FaE_73k95WYOJrmB0hcHBnEIFQa-Cfl56Z1LGxyvak,164
|
34
|
+
plain_dev-0.12.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|