plain.dev 0.29.2__tar.gz → 0.30.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.
- {plain_dev-0.29.2 → plain_dev-0.30.1}/PKG-INFO +1 -1
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/cli.py +11 -5
- plain_dev-0.30.1/plain/dev/gunicorn_logging.json +40 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/poncho/manager.py +6 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/requests.py +2 -2
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/services.py +2 -2
- {plain_dev-0.29.2 → plain_dev-0.30.1}/pyproject.toml +1 -1
- plain_dev-0.29.2/plain/dev/gunicorn_logging.json +0 -46
- {plain_dev-0.29.2 → plain_dev-0.30.1}/.gitignore +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/LICENSE +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/README.md +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/README.md +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/__init__.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/contribute/README.md +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/contribute/__init__.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/contribute/cli.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/debug.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/default_settings.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/entrypoints.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/mkcert.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/pdb.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/poncho/__init__.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/poncho/color.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/poncho/compat.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/poncho/printer.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/poncho/process.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/precommit/__init__.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/precommit/cli.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/templates/dev/requests.html +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/urls.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/utils.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/plain/dev/views.py +0 -0
- {plain_dev-0.29.2 → plain_dev-0.30.1}/tests/settings.py +0 -0
@@ -18,7 +18,7 @@ from rich.console import Console
|
|
18
18
|
from rich.text import Text
|
19
19
|
|
20
20
|
from plain.cli import register_cli
|
21
|
-
from plain.runtime import APP_PATH,
|
21
|
+
from plain.runtime import APP_PATH, PLAIN_TEMP_PATH
|
22
22
|
|
23
23
|
from .mkcert import MkcertManager
|
24
24
|
from .poncho.manager import Manager as PonchoManager
|
@@ -196,7 +196,7 @@ class Dev:
|
|
196
196
|
mkcert_manager.setup_mkcert(install_path=Path.home() / ".plain" / "dev")
|
197
197
|
self.ssl_cert_path, self.ssl_key_path = mkcert_manager.generate_certs(
|
198
198
|
domain=self.hostname,
|
199
|
-
storage_path=Path(
|
199
|
+
storage_path=Path(PLAIN_TEMP_PATH) / "dev" / "certs",
|
200
200
|
)
|
201
201
|
|
202
202
|
self.symlink_plain_src()
|
@@ -236,6 +236,12 @@ class Dev:
|
|
236
236
|
target=_process_task, args=(self.plain_env,)
|
237
237
|
)
|
238
238
|
process.start()
|
239
|
+
|
240
|
+
# If there are no poncho processes, then let this process finish before
|
241
|
+
# continuing (vs running in parallel)
|
242
|
+
if self.poncho.num_processes() == 0:
|
243
|
+
# Wait for the process to finish
|
244
|
+
process.join()
|
239
245
|
else:
|
240
246
|
# Start the app processes immediately
|
241
247
|
self.start_app(None, None)
|
@@ -279,10 +285,10 @@ class Dev:
|
|
279
285
|
plain_path = Path(
|
280
286
|
importlib.util.find_spec("plain.runtime").origin
|
281
287
|
).parent.parent
|
282
|
-
if not
|
283
|
-
|
288
|
+
if not PLAIN_TEMP_PATH.exists():
|
289
|
+
PLAIN_TEMP_PATH.mkdir()
|
284
290
|
|
285
|
-
symlink_path =
|
291
|
+
symlink_path = PLAIN_TEMP_PATH / "src"
|
286
292
|
|
287
293
|
# The symlink is broken
|
288
294
|
if symlink_path.is_symlink() and not symlink_path.exists():
|
@@ -0,0 +1,40 @@
|
|
1
|
+
{
|
2
|
+
"version": 1,
|
3
|
+
"disable_existing_loggers": false,
|
4
|
+
"root": {
|
5
|
+
"level": "INFO",
|
6
|
+
"handlers": ["console"]
|
7
|
+
},
|
8
|
+
"loggers": {
|
9
|
+
"gunicorn.error": {
|
10
|
+
"level": "INFO",
|
11
|
+
"handlers": ["error_console"],
|
12
|
+
"propagate": false,
|
13
|
+
"qualname": "gunicorn.error"
|
14
|
+
},
|
15
|
+
"gunicorn.access": {
|
16
|
+
"level": "INFO",
|
17
|
+
"handlers": ["console"],
|
18
|
+
"propagate": false,
|
19
|
+
"qualname": "gunicorn.access"
|
20
|
+
}
|
21
|
+
},
|
22
|
+
"handlers": {
|
23
|
+
"console": {
|
24
|
+
"class": "logging.StreamHandler",
|
25
|
+
"formatter": "generic",
|
26
|
+
"stream": "ext://sys.stdout"
|
27
|
+
},
|
28
|
+
"error_console": {
|
29
|
+
"class": "logging.StreamHandler",
|
30
|
+
"formatter": "generic",
|
31
|
+
"stream": "ext://sys.stderr"
|
32
|
+
}
|
33
|
+
},
|
34
|
+
"formatters": {
|
35
|
+
"generic": {
|
36
|
+
"format": "[%(process)d] [%(levelname)s] %(message)s",
|
37
|
+
"class": "logging.Formatter"
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
@@ -82,6 +82,12 @@ class Manager:
|
|
82
82
|
|
83
83
|
return proc
|
84
84
|
|
85
|
+
def num_processes(self):
|
86
|
+
"""
|
87
|
+
Return the number of processes managed by this instance.
|
88
|
+
"""
|
89
|
+
return len(self._processes)
|
90
|
+
|
85
91
|
def loop(self):
|
86
92
|
"""
|
87
93
|
Start all the added processes and multiplex their output onto the bound
|
@@ -6,7 +6,7 @@ import traceback
|
|
6
6
|
|
7
7
|
import requests
|
8
8
|
|
9
|
-
from plain.runtime import settings
|
9
|
+
from plain.runtime import PLAIN_TEMP_PATH, settings
|
10
10
|
from plain.signals import got_request_exception
|
11
11
|
|
12
12
|
|
@@ -18,7 +18,7 @@ class RequestLog:
|
|
18
18
|
|
19
19
|
@staticmethod
|
20
20
|
def storage_path():
|
21
|
-
return str(
|
21
|
+
return str(PLAIN_TEMP_PATH / "dev" / "requestlog")
|
22
22
|
|
23
23
|
@classmethod
|
24
24
|
def replay_request(cls, name):
|
@@ -7,7 +7,7 @@ from pathlib import Path
|
|
7
7
|
|
8
8
|
import click
|
9
9
|
|
10
|
-
from plain.runtime import APP_PATH,
|
10
|
+
from plain.runtime import APP_PATH, PLAIN_TEMP_PATH
|
11
11
|
|
12
12
|
from .poncho.manager import Manager as PonchoManager
|
13
13
|
from .utils import has_pyproject_toml
|
@@ -15,7 +15,7 @@ from .utils import has_pyproject_toml
|
|
15
15
|
|
16
16
|
class ServicesPid:
|
17
17
|
def __init__(self):
|
18
|
-
self.pidfile =
|
18
|
+
self.pidfile = PLAIN_TEMP_PATH / "dev" / "services.pid"
|
19
19
|
|
20
20
|
def write(self):
|
21
21
|
pid = os.getpid()
|
@@ -1,46 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": 1,
|
3
|
-
"disable_existing_loggers": false,
|
4
|
-
"root": {
|
5
|
-
"level": "INFO",
|
6
|
-
"handlers": [
|
7
|
-
"console"
|
8
|
-
]
|
9
|
-
},
|
10
|
-
"loggers": {
|
11
|
-
"gunicorn.error": {
|
12
|
-
"level": "INFO",
|
13
|
-
"handlers": [
|
14
|
-
"error_console"
|
15
|
-
],
|
16
|
-
"propagate": false,
|
17
|
-
"qualname": "gunicorn.error"
|
18
|
-
},
|
19
|
-
"gunicorn.access": {
|
20
|
-
"level": "INFO",
|
21
|
-
"handlers": [
|
22
|
-
"console"
|
23
|
-
],
|
24
|
-
"propagate": false,
|
25
|
-
"qualname": "gunicorn.access"
|
26
|
-
}
|
27
|
-
},
|
28
|
-
"handlers": {
|
29
|
-
"console": {
|
30
|
-
"class": "logging.StreamHandler",
|
31
|
-
"formatter": "generic",
|
32
|
-
"stream": "ext://sys.stdout"
|
33
|
-
},
|
34
|
-
"error_console": {
|
35
|
-
"class": "logging.StreamHandler",
|
36
|
-
"formatter": "generic",
|
37
|
-
"stream": "ext://sys.stderr"
|
38
|
-
}
|
39
|
-
},
|
40
|
-
"formatters": {
|
41
|
-
"generic": {
|
42
|
-
"format": "[%(process)d] [%(levelname)s] %(message)s",
|
43
|
-
"class": "logging.Formatter"
|
44
|
-
}
|
45
|
-
}
|
46
|
-
}
|
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
|
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
|
File without changes
|
File without changes
|
File without changes
|