Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Commit

Permalink
Bump Meta (#1726)
Browse files Browse the repository at this point in the history
* pull migration guides from terra

* rename variable names to make them more explicit

* Bump Meta

Bump the meta repo version to include:

qiskit-terra==0.24.0

* Fix formatting

---------

Co-authored-by: Junye Huang <[email protected]>
  • Loading branch information
mtreinish and HuangJunye authored May 4, 2023
1 parent dd2696d commit a6a6eb8
Show file tree
Hide file tree
Showing 5 changed files with 1,647 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# The short X.Y version
version = ""
# The full version, including alpha/beta/rc tags
release = "0.42.1"
release = "0.43.0"

rst_prolog = """
.. |version| replace:: {0}
Expand Down
19 changes: 15 additions & 4 deletions docs/custom_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ def _install_from_master():
subprocess.run(cmd)


def _git_copy(package, sha1, api_docs_dir):
def _git_copy(package, sha1, meta_package_docs_dir, sub_package_docs_folder):
try:
with tempfile.TemporaryDirectory() as temp_dir:
github_source = "https://github.com/Qiskit/%s" % package
subprocess.run(["git", "clone", github_source, temp_dir], capture_output=True)
subprocess.run(["git", "checkout", sha1], cwd=temp_dir, capture_output=True)
dir_util.copy_tree(os.path.join(temp_dir, "docs", "apidocs"), api_docs_dir)
dir_util.copy_tree(
os.path.join(temp_dir, "docs", sub_package_docs_folder), meta_package_docs_dir
)

except FileNotFoundError:
warnings.warn(
Expand All @@ -63,22 +65,31 @@ def _git_copy(package, sha1, api_docs_dir):
def load_api_sources(app):
"""Git clones and sets up Qiskit repos so that we can generate their API docs."""
api_docs_dir = os.path.join(app.srcdir, "apidoc")
migration_guides_dir = os.path.join(app.srcdir, "migration_guides")
if os.getenv("DOCS_FROM_MASTER"):
global apidocs_master
apidocs_master = tempfile.mkdtemp()
shutil.move(api_docs_dir, apidocs_master)
_install_from_master()
for package in qiskit_elements:
_git_copy(package, "HEAD", api_docs_dir)
_git_copy(package, "HEAD", api_docs_dir, "apidocs")
# pull migration guides from qiskit-terra
_git_copy("qiskit-terra", "HEAD", migration_guides_dir, "migration_guides")
return
elif os.path.isdir(api_docs_dir):
global apidocs_exists
apidocs_exists = True
warnings.warn("docs/apidocs already exists skipping source clone")
return

meta_versions = _get_current_versions(app)
for package in qiskit_elements:
_git_copy(package, meta_versions[package], api_docs_dir)
_git_copy(package, meta_versions[package], api_docs_dir, "apidocs")

# pull migration guides from qiskit-terra
_git_copy(
"qiskit-terra", meta_versions["qiskit-terra"], migration_guides_dir, "migration_guides"
)


def load_tutorials(app):
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ Interested in quantum hardware design?
intro_tutorial1
tutorials
API Reference <apidoc/terra>
Migration Guides <migration_guides/index>
release_notes
configuration
GitHub <https://github.com/Qiskit/qiskit-terra>
Expand Down
Loading

0 comments on commit a6a6eb8

Please sign in to comment.