Skip to content

🔧 Remove constraints from extra_options #1123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion sphinx_needs/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ class NeedsInfoType(TypedDict):
# TODO these all default to "" which I don't think is good
duration: str
completion: str
# constraints: str # this is already set in create_need
# options from `BaseService.options` get added to every need,
# via `ServiceManager.register`, which adds them to `extra_options``
# GithubService
Expand Down
2 changes: 2 additions & 0 deletions sphinx_needs/directives/need.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def run(self) -> Sequence[nodes.Node]:
post_template = self.options.get("post_template")
duration = self.options.get("duration")
completion = self.options.get("completion")
constraints = self.options.get("constraints", [])

need_extra_options = {"duration": duration, "completion": completion}
for extra_link in self.needs_config.extra_links:
Expand Down Expand Up @@ -160,6 +161,7 @@ def run(self) -> Sequence[nodes.Node]:
layout=layout,
delete=delete_opt,
jinja_content=jinja_content,
constraints=constraints,
**need_extra_options,
)
add_doc(env, self.docname)
Expand Down
1 change: 1 addition & 0 deletions sphinx_needs/directives/needimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def run(self) -> Sequence[nodes.Node]:
"style",
"layout",
"need_type",
"constraints",
*[x["option"] for x in extra_links],
*NEEDS_CONFIG.extra_options,
)
Expand Down
2 changes: 1 addition & 1 deletion sphinx_needs/external_needs.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def load_external_needs(app: Sphinx, env: BuildEnvironment, _docname: str) -> No
need_params["links"] = need.get("links", [])
need_params["tags"] = ",".join(need.get("tags", []))
need_params["status"] = need.get("status")
need_params["constraints"] = ",".join(need.get("constraints", []))
need_params["constraints"] = need.get("constraints", [])

del need_params["description"]

Expand Down
1 change: 0 additions & 1 deletion sphinx_needs/needs.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,6 @@ def prepare_env(app: Sphinx, env: BuildEnvironment, _docname: str) -> None:
for option in [
"duration",
"completion",
"constraints",
]:
# Check if not already set by user
if option not in NEEDS_CONFIG.extra_options:
Expand Down