Skip to content

Commit f05d0ad

Browse files
committed
Release version 0.0.0.dev432
1 parent bf1231f commit f05d0ad

29 files changed

Lines changed: 1418 additions & 1874 deletions

pkg/pyproject.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespaces = true
1717
# ----------------------------------------- Project Metadata -------------------------------------
1818
#
1919
[project]
20-
version = "0.0.0.dev431"
20+
version = "0.0.0.dev432"
2121
name = "ControlMan"
2222
dependencies = [
2323
"packaging >= 23.2, < 24",
@@ -27,18 +27,18 @@ dependencies = [
2727
"jsonpath-ng == 1.6.1",
2828
"ruamel.yaml == 0.18.6",
2929
"Jinja2 >= 3, < 4",
30-
"PyLinks == 0.0.0.dev71",
31-
"LoggerMan == 0.0.0.dev88",
32-
"PySerials == 0.0.0.dev61",
33-
"GitTidy == 0.0.0.dev86",
30+
"PyLinks == 0.0.0.dev72",
31+
"LoggerMan == 0.0.0.dev89",
32+
"PySerials == 0.0.0.dev62",
33+
"GitTidy == 0.0.0.dev87",
3434
"PkgData == 0.0.0.dev5",
35-
"PyShellMan == 0.0.0.dev48",
35+
"PyShellMan == 0.0.0.dev49",
3636
"PySyntax == 0.0.0.dev6",
37-
"ExceptionMan == 0.0.0.dev58",
38-
"MDit == 0.0.0.dev58",
39-
"JSONSchemata == 0.0.0.dev57",
37+
"ExceptionMan == 0.0.0.dev59",
38+
"MDit == 0.0.0.dev59",
39+
"JSONSchemata == 0.0.0.dev58",
4040
"VersionMan == 0.0.0.dev250",
4141
"HTMP == 0.0.0.dev5",
42-
"LicenseMan == 0.0.0.dev45",
42+
"LicenseMan == 0.0.0.dev46",
4343
]
4444
requires-python = ">=3.10"

pkg/requirements.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ referencing == 0.35.1
55
jsonpath-ng == 1.6.1
66
ruamel.yaml == 0.18.6
77
Jinja2 >= 3, < 4
8-
PyLinks == 0.0.0.dev71
9-
LoggerMan == 0.0.0.dev88
10-
PySerials == 0.0.0.dev61
11-
GitTidy == 0.0.0.dev86
8+
PyLinks == 0.0.0.dev72
9+
LoggerMan == 0.0.0.dev89
10+
PySerials == 0.0.0.dev62
11+
GitTidy == 0.0.0.dev87
1212
PkgData == 0.0.0.dev5
13-
PyShellMan == 0.0.0.dev48
13+
PyShellMan == 0.0.0.dev49
1414
PySyntax == 0.0.0.dev6
15-
ExceptionMan == 0.0.0.dev58
16-
MDit == 0.0.0.dev58
17-
JSONSchemata == 0.0.0.dev57
15+
ExceptionMan == 0.0.0.dev59
16+
MDit == 0.0.0.dev59
17+
JSONSchemata == 0.0.0.dev58
1818
VersionMan == 0.0.0.dev250
1919
HTMP == 0.0.0.dev5
20-
LicenseMan == 0.0.0.dev45
20+
LicenseMan == 0.0.0.dev46

pkg/src/controlman/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def manager(
2828
github_token: str | None = None,
2929
future_versions: dict[str, str] | None = None,
3030
control_center_path: str | None = None,
31+
validate: bool = True,
3132
):
3233
if isinstance(repo, (str, _Path)):
3334
repo = _Git(path=repo)
@@ -38,7 +39,7 @@ def manager(
3839
raise ValueError(f"Invalid control center path '{cc_path}'")
3940
data_before = _ps.NestedDict()
4041
else:
41-
data_before = from_json_file(repo_path=repo.repo_path)
42+
data_before = from_json_file(repo_path=repo.repo_path, validate=validate)
4243
cc_path = repo.repo_path / data_before["control.path"]
4344
else:
4445
cc_path = repo.repo_path / data_before["control.path"]
@@ -56,6 +57,7 @@ def manager(
5657
def from_json_file(
5758
repo_path: str | _Path,
5859
filepath: str = const.FILEPATH_METADATA,
60+
validate: bool = True,
5961
) -> _ps.NestedDict:
6062
"""Load control center data from the full JSON file.
6163
@@ -65,6 +67,8 @@ def from_json_file(
6567
Path to the repository root.
6668
filepath : str, default: controlman.const.FILEPATH_METADATA
6769
Relative path to the JSON file in the repository.
70+
validate
71+
Validate the data against the schema.
6872
6973
Raises
7074
------
@@ -75,7 +79,8 @@ def from_json_file(
7579
data = _ps.read.json_from_file(path=_Path(repo_path) / filepath)
7680
except _ps.exception.read.PySerialsReadException as e:
7781
raise _exception.load.ControlManInvalidMetadataError(cause=e, filepath=filepath) from None
78-
_data_validator.validate(data=data, fill_defaults=False)
82+
if validate:
83+
_data_validator.validate(data=data, fill_defaults=False)
7984
return _ps.NestedDict(data)
8085

8186

pkg/src/controlman/_data/schema/def/cache-retention-hours.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ description: |
77
After the specified duration,
88
the cached data is considered stale
99
and will be automatically synced with the source.
10+
Set the retention hours to `.inf` to disable cache expiration.
1011
type: object
11-
additionalProperties: false
1212
default: { }
13-
required: [ extension, repo, user, orcid, doi, python ]
13+
required: [ extension, repo, user, orcid, doi, python, license ]
14+
additionalProperties:
15+
$ref: https://jsonschemata.repodynamics.com/number/non-negative
1416
properties:
1517
extension:
1618
description: |

pkg/src/controlman/_data/schema/def/dep_conda_env.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ properties:
6262
type: string
6363
default: |-
6464
#{{
65-
spec = [get("..channel")]
65+
spec = [get(".channel")]
6666
for part_name, part_prefix in (
6767
("subdir", "/"), ("name", "::"), ("version", " "), ("build", " ")
6868
):
69-
part = get(f"..{part_name}")
69+
part = get(f".{part_name}")
7070
if part:
7171
spec.append(f"{part_prefix}{part}")
7272
return "".join(spec)

pkg/src/controlman/_data/schema/def/dep_pip_env.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ properties:
6363
type: string
6464
default: |-
6565
#{{
66-
spec = [get("..name")]
67-
if extras := get("..extras"):
66+
spec = [get(".name")]
67+
if extras := get(".extras"):
6868
spec.append(f"[{','.join(extras)}]")
69-
if version := get("..version"):
69+
if version := get(".version"):
7070
spec.append(version)
71-
if marker := get("..marker"):
71+
if marker := get(".marker"):
7272
spec.append(f"; {marker}")
7373
return " ".join(spec)
7474
}}#

pkg/src/controlman/_data/schema/def/dependency.yaml

Lines changed: 30 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: |
77
to run, build, test, or develop the project.
88
Dependencies can be installed using package managers or custom scripts.
99
type: object
10-
required: [ name, import_name, install ]
10+
required: [ name, install ]
1111
properties:
1212
import_name:
1313
description: |
@@ -17,6 +17,7 @@ properties:
1717
name:
1818
description: Name of the module.
1919
$ref: https://jsonschemata.repodynamics.com/string/oneline
20+
default: ${{ .__key__ }}$
2021
description:
2122
description: A description for the module.
2223
type: string
@@ -48,11 +49,6 @@ properties:
4849
source:
4950
description: URL of the source code.
5051
$ref: https://jsonschemata.repodynamics.com/url/http-ftp-sftp
51-
file:
52-
summary: Dynamic files related to the module.
53-
type: object
54-
additionalProperties:
55-
$ref: https://controlman.repodynamics.com/schema/dynamic-file
5652
intersphinx_mapping:
5753
description: Intersphinx mapping definition of the module.
5854
type: object
@@ -99,7 +95,7 @@ properties:
9995
default: |
10096
#{{
10197
import re
102-
dep_name = get("..name")
98+
dep_name = get("...name")
10399
name_normalized = re.sub(r"[^a-zA-Z0-9._-]", "-", dep_name).lower()
104100
return re.sub(r"^[^a-zA-Z0-9]+|[^a-zA-Z0-9]+$", "", name_normalized)
105101
}}#
@@ -133,22 +129,18 @@ properties:
133129
spec:
134130
summary: Full match specification.
135131
readOnly: true
136-
type: object
137-
properties:
138-
environment:
139-
summary: Specification for an `environment.yml` file.
140-
type: string
141-
default: |-
142-
#{{
143-
spec = [get("..channel")]
144-
for part_name, part_prefix in (
145-
("subdir", "/"), ("name", "::"), ("version", " "), ("build", " ")
146-
):
147-
part = get(f"..{part_name}")
148-
if part:
149-
spec.append(f"{part_prefix}{part}")
150-
return "".join(spec)
151-
}}#
132+
type: string
133+
default: |-
134+
#{{
135+
spec = [get(".channel")]
136+
for part_name, part_prefix in (
137+
("subdir", "/"), ("name", "::"), ("version", " "), ("build", " ")
138+
):
139+
part = get(f".{part_name}")
140+
if part:
141+
spec.append(f"{part_prefix}{part}")
142+
return "".join(spec)
143+
}}#
152144
pip:
153145
title: pip
154146
summary: Specifications for the `pip` package manager.
@@ -169,7 +161,7 @@ properties:
169161
default: |
170162
#{{
171163
import re
172-
dep_name = get("..name")
164+
dep_name = get("...name")
173165
name_normalized = re.sub(r"[^a-zA-Z0-9._-]", "-", dep_name).lower()
174166
return re.sub(r"^[^a-zA-Z0-9]+|[^a-zA-Z0-9]+$", "", name_normalized)
175167
}}#
@@ -183,8 +175,6 @@ properties:
183175
[version Specifiers](https://packaging.python.org/en/latest/specifications/version-specifiers/#id5).
184176
examples:
185177
- ">=1.21.2"
186-
default: >-
187-
#{{ return get("..conda.version", "") }}#
188178
extras:
189179
summary: >-
190180
List of
@@ -205,21 +195,18 @@ properties:
205195
spec:
206196
summary: Full dependency specifier.
207197
readOnly: true
208-
type: object
209-
properties:
210-
pep508:
211-
type: string
212-
default: |-
213-
#{{
214-
spec = [get("..name")]
215-
if extras := get("..extras"):
216-
spec.append(f"[{','.join(extras)}]")
217-
if version := get("..version"):
218-
spec.append(version)
219-
if marker := get("..marker"):
220-
spec.append(f"; {marker}")
221-
return " ".join(spec)
222-
}}#
198+
type: string
199+
default: |-
200+
#{{
201+
spec = [get(".name")]
202+
if extras := get(".extras"):
203+
spec.append(f"[{','.join(extras)}]")
204+
if version := get(".version"):
205+
spec.append(version)
206+
if marker := get(".marker"):
207+
spec.append(f"; {marker}")
208+
return " ".join(spec)
209+
}}#
223210
apt:
224211
summary: Specifications for the `apt-get` package manager.
225212
type: object
@@ -232,7 +219,7 @@ properties:
232219
default: |
233220
#{{
234221
import re
235-
dep_name = get("..name")
222+
dep_name = get("...name")
236223
name_normalized = re.sub(r"[^a-zA-Z0-9._-]", "-", dep_name).lower()
237224
return re.sub(r"^[^a-zA-Z0-9]+|[^a-zA-Z0-9]+$", "", name_normalized)
238225
}}#
@@ -431,7 +418,7 @@ properties:
431418
summary: Custom PowerShell script to install the package.
432419
type: string
433420
selector:
434-
summary: Dependency selector.
421+
summary: Selector to apply to the dependency.
435422
$ref: https://jsonschemata.repodynamics.com/string/oneline
436423
validator:
437424
summary: Dependency installation validator.

pkg/src/controlman/_data/schema/def/devcontainer.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -323,17 +323,19 @@ properties:
323323
items:
324324
type: string
325325
postCreateCommand:
326-
type:
327-
- string
328-
- array
329-
- object
326+
type: object
330327
description: A command to run after creating the container. This command is
331328
run after "updateContentCommand" and before "postStartCommand". If this
332329
is a single string, it will be run in a shell. If this is an array of strings,
333330
it will be run as a single command without shell. If this is an object,
334331
each provided command will be run in parallel.
335-
items:
336-
type: string
332+
default: { }
333+
properties:
334+
source_tasks:
335+
summary: Source the tasks file in the user's bashrc.
336+
type: string
337+
default: >-
338+
echo 'source ${{ ..workspaceFolder }}$/${{ ...path }}$/${{ devcontainer.containers.rel_path.tasks }}$' >> ~/.bashrc
337339
additionalProperties:
338340
type:
339341
- string

pkg/src/controlman/_data/schema/def/dynamic-data.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ properties:
1515
description: |
1616
This is used to validate the configuration content.
1717
If the content does not match the schema, an error will be raised.
18-
type: object
18+
$ref: https://controlman.repodynamics.com/schema/jsonschema

0 commit comments

Comments
 (0)