Skip to content
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

fix : #510, Removed package_to_check variable and updated references #511

Merged
merged 8 commits into from
Aug 31, 2023
12 changes: 6 additions & 6 deletions ecosystem/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def _run_python_tests(
repo_url: str,
tier: str,
python_version: str,
package_to_check: str,
qiskit: str,
test_type: str,
ecosystem_deps: Optional[List[str]] = None,
ecosystem_additional_commands: Optional[List[str]] = None,
Expand All @@ -339,7 +339,7 @@ def _run_python_tests(
repo_url: repository url
tier: tier of project
python_version: ex: py36, py37 etc
package_to_check: qiskit or qiskit-terra
qiskit: qiskit
test_type: [dev, stable]
ecosystem_deps: extra dependencies to install for tests
ecosystem_additional_commands: extra commands to run before tests
Expand All @@ -364,7 +364,7 @@ def _run_python_tests(
ecosystem_deps=ecosystem_deps,
ecosystem_additional_commands=ecosystem_additional_commands,
python_version=python_version,
package_to_check=package_to_check,
qiskit=qiskit,
repo_config=repo_configuration,
)
qiskit_version, results = runner.run()
Expand Down Expand Up @@ -547,7 +547,7 @@ def python_dev_tests(
repo_url=repo_url,
tier=tier,
python_version=python_version,
package_to_check=package,
qiskit=package,
test_type=TestType.DEV_COMPATIBLE,
ecosystem_deps=[],
ecosystem_additional_commands=additional_commands,
Expand Down Expand Up @@ -583,7 +583,7 @@ def python_stable_tests(
repo_url=repo_url,
tier=tier,
python_version=python_version,
package_to_check="qiskit",
qiskit="qiskit",
test_type=TestType.STABLE_COMPATIBLE,
ecosystem_deps=qiskit_latest_deps,
ecosystem_additional_commands=additional_commands,
Expand Down Expand Up @@ -614,7 +614,7 @@ def python_standard_tests(
repo_url=repo_url,
tier=tier,
python_version=python_version,
package_to_check="qiskit",
qiskit="qiskit",
test_type=TestType.STANDARD,
logs_link=logs_link,
)
Expand Down
4 changes: 2 additions & 2 deletions ecosystem/models/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def default(cls) -> "PythonRepositoryConfiguration":
def render_tox_file(
self,
ecosystem_deps: list[str] = None,
package_to_check: str = "qiskit",
qiskit: str = "qiskit",
ecosystem_additional_commands: list[str] = None,
):
"""Renders tox template from configuration."""
Expand All @@ -188,7 +188,7 @@ def render_tox_file(
**self.to_dict(),
**{
"ecosystem_deps": ecosystem_deps,
"package_to_check": package_to_check,
"qiskit": qiskit,
"ecosystem_additional_commands": ecosystem_additional_commands,
},
}
Expand Down
6 changes: 3 additions & 3 deletions ecosystem/runners/python_tests_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ def __init__(
ecosystem_deps: Optional[List[str]] = None,
ecosystem_additional_commands: Optional[List[str]] = None,
python_version: str = "py39",
package_to_check: str = "qiskit",
qiskit: str = "qiskit",
repo_config: Optional[RepositoryConfiguration] = None,
):
super().__init__(
repo=repo, working_directory=working_directory, repo_config=repo_config
)
self.python_version = python_version
self.package_to_check = package_to_check
self.qiskit = qiskit
self.ecosystem_deps = (
ecosystem_deps if ecosystem_deps is not None else ["qiskit"]
)
Expand All @@ -53,7 +53,7 @@ def workload(self) -> Tuple[str, List[CommandExecutionSummary]]:
["tox_default.ini"],
ecosystem_deps=self.ecosystem_deps,
ecosystem_additional_commands=self.ecosystem_additional_commands,
package_to_check=self.package_to_check,
qiskit=self.qiskit,
)

qiskit_version = UnknownPackageVersion
Expand Down
6 changes: 3 additions & 3 deletions ecosystem/runners/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def configure_repo(
files_fault: List[str],
ecosystem_deps: Optional[List[str]] = None,
ecosystem_additional_commands: Optional[List[str]] = None,
package_to_check: str = "qiskit",
qiskit: str = "qiskit",
):
"""Configuring the different templates:
- tox.ini
Expand All @@ -68,7 +68,7 @@ def configure_repo(
files_fault: list of default name replacement
ecosystem_deps: list of dependencies
ecosystem_additional_commands: additional commands to run before tests
package_to_check: package to check the version of qiskit
qiskit: package to check the version of qiskit

No return
"""
Expand Down Expand Up @@ -118,7 +118,7 @@ def configure_repo(
repo_config.render_tox_file(
ecosystem_deps=ecosystem_deps,
ecosystem_additional_commands=ecosystem_additional_commands,
package_to_check=package_to_check,
qiskit=qiskit,
)
)
elif destination_file_name == FilesTemplates.LINT_FILE_NAME:
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/templates/configured_tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ commands =
{% for additional_command in ecosystem_additional_commands -%}
{{ additional_command|indent(2, True) }}
{% endfor %}
python -c 'import qiskit; f = open("./qiskit_version.txt", "w"); f.write(qiskit.__qiskit_version__["{{package_to_check}}"]); f.close();'
python -c 'import qiskit; f = open("./qiskit_version.txt", "w"); f.write(qiskit.__qiskit_version__["qiskit"]); f.close();'
{% for command in tests_command -%}
{{ command|indent(2, True) }}
{% endfor -%}
Expand Down