plain.dev 0.25.0__tar.gz → 0.26.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.25.0 → plain_dev-0.26.1}/PKG-INFO +4 -4
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/README.md +3 -3
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/cli.py +14 -5
- {plain_dev-0.25.0 → plain_dev-0.26.1}/pyproject.toml +1 -1
- {plain_dev-0.25.0 → plain_dev-0.26.1}/.gitignore +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/LICENSE +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/README.md +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/__init__.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/contribute/README.md +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/contribute/__init__.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/contribute/cli.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/debug.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/default_settings.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/entrypoints.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/gunicorn_logging.json +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/mkcert.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/pdb.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/poncho/__init__.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/poncho/color.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/poncho/compat.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/poncho/manager.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/poncho/printer.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/poncho/process.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/precommit/__init__.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/precommit/cli.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/requests.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/services.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/templates/dev/requests.html +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/urls.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/utils.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/plain/dev/views.py +0 -0
- {plain_dev-0.25.0 → plain_dev-0.26.1}/tests/settings.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: plain.dev
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.26.1
|
4
4
|
Summary: Local development tools for Plain.
|
5
5
|
Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
|
6
6
|
License-Expression: BSD-3-Clause
|
@@ -22,7 +22,7 @@ A single command that runs everything you need for local development.
|
|
22
22
|
|
23
23
|

|
24
24
|
|
25
|
-
The `plain.dev` package can be [installed from PyPI](https://pypi.org/project/plain.dev/), and does
|
25
|
+
The `plain.dev` package can be [installed from PyPI](https://pypi.org/project/plain.dev/), and does _not_ need to be added to `INSTALLED_PACKAGES`.
|
26
26
|
|
27
27
|
- [`plain dev`](#plain-dev)
|
28
28
|
- [`plain dev services`](#plain-dev-services)
|
@@ -44,7 +44,7 @@ The `plain dev` command does several things:
|
|
44
44
|
|
45
45
|
### Services
|
46
46
|
|
47
|
-
Use services to define databases or other processes that your app
|
47
|
+
Use services to define databases or other processes that your app _needs_ to be functional. The services will be started automatically in `plain dev`, but also in `plain pre-commit` (so preflight and tests have a database).
|
48
48
|
|
49
49
|
Ultimately, how you run your development database is up to you. But a recommended starting point is to use Docker:
|
50
50
|
|
@@ -56,7 +56,7 @@ postgres = {cmd = "docker run --name app-postgres --rm -p 54321:5432 -v $(pwd)/.
|
|
56
56
|
|
57
57
|
### Custom processes
|
58
58
|
|
59
|
-
Unlike [services](#services), custom processes are
|
59
|
+
Unlike [services](#services), custom processes are _only_ run during `plain dev`. This is a good place to run something like [ngrok](https://ngrok.com/) or a [Plain worker](../../../plain-worker), which you might need to use your local site, but don't need running for executing tests, for example.
|
60
60
|
|
61
61
|
```toml
|
62
62
|
# pyproject.toml
|
@@ -4,7 +4,7 @@ A single command that runs everything you need for local development.
|
|
4
4
|
|
5
5
|

|
6
6
|
|
7
|
-
The `plain.dev` package can be [installed from PyPI](https://pypi.org/project/plain.dev/), and does
|
7
|
+
The `plain.dev` package can be [installed from PyPI](https://pypi.org/project/plain.dev/), and does _not_ need to be added to `INSTALLED_PACKAGES`.
|
8
8
|
|
9
9
|
- [`plain dev`](#plain-dev)
|
10
10
|
- [`plain dev services`](#plain-dev-services)
|
@@ -26,7 +26,7 @@ The `plain dev` command does several things:
|
|
26
26
|
|
27
27
|
### Services
|
28
28
|
|
29
|
-
Use services to define databases or other processes that your app
|
29
|
+
Use services to define databases or other processes that your app _needs_ to be functional. The services will be started automatically in `plain dev`, but also in `plain pre-commit` (so preflight and tests have a database).
|
30
30
|
|
31
31
|
Ultimately, how you run your development database is up to you. But a recommended starting point is to use Docker:
|
32
32
|
|
@@ -38,7 +38,7 @@ postgres = {cmd = "docker run --name app-postgres --rm -p 54321:5432 -v $(pwd)/.
|
|
38
38
|
|
39
39
|
### Custom processes
|
40
40
|
|
41
|
-
Unlike [services](#services), custom processes are
|
41
|
+
Unlike [services](#services), custom processes are _only_ run during `plain dev`. This is a good place to run something like [ngrok](https://ngrok.com/) or a [Plain worker](../../../plain-worker), which you might need to use your local site, but don't need running for executing tests, for example.
|
42
42
|
|
43
43
|
```toml
|
44
44
|
# pyproject.toml
|
@@ -218,12 +218,21 @@ class Dev:
|
|
218
218
|
).parent.parent
|
219
219
|
if not settings.PLAIN_TEMP_PATH.exists():
|
220
220
|
settings.PLAIN_TEMP_PATH.mkdir()
|
221
|
+
|
221
222
|
symlink_path = settings.PLAIN_TEMP_PATH / "src"
|
222
223
|
|
223
|
-
#
|
224
|
+
# The symlink is broken
|
224
225
|
if symlink_path.is_symlink() and not symlink_path.exists():
|
225
226
|
symlink_path.unlink()
|
226
227
|
|
228
|
+
# The symlink exists but points to the wrong place
|
229
|
+
if (
|
230
|
+
symlink_path.is_symlink()
|
231
|
+
and symlink_path.exists()
|
232
|
+
and symlink_path.resolve() != plain_path
|
233
|
+
):
|
234
|
+
symlink_path.unlink()
|
235
|
+
|
227
236
|
if plain_path.exists() and not symlink_path.exists():
|
228
237
|
symlink_path.symlink_to(plain_path)
|
229
238
|
|
@@ -326,6 +335,8 @@ class Dev:
|
|
326
335
|
str(self.ssl_cert_path),
|
327
336
|
"--keyfile",
|
328
337
|
str(self.ssl_key_path),
|
338
|
+
"--threads",
|
339
|
+
"4",
|
329
340
|
"--reload",
|
330
341
|
"plain.wsgi:app",
|
331
342
|
"--timeout",
|
@@ -351,10 +362,6 @@ class Dev:
|
|
351
362
|
else:
|
352
363
|
runserver_cmd = gunicorn
|
353
364
|
|
354
|
-
if "WEB_CONCURRENCY" not in self.plain_env:
|
355
|
-
# Default to two workers to prevent lockups
|
356
|
-
self.plain_env["WEB_CONCURRENCY"] = "2"
|
357
|
-
|
358
365
|
self.poncho.add_process("plain", runserver_cmd, env=self.plain_env)
|
359
366
|
|
360
367
|
def add_entrypoints(self):
|
@@ -390,6 +397,8 @@ class Dev:
|
|
390
397
|
click.secho("Services already running", fg="yellow")
|
391
398
|
return
|
392
399
|
|
400
|
+
# TODO need to set services pid here somehow...
|
401
|
+
|
393
402
|
# Split each service into a separate process
|
394
403
|
services = Services.get_services(APP_PATH.parent)
|
395
404
|
for name, data in services.items():
|
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
|
File without changes
|
File without changes
|
File without changes
|