pyprojkit 0.4.0__tar.gz → 0.4.2__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.
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/PKG-INFO +2 -2
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/pyproject.toml +2 -2
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/src/pyprojkit/sync.py +18 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/LICENSE +0 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/README.md +0 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/src/pyprojkit/__init__.py +0 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/src/pyprojkit/_paths.py +0 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/src/pyprojkit/_run.py +0 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/src/pyprojkit/cli.py +0 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/src/pyprojkit/config/__init__.py +0 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/src/pyprojkit/config/base.py +0 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/src/pyprojkit/config/profiles.py +0 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/src/pyprojkit/config/project.py +0 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/src/pyprojkit/config/tools.py +0 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/src/pyprojkit/discovery.py +0 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/src/pyprojkit/sessions.py +0 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/src/pyprojkit/skill.py +0 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/src/pyprojkit/tasks.py +0 -0
- {pyprojkit-0.4.0 → pyprojkit-0.4.2}/src/pyprojkit/versions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyprojkit
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Development workflow toolkit for Python projects: pyproject.toml sync, doit tasks, nox sessions
|
|
5
5
|
Author: mm21
|
|
6
6
|
Author-email: mm21 <mm21.dev@gmail.com>
|
|
@@ -27,7 +27,7 @@ Requires-Dist: pyright>=1.1.329,<2 ; extra == 'analysis'
|
|
|
27
27
|
Requires-Dist: mkinit ; extra == 'doc'
|
|
28
28
|
Requires-Dist: autoflake>=2.3.1,<3 ; extra == 'format'
|
|
29
29
|
Requires-Dist: black>=25.1.0,<26 ; extra == 'format'
|
|
30
|
-
Requires-Dist: docfmt>=0.
|
|
30
|
+
Requires-Dist: docfmt>=0.3.0,<0.4.0 ; extra == 'format'
|
|
31
31
|
Requires-Dist: isort>=6.0.1,<7 ; extra == 'format'
|
|
32
32
|
Requires-Dist: genbadge[tests,coverage]>=1.1.0,<2 ; extra == 'test'
|
|
33
33
|
Requires-Dist: pytest>=8.4.2,<9 ; extra == 'test'
|
|
@@ -29,7 +29,7 @@ license-files = ["LICENSE"]
|
|
|
29
29
|
name = "pyprojkit"
|
|
30
30
|
readme = "README.md"
|
|
31
31
|
requires-python = ">=3.12,<4.0" # pyprojkit-managed
|
|
32
|
-
version = "0.4.
|
|
32
|
+
version = "0.4.2"
|
|
33
33
|
|
|
34
34
|
[project.optional-dependencies]
|
|
35
35
|
all = [
|
|
@@ -45,7 +45,7 @@ doc = [
|
|
|
45
45
|
format = [
|
|
46
46
|
"autoflake>=2.3.1,<3",
|
|
47
47
|
"black>=25.1.0,<26",
|
|
48
|
-
"docfmt>=0.
|
|
48
|
+
"docfmt>=0.3.0,<0.4.0",
|
|
49
49
|
"isort>=6.0.1,<7"
|
|
50
50
|
]
|
|
51
51
|
test = [
|
|
@@ -19,6 +19,10 @@ Managed content:
|
|
|
19
19
|
`<skills_dir>/pyprojkit-python/SKILL.md`, overwritten on every sync and removed when
|
|
20
20
|
dropped from the configuration
|
|
21
21
|
|
|
22
|
+
On every non-check sync, the lock file is refreshed via the configured workflow tool
|
|
23
|
+
(`uv lock` or `poetry lock`), so manual edits to `pyproject.toml` are picked up too.
|
|
24
|
+
Skipped when no workflow tool is configured.
|
|
25
|
+
|
|
22
26
|
Everything else (dependencies, build-system, urls, unmanaged fields and tables, etc.) is
|
|
23
27
|
preserved. Output is normalized with toml-sort (as a library, using the same settings as
|
|
24
28
|
the managed `[tool.tomlsort]` table), so a subsequent `toml-sort` run in the format task
|
|
@@ -30,6 +34,7 @@ bookkeeping table and "managed by pyprojkit" comments) are migrated in one sync.
|
|
|
30
34
|
|
|
31
35
|
from __future__ import annotations
|
|
32
36
|
|
|
37
|
+
import contextlib
|
|
33
38
|
import difflib
|
|
34
39
|
import re
|
|
35
40
|
from pathlib import Path
|
|
@@ -39,6 +44,7 @@ import tomlkit
|
|
|
39
44
|
from tomlkit import TOMLDocument
|
|
40
45
|
from tomlkit.items import AoT, Null, Table
|
|
41
46
|
|
|
47
|
+
from ._run import run
|
|
42
48
|
from .config.base import ConfigError
|
|
43
49
|
from .config.project import ProjectConfig, SkillConfig
|
|
44
50
|
from .config.tools import TomlSortConfig
|
|
@@ -165,9 +171,21 @@ def sync(
|
|
|
165
171
|
skill_path.parent.mkdir(parents=True, exist_ok=True)
|
|
166
172
|
skill_path.write_text(desired)
|
|
167
173
|
|
|
174
|
+
if not check:
|
|
175
|
+
_lock(config, root_path)
|
|
176
|
+
|
|
168
177
|
return in_sync if check else True
|
|
169
178
|
|
|
170
179
|
|
|
180
|
+
def _lock(config: ProjectConfig, root: Path):
|
|
181
|
+
"""
|
|
182
|
+
Refresh the lock file using the configured workflow tool, if any.
|
|
183
|
+
"""
|
|
184
|
+
if tool := config.tools.workflow_tool:
|
|
185
|
+
with contextlib.chdir(root):
|
|
186
|
+
run([tool, "lock"])
|
|
187
|
+
|
|
188
|
+
|
|
171
189
|
def _print_diff(name: str, old: str, new: str):
|
|
172
190
|
diff = difflib.unified_diff(
|
|
173
191
|
old.splitlines(keepends=True),
|
|
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
|