plain.dev 0.14.0__py3-none-any.whl → 0.14.2__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/README.md CHANGED
@@ -58,7 +58,7 @@ Runs:
58
58
 
59
59
  - Custom commands defined in `pyproject.toml` at `tool.plain.pre-commit.run`
60
60
  - `plain code check`, if [`plain.code`](https://plainframework.com/docs/plain-code/plain/code/) is installed
61
- - `poetry check --lock`, if using [Poetry](https://python-poetry.org/)
61
+ - `uv lock --locked`, if using uv
62
62
  - `plain preflight --database default`
63
63
  - `plain migrate --check`
64
64
  - `plain makemigrations --dry-run --check`
plain/dev/cli.py CHANGED
@@ -1,14 +1,15 @@
1
+ import importlib
1
2
  import json
2
3
  import os
3
4
  import platform
4
5
  import subprocess
5
6
  import sys
7
+ import tomllib
6
8
  from importlib.metadata import entry_points
7
9
  from importlib.util import find_spec
8
10
  from pathlib import Path
9
11
 
10
12
  import click
11
- import tomllib
12
13
 
13
14
  from plain.runtime import APP_PATH, settings
14
15
 
@@ -120,6 +121,8 @@ class Dev:
120
121
  domain=self.hostname,
121
122
  storage_path=Path(settings.PLAIN_TEMP_PATH) / "dev" / "certs",
122
123
  )
124
+
125
+ self.symlink_plain_src()
123
126
  self.modify_hosts_file()
124
127
  self.set_csrf_and_allowed_hosts()
125
128
  self.run_preflight()
@@ -144,6 +147,17 @@ class Dev:
144
147
  finally:
145
148
  pid.rm()
146
149
 
150
+ def symlink_plain_src(self):
151
+ """Symlink the plain package into .plain so we can look at it easily"""
152
+ plain_path = Path(
153
+ importlib.util.find_spec("plain.runtime").origin
154
+ ).parent.parent
155
+ if not settings.PLAIN_TEMP_PATH.exists():
156
+ settings.PLAIN_TEMP_PATH.mkdir()
157
+ src_path = settings.PLAIN_TEMP_PATH / "src"
158
+ if plain_path.exists() and not src_path.exists():
159
+ src_path.symlink_to(plain_path)
160
+
147
161
  def modify_hosts_file(self):
148
162
  """Modify the hosts file to map the custom domain to 127.0.0.1."""
149
163
  entry_identifier = "# Added by plain"
@@ -2,6 +2,7 @@
2
2
  Compatibility layer and utilities, mostly for proper Windows and Python 3
3
3
  support.
4
4
  """
5
+
5
6
  import errno
6
7
  import os
7
8
  import signal
@@ -91,7 +91,7 @@ class Manager:
91
91
  """
92
92
 
93
93
  def _terminate(signum, frame):
94
- self._system_print("%s received\n" % SIGNALS[signum]["name"])
94
+ self._system_print("{} received\n".format(SIGNALS[signum]["name"]))
95
95
  self.returncode = SIGNALS[signum]["rc"]
96
96
  self.terminate()
97
97
 
@@ -1,11 +1,11 @@
1
1
  import os
2
2
  import subprocess
3
3
  import sys
4
+ import tomllib
4
5
  from importlib.util import find_spec
5
6
  from pathlib import Path
6
7
 
7
8
  import click
8
- import tomllib
9
9
 
10
10
  from plain.cli.print import print_event
11
11
 
@@ -56,8 +56,8 @@ def cli(install):
56
56
  if find_spec("plain.code"):
57
57
  check_short("Running plain code checks", "plain", "code", "check")
58
58
 
59
- if Path("poetry.lock").exists():
60
- check_short("Checking poetry.lock", "poetry", "check", "--lock")
59
+ if Path("uv.lock").exists():
60
+ check_short("Checking uv.lock", "uv", "lock", "--locked")
61
61
 
62
62
  if plain_db_connected():
63
63
  check_short(
plain/dev/requests.py CHANGED
@@ -18,7 +18,7 @@ class RequestLog:
18
18
 
19
19
  @staticmethod
20
20
  def storage_path():
21
- return str(settings.PLAIN_TEMP_PATH / "requestlog")
21
+ return str(settings.PLAIN_TEMP_PATH / "dev" / "requestlog")
22
22
 
23
23
  @classmethod
24
24
  def replay_request(cls, name):
plain/dev/services.py CHANGED
@@ -1,11 +1,11 @@
1
1
  import os
2
2
  import subprocess
3
3
  import time
4
+ import tomllib
4
5
  from importlib.util import find_spec
5
6
  from pathlib import Path
6
7
 
7
8
  import click
8
- import tomllib
9
9
 
10
10
  from plain.runtime import APP_PATH
11
11
 
@@ -1,26 +1,18 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: plain.dev
3
- Version: 0.14.0
3
+ Version: 0.14.2
4
4
  Summary: Local development tools for Plain.
5
- Home-page: https://plainframework.com
6
- License: BSD-3-Clause
7
- Author: Dave Gaeddert
8
- Author-email: dave.gaeddert@dropseed.dev
9
- Requires-Python: >=3.11,<4.0
10
- Classifier: License :: OSI Approved :: BSD License
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Classifier: Programming Language :: Python :: 3.13
15
- Requires-Dist: click (>=8.0.0)
16
- Requires-Dist: debugpy (>=1.6.3,<2.0.0)
17
- Requires-Dist: gunicorn (>20)
18
- Requires-Dist: plain (<1.0.0)
19
- Requires-Dist: psycopg[binary] (>=3.2.2,<4.0.0)
20
- Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
21
- Requires-Dist: requests (>=2.0.0)
22
- Project-URL: Documentation, https://plainframework.com/docs/
23
- Project-URL: Repository, https://github.com/dropseed/plain
5
+ Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
+ License-Expression: BSD-3-Clause
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.11
9
+ Requires-Dist: click>=8.0.0
10
+ Requires-Dist: debugpy~=1.6.3
11
+ Requires-Dist: gunicorn>20
12
+ Requires-Dist: plain<1.0.0
13
+ Requires-Dist: psycopg[binary]~=3.2.2
14
+ Requires-Dist: python-dotenv~=1.0.0
15
+ Requires-Dist: requests>=2.0.0
24
16
  Description-Content-Type: text/markdown
25
17
 
26
18
  <!-- This file is compiled from plain-dev/plain/dev/README.md. Do not edit this file directly. -->
@@ -85,7 +77,7 @@ Runs:
85
77
 
86
78
  - Custom commands defined in `pyproject.toml` at `tool.plain.pre-commit.run`
87
79
  - `plain code check`, if [`plain.code`](https://plainframework.com/docs/plain-code/plain/code/) is installed
88
- - `poetry check --lock`, if using [Poetry](https://python-poetry.org/)
80
+ - `uv lock --locked`, if using uv
89
81
  - `plain preflight --database default`
90
82
  - `plain migrate --check`
91
83
  - `plain makemigrations --dry-run --check`
@@ -121,4 +113,3 @@ class HomeView(TemplateView):
121
113
  When you load the page, you'll see "Waiting for debugger to attach...".
122
114
 
123
115
  You can then run the VS Code debugger and attach to an existing Python process, at localhost:5678.
124
-
@@ -1,34 +1,33 @@
1
- plain/dev/README.md,sha256=BQDaRKfsafIPzx7vtVt-zS-a8l6sxbQThhQTvu7tp3Y,3699
1
+ plain/dev/README.md,sha256=-yR4qzwEP7vDVvCAHJ22aaQHQ7rXVW9uy0KEZjCzmz4,3662
2
2
  plain/dev/__init__.py,sha256=C1JrkNE5XX2DLgBXXLAV_UyhofwVd0ZPL59fPUMbOKo,139
3
- plain/dev/cli.py,sha256=IzO14253uPogLV2emmZHKhBQgc7mCtr8VmfhR_g2O7g,10082
4
- plain/dev/config.py,sha256=h6o5YZtJhg-cFIWoqIDWuMCC5T09cxEsBaa3BP4Nii0,632
5
- plain/dev/contribute/__init__.py,sha256=9ByBOIdM8DebChjNz-RH2atdz4vWe8somlwNEsbhwh4,40
6
- plain/dev/contribute/cli.py,sha256=vrHSYM0Y2XtIUbxmNcJqssoPN-ZbkH4T_p65NVkYrV4,2339
7
- plain/dev/db/__init__.py,sha256=9ByBOIdM8DebChjNz-RH2atdz4vWe8somlwNEsbhwh4,40
8
- plain/dev/db/cli.py,sha256=058HjRKLGz-FxauQEpwsPoh_LCiy-_NEIpRZl9W1ZKM,2855
9
- plain/dev/db/container.py,sha256=RlPJU_CCMKA-zN8Kp0sYAu3jabOizxYAj8fSCsjCf60,5147
3
+ plain/dev/cli.py,sha256=dvEMZ0YkUNnLl3qDlKMkuhso4dTW9r8fHAvNprJwqPk,10612
10
4
  plain/dev/debug.py,sha256=fIrecLfAK_lXSDyn3WmYikzZSse3KY47xcVVbZqJGhk,294
11
5
  plain/dev/default_settings.py,sha256=uXWYORWP_aRDwXIFXdu5kHyiBFUZzARIJdhPeFaX35c,75
12
6
  plain/dev/entrypoints.py,sha256=qBTP2A9pgxQmZ9hGV0OiBL92v9wa7TeJdOXnKZcX6AE,81
13
7
  plain/dev/gunicorn_logging.json,sha256=yU23jzs5G4YGdDWBNiyAc3KypR4HirR6afIkD7w6DhU,1113
14
8
  plain/dev/mkcert.py,sha256=u284XXQeTgwSkKKh0gMrYpnNGdd9OOUJKLQAXcvGnr4,3459
15
9
  plain/dev/pid.py,sha256=gRMBf7aGndrra1TnmKtPghTijnd0i0Xeo63mzfPWp7M,436
10
+ plain/dev/requests.py,sha256=v4ucDL8d6I0s5kF8O8HRvSc6Snq1Z_SMQv7wGGAI_Us,6847
11
+ plain/dev/services.py,sha256=26WnVNjNAh37BA-wHQSGQY_9Ofw8oGgJdHhxnFaSKkg,2059
12
+ plain/dev/urls.py,sha256=b4NL2I6Ok-t7nTPjRnKoz_LQRttE3_mp8l2NlmeYQ9I,146
13
+ plain/dev/utils.py,sha256=4wMzpvj1Is_c0QxhsTu34_P9wAYlzw4glNPfVtZr_0A,123
14
+ plain/dev/views.py,sha256=r2Ivk7OXytpRhXq4DZpsb7FXNP9vzmEE3D5kLajYG4w,1073
15
+ plain/dev/contribute/__init__.py,sha256=9ByBOIdM8DebChjNz-RH2atdz4vWe8somlwNEsbhwh4,40
16
+ plain/dev/contribute/cli.py,sha256=vrHSYM0Y2XtIUbxmNcJqssoPN-ZbkH4T_p65NVkYrV4,2339
17
+ plain/dev/db/__init__.py,sha256=9ByBOIdM8DebChjNz-RH2atdz4vWe8somlwNEsbhwh4,40
18
+ plain/dev/db/cli.py,sha256=058HjRKLGz-FxauQEpwsPoh_LCiy-_NEIpRZl9W1ZKM,2855
19
+ plain/dev/db/container.py,sha256=RlPJU_CCMKA-zN8Kp0sYAu3jabOizxYAj8fSCsjCf60,5147
16
20
  plain/dev/poncho/__init__.py,sha256=MDOk2rhhoR3V-I-rg6tMHFeX60vTGJuQ14RI-_N6tQY,97
17
21
  plain/dev/poncho/color.py,sha256=Dk77inPR9qNc9vCaZOGk8W9skXfRgoUlxp_E6mhPNns,610
18
- plain/dev/poncho/compat.py,sha256=YzioS5fuzUl6j55fzgvhsU6TS_IdegMtv7FUSUU6sBQ,1275
19
- plain/dev/poncho/manager.py,sha256=UaC4Qlejy4tVAz_6z5J4Auu5PZBW1pUuo9hUMfIMSFQ,6360
22
+ plain/dev/poncho/compat.py,sha256=l66WZLR7kRpO8P8DI5-aUsbNlohPaXEurQ5xXESQYDs,1276
23
+ plain/dev/poncho/manager.py,sha256=l_m_RhNTF9Fs6p0Tk8pdjd5ZxQxU1kbGEgDD-qJaFGs,6366
20
24
  plain/dev/poncho/printer.py,sha256=KSkSXx6KiejekJ9e4bzutIAIL8oZPDGimtVHNRJyFbQ,2671
21
25
  plain/dev/poncho/process.py,sha256=JJOKy-C6vMCg7-6JMCtu6C649h7HmOBSJqDP_hnX49I,2637
22
26
  plain/dev/precommit/__init__.py,sha256=9ByBOIdM8DebChjNz-RH2atdz4vWe8somlwNEsbhwh4,40
23
- plain/dev/precommit/cli.py,sha256=UNrQmWRKrkZ6WbzrrcnjZl8VHwNorOVTHGoRQsR4jp8,3422
24
- plain/dev/requests.py,sha256=0HyCH7iZ32ne94ypMdE96z5iYb_Qbd705WItVik1SyA,6839
25
- plain/dev/services.py,sha256=XwtMpTjyZzEB8RVgjRuW9PRMQSTuhUAN-zY4Kl_kSZY,2059
27
+ plain/dev/precommit/cli.py,sha256=D_A5Mk2eXqjJDSUE6qyCFFddhM7wBZR3C9hgkDRx_v8,3411
26
28
  plain/dev/templates/dev/requests.html,sha256=kQKJZq5L77juuL_t8UjcAehEU61U4RXNnKaAET-wAm8,7627
27
- plain/dev/urls.py,sha256=b4NL2I6Ok-t7nTPjRnKoz_LQRttE3_mp8l2NlmeYQ9I,146
28
- plain/dev/utils.py,sha256=4wMzpvj1Is_c0QxhsTu34_P9wAYlzw4glNPfVtZr_0A,123
29
- plain/dev/views.py,sha256=r2Ivk7OXytpRhXq4DZpsb7FXNP9vzmEE3D5kLajYG4w,1073
30
- plain_dev-0.14.0.dist-info/LICENSE,sha256=YDg-l_Rj7LVP5uDXy04eQPGb_DYVXAHAHYd9r3pU1Cg,2713
31
- plain_dev-0.14.0.dist-info/METADATA,sha256=4g2sbwYs-P6FvdpJfOvXSERFu0vBB7r6j3wsBP74w8A,4722
32
- plain_dev-0.14.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
33
- plain_dev-0.14.0.dist-info/entry_points.txt,sha256=1FaE_73k95WYOJrmB0hcHBnEIFQa-Cfl56Z1LGxyvak,164
34
- plain_dev-0.14.0.dist-info/RECORD,,
29
+ plain_dev-0.14.2.dist-info/METADATA,sha256=bJajMNTo0ucuFRhBfXMlCuV4JLEtnyOG7Uox_5PjjT8,4254
30
+ plain_dev-0.14.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
31
+ plain_dev-0.14.2.dist-info/entry_points.txt,sha256=jncRPB4B7d27YWkzWqzt68y534ntliHPNukv_kQu5KY,171
32
+ plain_dev-0.14.2.dist-info/licenses/LICENSE,sha256=YDg-l_Rj7LVP5uDXy04eQPGb_DYVXAHAHYd9r3pU1Cg,2713
33
+ plain_dev-0.14.2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.1
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -0,0 +1,7 @@
1
+ [plain.cli]
2
+ contrib = plain.dev.contribute:cli
3
+ dev = plain.dev:cli
4
+ pre-commit = plain.dev.precommit:cli
5
+
6
+ [plain.setup]
7
+ dev-dotenv = plain.dev.entrypoints:load_dotenv_file
plain/dev/config.py DELETED
@@ -1,20 +0,0 @@
1
- import importlib
2
- from pathlib import Path
3
-
4
- from plain.packages import PackageConfig
5
- from plain.runtime import settings
6
-
7
-
8
- class Config(PackageConfig):
9
- name = "plain.dev"
10
-
11
- def ready(self):
12
- # Symlink the plain package into .plain so we can look at it easily
13
- plain_path = Path(
14
- importlib.util.find_spec("plain.runtime").origin
15
- ).parent.parent
16
- if not settings.PLAIN_TEMP_PATH.exists():
17
- settings.PLAIN_TEMP_PATH.mkdir()
18
- src_path = settings.PLAIN_TEMP_PATH / "src"
19
- if plain_path.exists() and not src_path.exists():
20
- src_path.symlink_to(plain_path)
@@ -1,8 +0,0 @@
1
- [plain.cli]
2
- contrib=plain.dev.contribute:cli
3
- dev=plain.dev:cli
4
- pre-commit=plain.dev.precommit:cli
5
-
6
- [plain.setup]
7
- dev-dotenv=plain.dev.entrypoints:load_dotenv_file
8
-