Skip to content

Commit 59509a2

Browse files
authored
[template] makes sure the template is adjusted to labels.toml (#992)
1 parent 6f61f29 commit 59509a2

File tree

5 files changed

+255
-163
lines changed

5 files changed

+255
-163
lines changed

.github/ISSUE_TEMPLATE/01_submission.yml

Lines changed: 177 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -1,170 +1,184 @@
1-
name: "🆕 Submit a project to the Qiskit Ecosystem"
1+
name: 🆕 Submit a project to the Qiskit Ecosystem
22
description: Request that a project be included in the Qiskit Ecosystem
3-
title: "[Submission]: <project name> "
4-
labels: ["submission"]
3+
title: '[Submission]: <project name> '
4+
labels: [submission]
55
type: Task
66
body:
7-
- type: markdown
8-
attributes:
9-
value: |
10-
### Criteria
7+
- type: markdown
8+
attributes:
9+
value: |
10+
### Criteria
1111
12-
To join the Qiskit Ecosystem, the project must:
13-
* Build on, interface with, or extend the [Qiskit SDK](https://github.com/Qiskit/qiskit) in some way.
14-
* Be compatible with Qiskit 1.0 (or newer).
15-
* Have an [OSI-approved](https://opensource.org/licenses) open-source license (preferably Apache 2.0 or MIT).
16-
* Adhere to [Qiskit's Code of Conduct](https://qisk.it/coc) (you can enforce your own code of conduct in addition to this one).
17-
* Have shown maintainer activity within the last 6 months, such as a commit.
12+
To join the Qiskit Ecosystem, the project must:
13+
* Build on, interface with, or extend the [Qiskit SDK](https://github.com/Qiskit/qiskit) in some way.
14+
* Be compatible with Qiskit 1.0 (or newer).
15+
* Have an [OSI-approved](https://opensource.org/licenses) open-source license (preferably Apache 2.0 or MIT).
16+
* Adhere to [Qiskit's Code of Conduct](https://qisk.it/coc) (you can enforce your own code of conduct in addition to this one).
17+
* Have shown maintainer activity within the last 6 months, such as a commit.
1818
19-
If you have any questions, please reach out through the `#qiskit-ecosystem` channel on [Slack](https://qisk.it/join-slack).
20-
- type: input
21-
id: name
22-
attributes:
23-
label: Project name
24-
description: >
25-
Title of your project as it will appear on
26-
[qisk.it/ecosystem](https://qisk.it/ecosystem).
27-
placeholder: Qiskit Banana Compiler
28-
validations:
29-
required: true
30-
- type: textarea
31-
id: description
32-
attributes:
33-
label: Description
34-
description: >
35-
1-2 sentences to appear under your project on
36-
[https://qisk.it/ecosystem](https://qisk.it/ecosystem).
37-
Keep it under 135 characters. If empty, it will be taken from somewhere else.
38-
placeholder: >
39-
Compile bananas into Qiskit quantum circuits.
40-
Supports all modern devices, including Musa × paradisiaca.
41-
render: text
42-
validations:
43-
required: true
44-
- type: input
45-
id: contact_info
46-
attributes:
47-
label: Contact email
48-
description: Author's contact email address.
49-
placeholder: [email protected]
50-
validations:
51-
required: false
52-
- type: dropdown
53-
id: category
54-
attributes:
55-
label: Category
56-
description: >
57-
What kind of software is this? See examples by filtering by type in
58-
[qisk.it/ecosystem](https://qisk.it/ecosystem). If "other," please explain later in a comment.
59-
multiple: false
60-
options:
61-
- applications
62-
- compute provider
63-
- circuit simulator
64-
- circuit manipulation
65-
- converter
66-
- transpiler plugin
67-
- unitary synthesis plugin
68-
- high-level synthesis plugin
69-
- qiskit addon
70-
- game
71-
- other
72-
validations:
73-
required: true
74-
- type: dropdown
75-
id: labels
76-
attributes:
77-
description: >
78-
Labels are how users discover your project on
79-
[qisk.it/ecosystem](https://qisk.it/ecosystem). If
80-
you don't think any existing labels apply to your project, leave a
81-
comment after submitting your issue requesting a new label.
19+
If you have any questions, please reach out through the `#qiskit-ecosystem` channel on [Slack](https://qisk.it/join-slack).
20+
- type: input
21+
id: name
22+
attributes:
23+
label: Project name
24+
description: >
25+
Title of your project as it will appear on
26+
[qisk.it/ecosystem](https://qisk.it/ecosystem).
27+
placeholder: Qiskit Banana Compiler
28+
validations:
29+
required: true
30+
- type: textarea
31+
id: description
32+
attributes:
33+
label: Description
34+
description: >
35+
1-2 sentences to appear under your project on
36+
[https://qisk.it/ecosystem](https://qisk.it/ecosystem).
37+
Keep it under 135 characters. If empty, it will be taken from somewhere else.
38+
placeholder: >
39+
Compile bananas into Qiskit quantum circuits.
40+
Supports all modern devices, including Musa × paradisiaca.
41+
render: text
42+
validations:
43+
required: true
44+
- type: input
45+
id: contact_info
46+
attributes:
47+
label: Contact email
48+
description: Author's contact email address.
49+
placeholder: [email protected]
50+
validations:
51+
required: false
52+
- type: dropdown
53+
id: category
54+
attributes:
55+
label: Category
56+
description: >
57+
What kind of software is this? See examples by filtering by type in
58+
[qisk.it/ecosystem](https://qisk.it/ecosystem). If "other," please explain later
59+
in a comment.
60+
multiple: false
61+
options:
62+
- SDK
63+
- Application
64+
- Tooling
65+
- Compute provider
66+
- Circuit simulator
67+
- Converter
68+
- Transpiler plugin
69+
- Unitary synthesis plugin
70+
- High-level synthesis plugin
71+
- Qiskit addon
72+
- Game
73+
- Paper artifact
74+
- Other
75+
validations:
76+
required: true
77+
- type: dropdown
78+
id: labels
79+
attributes:
80+
description: >
81+
Labels are how users discover your project on
82+
[qisk.it/ecosystem](https://qisk.it/ecosystem). If
83+
you don't think any existing labels apply to your project, leave a
84+
comment after submitting your issue requesting a new label.
8285
83-
**Mark up to 5**
84-
label: Labels
85-
multiple: true
86-
options:
87-
- algorithms
88-
- chemistry
89-
- error correction
90-
- error mitigation
91-
- finance
92-
- QML
93-
- optimization
94-
- physics
95-
- quantum information
96-
- circuit optimization
97-
- paper
98-
- type: dropdown
99-
id: pattern_steps
100-
attributes:
101-
description: >
102-
Can this software help a user to work in one or more steps of
103-
the [Qiskit Pattern](https://quantum.cloud.ibm.com/docs/en/guides/intro-to-patterns)?
104-
label: Qiskit Pattern steps
105-
multiple: true
106-
options:
107-
- Map the problem
108-
- Optimize for hardware
109-
- Execute on hardware
110-
- Post-process results
111-
- type: markdown
112-
attributes:
113-
value: "---"
114-
- type: markdown
115-
attributes:
116-
value: "### URLs"
117-
- type: input
118-
id: source_url
119-
attributes:
120-
label: GitHub repository
121-
description: Link to the GitHub repository where the source code lives. It can include branches or subfolders.
122-
placeholder: https://github.com/somebody/banana-compiler
123-
validations:
86+
**Mark up to 5**
87+
label: Labels
88+
multiple: true
89+
options:
90+
- chemistry
91+
- C
92+
- C++
93+
- Julia
94+
- Rust
95+
- OCaml
96+
- error correction
97+
- error mitigation
98+
- finance
99+
- QML
100+
- optimization
101+
- physics
102+
- provider
103+
- cloud service
104+
- HPC
105+
- quantum information
106+
- research
107+
- demo
108+
- circuit manipulation
109+
- circuit building
110+
- openqasm
111+
- type: dropdown
112+
id: pattern_steps
113+
attributes:
114+
description: >
115+
Can this software help a user to work in one or more steps of the [Qiskit Pattern](https://quantum.cloud.ibm.com/docs/en/guides/intro-to-patterns)?
116+
label: Qiskit Pattern steps
117+
multiple: true
118+
options:
119+
- Map the problem
120+
- Optimize for hardware
121+
- Execute on hardware
122+
- Post-process results
123+
- type: markdown
124+
attributes:
125+
value: '---'
126+
- type: markdown
127+
attributes:
128+
value: '### URLs'
129+
- type: input
130+
id: source_url
131+
attributes:
132+
label: GitHub repository
133+
description: Link to the GitHub repository where the source code lives. It
134+
can include branches or subfolders.
135+
placeholder: https://github.com/somebody/banana-compiler
136+
validations:
137+
required: true
138+
- type: input
139+
id: home_url
140+
attributes:
141+
label: Home page
142+
description: Link to the project's main site, if any.
143+
placeholder: https://banana-compiler.org
144+
validations:
145+
required: false
146+
- type: input
147+
id: docs_url
148+
attributes:
149+
label: Documentation
150+
description: Link to the project's documentation website, if any.
151+
placeholder: https://banana-compiler.org/documentation
152+
validations:
153+
required: false
154+
- type: textarea
155+
id: package_urls
156+
attributes:
157+
label: Packages
158+
description: >
159+
List the links for all the packages that are built from the project, one per
160+
line. Leave it empty you there is no deploy for this project.
161+
placeholder: |
162+
https://pypi.org/project/banana-compiler
163+
https://pypi.org/project/banana-compiler-hpc
164+
https://crates.io/crates/rusty-banana-compiler
165+
https://marketplace.visualstudio.com/items?itemName=banana-code-assistance
166+
render: text
167+
- type: input
168+
id: paper_url
169+
attributes:
170+
label: Reference paper
171+
description: If the project is based on a paper, you can link it here.
172+
placeholder: https://arxiv.org/abs/5555.22222
173+
validations:
174+
required: false
175+
- type: markdown
176+
attributes:
177+
value: '---'
178+
- type: checkboxes
179+
id: terms
180+
attributes:
181+
label: Code of Conduct
182+
options:
183+
- label: I agree to follow the [Qiskit Code of Conduct](https://qisk.it/coc)
124184
required: true
125-
- type: input
126-
id: home_url
127-
attributes:
128-
label: Home page
129-
description: Link to the project's main site, if any.
130-
placeholder: https://banana-compiler.org
131-
validations:
132-
required: false
133-
- type: input
134-
id: docs_url
135-
attributes:
136-
label: Documentation
137-
description: Link to the project's documentation website, if any.
138-
placeholder: https://banana-compiler.org/documentation
139-
validations:
140-
required: false
141-
- type: textarea
142-
id: package_urls
143-
attributes:
144-
label: Packages
145-
description: >
146-
List the links for all the packages that are built from the project, one per line. Leave it empty you there is no deploy for this project.
147-
placeholder: |
148-
https://pypi.org/project/banana-compiler
149-
https://pypi.org/project/banana-compiler-hpc
150-
https://crates.io/crates/rusty-banana-compiler
151-
https://marketplace.visualstudio.com/items?itemName=banana-code-assistance
152-
render: text
153-
- type: input
154-
id: paper_url
155-
attributes:
156-
label: Reference paper
157-
description: If the project is based on a paper, you can link it here.
158-
placeholder: https://arxiv.org/abs/5555.22222
159-
validations:
160-
required: false
161-
- type: markdown
162-
attributes:
163-
value: "---"
164-
- type: checkboxes
165-
id: terms
166-
attributes:
167-
label: Code of Conduct
168-
options:
169-
- label: I agree to follow the [Qiskit Code of Conduct](https://qisk.it/coc)
170-
required: true

ecosystem/cli/ci.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
"""CliCI class for controlling all CLI functions."""
22

33
from pathlib import Path
4+
from ruamel.yaml import YAML
45

56
from ecosystem.dao import DAO
67
from ecosystem.submission_parser import parse_submission_issue
78
from ecosystem.error_handling import set_actions_output
9+
from ecosystem.labels import LabelsToml
810

911

1012
class CliCI:
@@ -34,3 +36,31 @@ def add_member_from_issue(body: str, *, resources_dir: str | None = None) -> Non
3436
parsed_result = parse_submission_issue(body)
3537
DAO(path=resources_dir).write(parsed_result)
3638
set_actions_output([("SUBMISSION_NAME", parsed_result.name)])
39+
40+
@staticmethod
41+
def update_issue_template(
42+
template_path: str, *, resources_dir: str | None = None
43+
) -> None:
44+
"""Parse an issue created from the issue template and add the member to the database
45+
46+
Args:
47+
template_path: Path to the issue template to update
48+
resources_dir: Path to the resources directory
49+
"""
50+
51+
labels_toml = LabelsToml(resources_dir=resources_dir)
52+
53+
yaml = YAML()
54+
with open(template_path, "r") as yaml_file:
55+
data = yaml.load(yaml_file)
56+
57+
for section in data["body"]:
58+
if "id" not in section:
59+
continue
60+
if section["id"] == "labels":
61+
section["attributes"]["options"] = labels_toml.label_names
62+
elif section["id"] == "category":
63+
section["attributes"]["options"] = labels_toml.category_names
64+
65+
with open(template_path, "w") as yaml_file:
66+
yaml.dump(data, yaml_file)

0 commit comments

Comments
 (0)