Skip to content

Commit

Permalink
Release version 0.0.0.dev345
Browse files Browse the repository at this point in the history
  • Loading branch information
AAriam committed Nov 1, 2024
1 parent 0763624 commit e182914
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 128 deletions.
20 changes: 10 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespaces = true
# ----------------------------------------- Project Metadata -------------------------------------
#
[project]
version = "0.0.0.dev344"
version = "0.0.0.dev345"
name = "ControlMan"
dependencies = [
"packaging >= 23.2, < 24",
Expand All @@ -27,18 +27,18 @@ dependencies = [
"jsonpath-ng == 1.6.1",
"ruamel.yaml == 0.17.40",
"Jinja2 >= 3, < 4",
"PyLinks == 0.0.0.dev42",
"LoggerMan == 0.0.0.dev58",
"PySerials == 0.0.0.dev32",
"GitTidy == 0.0.0.dev55",
"PyLinks == 0.0.0.dev43",
"LoggerMan == 0.0.0.dev59",
"PySerials == 0.0.0.dev33",
"GitTidy == 0.0.0.dev56",
"PkgData == 0.0.0.dev5",
"PyShellMan == 0.0.0.dev19",
"PyShellMan == 0.0.0.dev20",
"PySyntax == 0.0.0.dev4",
"ExceptionMan == 0.0.0.dev29",
"MDit == 0.0.0.dev29",
"JSONSchemata == 0.0.0.dev28",
"ExceptionMan == 0.0.0.dev30",
"MDit == 0.0.0.dev30",
"JSONSchemata == 0.0.0.dev29",
"VersionMan == 0.0.0.dev248",
"HTMP == 0.0.0.dev5",
"LicenseMan == 0.0.0.dev15",
"LicenseMan == 0.0.0.dev16",
]
requires-python = ">=3.10"
18 changes: 9 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ referencing == 0.35.1
jsonpath-ng == 1.6.1
ruamel.yaml == 0.17.40
Jinja2 >= 3, < 4
PyLinks == 0.0.0.dev42
LoggerMan == 0.0.0.dev58
PySerials == 0.0.0.dev32
GitTidy == 0.0.0.dev55
PyLinks == 0.0.0.dev43
LoggerMan == 0.0.0.dev59
PySerials == 0.0.0.dev33
GitTidy == 0.0.0.dev56
PkgData == 0.0.0.dev5
PyShellMan == 0.0.0.dev19
PyShellMan == 0.0.0.dev20
PySyntax == 0.0.0.dev4
ExceptionMan == 0.0.0.dev29
MDit == 0.0.0.dev29
JSONSchemata == 0.0.0.dev28
ExceptionMan == 0.0.0.dev30
MDit == 0.0.0.dev30
JSONSchemata == 0.0.0.dev29
VersionMan == 0.0.0.dev248
HTMP == 0.0.0.dev5
LicenseMan == 0.0.0.dev15
LicenseMan == 0.0.0.dev16
35 changes: 15 additions & 20 deletions src/controlman/_data/schema/def/entity-def.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,17 @@ properties:
$ref: https://jsonschemata.repodynamics.com/string/oneline
default: |
#{{
legal = $[[ .legal ]]$
legal = get(".legal")
if legal:
return legal[0]
first = $[[ .first ]]$[0]
last = $[[ .last ]]$[0]
particle = $[[ .particle ]]$
suffix = $[[ .suffix ]]$
full = first
return legal
full = get(".first")
particle = get(".particle")
if particle:
full += f" {particle[0]}"
full += f" {last}"
full += f" {particle}"
full += f" {get(".last")}"
suffix = get(".suffix")
if suffix:
full += f", {suffix[0]}"
full += f", {suffix}"
return full
}}#
full_inverted:
Expand All @@ -156,18 +153,16 @@ properties:
$ref: https://jsonschemata.repodynamics.com/string/oneline
default: |
#{{
legal = $[[ .legal ]]$
legal = get(".legal")
if legal:
return legal[0]
return legal
first = $[[ .first ]]$[0]
last = $[[ .last ]]$[0]
particle = $[[ .particle ]]$
suffix = $[[ .suffix ]]$
full = f"{particle[0]} " if particle else ""
full += f"{last}, {first}"
particle = get(".particle")
full = f"{particle} " if particle else ""
full += f"{get(".last")}, {get(".first")}"
suffix = get(".suffix")
if suffix:
full += f", {suffix[0]}"
full += f", {suffix}"
return full
}}#
role:
Expand Down
23 changes: 6 additions & 17 deletions src/controlman/_data/schema/def/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ properties:
#{{
import re
project_name = "${{ name }}$"
project_name = get("name")
project_name_normalized = re.sub(r"[^a-zA-Z0-9._-]", "-", project_name)
return re.sub(r"^[^a-zA-Z0-9]+|[^a-zA-Z0-9]+$", "", project_name_normalized)
}}#
Expand Down Expand Up @@ -145,7 +145,7 @@ properties:
#{{
import re
pkg_name = "${{ .name }}$"
pkg_name = get(".name")
import_name_raw = re.sub(r"[^a-zA-Z0-9]", "_", pkg_name.lower())
return re.sub(r"^[0-9]+", "", import_name_raw)
}}#
Expand Down Expand Up @@ -261,9 +261,7 @@ properties:
return [
member["id"] for member in team_members_with_role_types(
"Author",
${{ team }}$,
${{ role }}$,
active_only=True
active_only=True,
)
]
}}#
Expand Down Expand Up @@ -292,9 +290,7 @@ properties:
return [
member["id"] for member in team_members_with_role_types(
["ContactPerson", "ProjectManager", "DataManager", "ProjectLeader", "Supervisor"],
${{ team }}$,
${{ role }}$,
active_only=True
active_only=True,
)
]
}}#
Expand Down Expand Up @@ -388,11 +384,7 @@ properties:
os_independent:
type: boolean
default: |
#{{
os_data = ${{ .os }}$
pure_python = ${{ .python.pure }}$
return pure_python and len(os_data) == 3
}}#
#{{ return get(".python.pure") and len(get(".os")) == 3 }}#
python:
title: Python configurations for the package.
description: |
Expand Down Expand Up @@ -475,10 +467,7 @@ properties:
pure:
type: boolean
default: |
#{{
os_data = ${{ ..os }}$
return not any("ci_build" in os for os in os_data.values())
}}#
#{{ return not any("ci_build" in os for os in get("..os").values()) }}#
implementation:
type: string
enum:
Expand Down
76 changes: 23 additions & 53 deletions src/controlman/_data/schema/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ properties:
title: Name
description: |
Name of the project.
If not provided (recommended), it is automatically derived from the repository name
by replacing all hyphens with spaces.
:::{admonition} Usage
:class: dropdown note
Expand All @@ -64,13 +62,11 @@ properties:
that is as similar as possible to the distribution and import name of the package**.
This helps to avoid confusion and makes it easier for others to find, install, and use your package.
:::
description_default: Repository name (hyphens replaced with spaces)
required_stage: post-load
description_default: |
If not provided (recommended), the default value is the following template,
which generates the name from the repository name by replacing all hyphens with spaces.
default: |
#{{
repo_name = "${{ repo.name }}$"
return repo_name.replace("-", " ")
}}#
#{{ return get("repo.name").replace("-", " ") }}#
examples:
- ${{ repo.name }}$
- MyProject
Expand Down Expand Up @@ -312,12 +308,10 @@ properties:
#{{
from datetime import datetime
repo_creation_date = "${{ repo.created_at }}$"
owner = """${{ team.owner.name.full }}$"""
start_year = datetime.strptime(repo_creation_date, "%Y-%m-%d").year
start_year = datetime.strptime(get("repo.created_at"), "%Y-%m-%d").year
current_year = datetime.today().year
period = f"{start_year}–{current_year}" if start_year < current_year else f"{current_year}"
return f"© {period} {owner}"
period = f"{start_year}–{current_year}" if start_year < current_year else current_year
return f"© {period} {get("team.owner.name.full")}"
}}#
description_default: |
Set to `© {period} {owner}`, where `{owner}` is the repository owner's name
Expand Down Expand Up @@ -556,10 +550,8 @@ properties:
#{{
return [
member["id"] for member in team_members_with_role_types(
"Author",
${{ team }}$,
${{ role }}$,
active_only=True
"Author",
active_only=True,
)
]
}}#
Expand All @@ -577,9 +569,7 @@ properties:
return [
member["id"] for member in team_members_with_role_types(
"ContactPerson",
${{ team }}$,
${{ role }}$,
active_only=True
active_only=True,
)
]
}}#
Expand All @@ -606,8 +596,6 @@ properties:
return [
member["id"] for member in team_members_without_role_types(
"Author",
${{ team }}$,
${{ role }}$,
include_other_roles=True,
active_only=True,
)
Expand Down Expand Up @@ -676,8 +664,7 @@ properties:
#{{
import licenseman
license_expression = "${{ license.expression }}$"
spdx_license_ids, _ = licenseman.spdx.expression.license_ids(license_expression)
spdx_license_ids, _ = licenseman.spdx.expression.license_ids(get("license.expression"))
return spdx_license_ids
}}#
type: array
Expand Down Expand Up @@ -1586,8 +1573,8 @@ properties:
import pylinks as pl
import pyserials as ps
path = root_path / (ccc["web.path.source"] or "${{ web.path.source }}$")
url_home = "${{ web.url.home }}$"
path = root_path / (ccc["web.path.source"] or get("web.path.source"))
url_home = get("web.url.home")
pages = {}
blog = {}
Expand Down Expand Up @@ -1720,14 +1707,13 @@ properties:
$ref: https://jsonschemata.repodynamics.com/url/http-explicit
default: |
#{{
custom_domain_matches = $[[ web.url.custom ]]$
if custom_domain_matches:
custom_domain = custom_domain_matches[0]
custom_domain = get("web.url.custom")
if custom_domain:
protocol = "https" if custom_domain["enforce_https"] else "http"
domain = custom_domain["name"]
return f"{protocol}://{domain}"
repo_name = "${{ repo.name }}$"
owner_github_username = "${{ team.owner.github.id }}$"
repo_name = get("repo.name")
owner_github_username = get("team.owner.github.id")
if repo_name == f"{owner_github_username}.github.io":
return f"https://{owner_github_username}.github.io"
return f"https://{owner_github_username}.github.io/{repo_name}"
Expand Down Expand Up @@ -3082,12 +3068,7 @@ properties:
project findability and visibility.
type: string
default: |
#{{
project_title_matches = $[[ title ]]$
if not project_title_matches:
return ""
return project_title_matches[0]
}}#
#{{ return get("title", "") }}#
description_default: Project [title](#ccc-title).
examples:
- ${{ title }}$
Expand All @@ -3108,13 +3089,9 @@ properties:
#{{
import pylinks
project_keywords_matches = $[[ keywords ]]$
if not project_keywords_matches:
return []
project_keywords = project_keywords_matches[0]
return [
pylinks.string.to_slug(keyword)
for keyword in project_keywords if len(keyword) <= 50
for keyword in get("keywords", []) if len(keyword) <= 50
][:20]
}}#
items:
Expand Down Expand Up @@ -3356,13 +3333,10 @@ properties:
type: object
default: |
#{{
issue_forms_matches = $[[ issue.forms ]]$
if not issue_forms_matches:
return { }
issue_forms = issue_forms_matches[0]
issues_home_url = get("repo.url.issues.home")
return {
form["id"]: f"${{ repo.url.issues.home }}$/new?template={idx + 1:02}_{form["id"]}.yaml"
for idx, form in enumerate(issue_forms)
form["id"]: f"{issues_home_url}/new?template={idx + 1:02}_{form["id"]}.yaml"
for idx, form in enumerate(get("issue.forms", []))
}
}}#
additionalProperties:
Expand Down Expand Up @@ -3401,13 +3375,9 @@ properties:
type: object
default: |
#{{
discussion_categories_matches = $[[ discussion.category ]]$
if not discussion_categories_matches:
return { }
discussion_categories = discussion_categories_matches[0]
return {
slug: f"${{ repo.url.discussions.home }}$/new?category={slug}"
for slug in discussion_categories.keys()
for slug in get("discussion.category", {}).keys()
}
}}#
additionalProperties:
Expand Down
4 changes: 3 additions & 1 deletion src/controlman/center_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,12 @@ def load(self) -> _ps.NestedDict:
"hook": self._hook_manager.inline_hooks,
"root_path": self._path_root,
"ccc": self._data_before,
"fill_entity": _functools.partial(_helper.fill_entity, github_api=self._github_api, cache_manager=self._cache_manager),
},
code_context_partial={
"team_members_with_role_types": _helper.team_members_with_role_types,
"team_members_without_role_types": _helper.team_members_without_role_types,
"team_members_with_role_ids": _helper.team_members_with_role_ids,
"fill_entity": _functools.partial(_helper.fill_entity, github_api=self._github_api, cache_manager=self._cache_manager),
},
relative_template_keys=const.RELATIVE_TEMPLATE_KEYS
)
Expand Down
Loading

0 comments on commit e182914

Please sign in to comment.