Skip to content

Commit

Permalink
Rename moved members + adapt packages setup for requirements project (#…
Browse files Browse the repository at this point in the history
…512)

<!--
⚠️ If you do not respect this template, your pull request will be
closed.
⚠️ Your pull request title should be short detailed and understandable
for all.
⚠️ Also, please add a release note file using reno if the change needs
to be
  documented in the release notes.
⚠️ If your pull request fixes an open issue, please link to the issue.

- [ ] I have added the tests to cover my changes.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the CONTRIBUTING document.
-->

### Summary
Some members changed their name or moved their repo.
I'm correcting then with the good new name.


### Details and comments
- [x] Change url of `qiskit-superstaq`
- [x] Change url of `pytket-qiskit`
- [x] Adapt packages installation for projects with no
`requirements.txt`
- [x] Update tests

---
Closes #502 
Closes #202

---------

Co-authored-by: Frank Harkins <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: frankharkins <[email protected]>
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
5 people authored Aug 30, 2023
1 parent 8abc161 commit 1f33f16
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ecosystem/models/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class PythonRepositoryConfiguration(RepositoryConfiguration):
_lint_template: Template | None = None
_cov_template: Template | None = None
_setup_template: Template | None = None
_requirements_template: Template | None = None

def __post_init__(self):
env = Environment(
Expand All @@ -158,6 +159,7 @@ def __post_init__(self):
self._lint_template = env.get_template(".pylintrc")
self._cov_template = env.get_template(".coveragerc")
self._setup_template = env.get_template("setup.py")
self._requirements_template = env.get_template("requirements.txt")

@classmethod
def default(cls) -> "PythonRepositoryConfiguration":
Expand Down Expand Up @@ -205,3 +207,7 @@ def render_cov_file(self):
def render_setup_file(self):
"""Renders default setup.py file."""
return self._setup_template.render()

def render_requirements_file(self):
"""Renders default requirements.txt file."""
return self._requirements_template.render()
2 changes: 1 addition & 1 deletion ecosystem/resources/members/pytket-qiskit.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "pytket-qiskit"
url = "https://github.com/CQCL/pytket-extensions/tree/develop/modules/pytket-qiskit"
url = "https://github.com/CQCL/pytket-qiskit"
description = "an extension to Pytket (a python module for interfacing with CQC tket) that allows Pytket circuits to be run on IBM backends and simulators, as well as conversion to and from Qiskit representations."
licence = "Apache 2.0"
labels = [ "Converter",]
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/resources/members/qiskit-superstaq.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "qiskit-superstaq"
url = "https://github.com/SupertechLabs/qiskit-superstaq"
url = "https://github.com/Infleqtion/client-superstaq/tree/main/qiskit-superstaq"
description = "This package is used to access SuperstaQ via a Web API through Qiskit. Qiskit programmers can take advantage of the applications, pulse level optimizations, and write-once-target-all features of SuperstaQ with this package."
licence = "Apache 2.0"
contact_info = ""
Expand Down
9 changes: 9 additions & 0 deletions ecosystem/runners/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ def configure_repo(
with open(f"{self.cloned_repo_directory}/setup.py", "w") as setup_file:
setup_file.write(repo_config.render_setup_file())

# check for requirements.txt file
if not os.path.exists(f"{self.cloned_repo_directory}/requirements.txt"):
self.logger.warning("No requirements files for repository %s", self.repo)
self.logger.warning("Creating default requirements.txt file.")
with open(
f"{self.cloned_repo_directory}/requirements.txt", "w"
) as requirements_file:
requirements_file.write(repo_config.render_requirements_file())

# check for tox/.pylintrc/.coveragerc file
for destination_file_name, renamed_file_name in zip(files, files_fault):
if os.path.exists(f"{self.cloned_repo_directory}/{destination_file_name}"):
Expand Down
1 change: 1 addition & 0 deletions ecosystem/templates/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Empty file for tpl
1 change: 0 additions & 1 deletion tests/resources/simple_python_repository/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion tests/resources/simple_python_repository/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
description="demo-impl",
long_description="",
packages=setuptools.find_packages(),
install_requires=install_requires,
install_requires=["pytest==6.2.4"],
python_requires=">=3.6",
)

0 comments on commit 1f33f16

Please sign in to comment.