Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
15099f3
Change rtd theme to qiskit_sphinx_theme
Guillermo-Mijares-Vilarino Apr 5, 2023
299736a
Add tutorials and GitHub to sidebar and use nbsphinx
Guillermo-Mijares-Vilarino Apr 5, 2023
ea7ad26
Create deploy_documentation.sh
Guillermo-Mijares-Vilarino Apr 10, 2023
0b33d53
Add docs deployment workflow
Guillermo-Mijares-Vilarino Apr 10, 2023
02ef4b4
add pandoc to docs CI
Guillermo-Mijares-Vilarino Apr 11, 2023
75e2fd0
add toxinidir to gettext paths
Guillermo-Mijares-Vilarino Apr 11, 2023
be791bc
Fix copyright dates
Guillermo-Mijares-Vilarino Apr 12, 2023
0305773
Added deprecation warning from metapackage
Guillermo-Mijares-Vilarino Apr 12, 2023
75b69c6
Revert changes
Guillermo-Mijares-Vilarino Apr 12, 2023
97f5483
Add pandoc to docs push test
Guillermo-Mijares-Vilarino Apr 13, 2023
cfd1437
Fix deploy-docs.yml
Guillermo-Mijares-Vilarino Apr 13, 2023
c21f4c1
Fix workflow file
Guillermo-Mijares-Vilarino Apr 13, 2023
243fc06
fix workflow file
Guillermo-Mijares-Vilarino Apr 13, 2023
005a456
move docs build to deploy_documentation.sh
Guillermo-Mijares-Vilarino Apr 13, 2023
044fd4c
rclone.conf.enc
1ucian0 Apr 13, 2023
27becf3
Add Documentation Home to toctree
Guillermo-Mijares-Vilarino Apr 14, 2023
c64bbac
Remove deployment to qiskit.org/documentation
Guillermo-Mijares-Vilarino Apr 14, 2023
125ffb8
remove comments from tutorial index
Guillermo-Mijares-Vilarino Apr 18, 2023
e7910b6
Fix copyright date
Guillermo-Mijares-Vilarino Apr 18, 2023
b8ffe79
Removed earliest_version from docs deployment workflow
Guillermo-Mijares-Vilarino Apr 18, 2023
204f02c
Apply suggestions from code review
Guillermo-Mijares-Vilarino May 5, 2023
3aace7c
add sphinxcontrib.jquery to extensions
Guillermo-Mijares-Vilarino May 5, 2023
3c19b14
remove extra os import
Guillermo-Mijares-Vilarino May 10, 2023
abeb9d7
Group datetime import with the rest
Guillermo-Mijares-Vilarino May 10, 2023
9fc47e6
Add .doctrees directory for cached files
Guillermo-Mijares-Vilarino May 10, 2023
2827f40
Merge branch 'master' into create-doc-page
mtreinish May 11, 2023
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
52 changes: 52 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

name: Deploy Docs

on:
push:
tags:
- "*"
workflow_dispatch:

concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
docs_publish:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -U virtualenv setuptools wheel tox
sudo apt-get install -y graphviz pandoc
shell: bash
- name: Build and publish
env:
encrypted_rclone_key: ${{ secrets.encrypted_rclone_key }}
encrypted_rclone_iv: ${{ secrets.encrypted_rclone_iv }}
QISKIT_PARALLEL: False
QISKIT_DOCS_BUILD_TUTORIALS: 'always'
run: |
tools/deploy_documentation.sh
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -U 'tox<4'
sudo apt install -y graphviz
sudo apt install -y graphviz pandoc
pip install -c constraints.txt -e .
- name: Build docs
run: tox -edocs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -U 'tox<4'
sudo apt install -y graphviz
sudo apt install -y graphviz pandoc
pip install -c constraints.txt -e .
- name: Build docs
run: tox -edocs
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@ Qconfig.py
.DS_Store

/docs/stubs/
/docs/.doctrees/
41 changes: 32 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,23 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import os
Comment thread
Guillermo-Mijares-Vilarino marked this conversation as resolved.
import sys
import datetime
sys.path.insert(0, os.path.abspath('.'))

"""
Sphinx documentation builder
"""

import os
# Set env flag so that we can doc functions that may otherwise not be loaded
# see for example interactive visualizations in qiskit.visualization.
os.environ['QISKIT_DOCS'] = 'TRUE'

# -- Project information -----------------------------------------------------

project = 'Qiskit IBM Q Provider'
copyright = '2019, Qiskit Development Team' # pylint: disable=redefined-builtin
copyright = f'2019-{datetime.date.today().year}, Qiskit Development Team' # pylint: disable=redefined-builtin
author = 'Qiskit Development Team'

# The short X.Y version
Expand Down Expand Up @@ -68,13 +69,36 @@
'jupyter_sphinx',
'sphinx_autodoc_typehints',
'reno.sphinxext',
"sphinxcontrib.jquery", # Remove when changing html_theme to qiskit_ecosystem.
'nbsphinx'
Comment thread
Guillermo-Mijares-Vilarino marked this conversation as resolved.
]
html_static_path = ['_static']
templates_path = ['_templates']
html_css_files = [
'style.css',
]

nbsphinx_timeout = 300
nbsphinx_execute = os.getenv('QISKIT_DOCS_BUILD_TUTORIALS', 'never')
nbsphinx_widgets_path = ''

nbsphinx_prolog = """
{% set docname = env.doc2path(env.docname, base=None) %}
.. only:: html

.. role:: raw-html(raw)
:format: html

.. note::
This page was generated from `docs/{{ docname }}`__.

__"""


vers = release.split(".")
link_str = f" https://github.com/Qiskit/qiskit-ibmq-provider/blob/stable/{vers[0]}.{vers[1]}/docs/"
nbsphinx_prolog += link_str + "{{ docname }}"

# -----------------------------------------------------------------------------
# Autosummary
# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -111,7 +135,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
exclude_patterns = ["_build", "**.ipynb_checkpoints"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'colorful'
Expand All @@ -136,7 +160,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme' # use the theme in subdir 'theme'
html_theme = 'qiskit_sphinx_theme'

html_logo = 'images/logo.png'
#html_sidebars = {'**': ['globaltoc.html']}
Expand All @@ -147,12 +171,11 @@
'display_version': True,
'prev_next_buttons_location': 'bottom',
'style_external_links': True,
'style_nav_header_background': '#212121',
}

rst_prolog = """.. warning::
The package ``qiskit-ibmq-provider`` is being deprecated and its repo is going to be archived soon.
Please transition to the new packages. More information in https://ibm.biz/provider_migration_guide
"""

autoclass_content = 'both'
autoclass_content = 'both'
5 changes: 4 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ Qiskit IBM Quantum Provider documentation
#########################################

.. toctree::
:maxdepth: 2
:maxdepth: 1

Documentation Home <self>
Tutorials <tutorials/index>
API References <apidocs/ibmq-provider>
Release Notes <release_notes>
GitHub <https://github.com/Qiskit/qiskit-ibmq-provider>

.. Hiding - Indices and tables
:ref:`genindex`
Expand Down
9 changes: 9 additions & 0 deletions docs/tutorials/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#############################
Qiskit IBM Provider Tutorials
#############################


.. nbgallery::

1_the_ibmq_account
2_jupyter_tools
3 changes: 3 additions & 0 deletions releasenotes/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
encoding: utf8
default_branch: master
3 changes: 2 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pylint==2.4.4
vcrpy
pproxy==2.1.8
Sphinx>=1.8.3
sphinx-rtd-theme>=0.4.0
qiskit_sphinx_theme~=1.11.1
sphinx-tabs>=1.1.11
sphinx-automodapi
sphinx-autodoc-typehints
Expand All @@ -20,6 +20,7 @@ pyperclip>=1.7
jupyter-sphinx
reno>=2.11.0
scipy>=1.0
nbsphinx
nbformat>=4.4.0
nbconvert>=5.3.1
qiskit_rng
Expand Down
32 changes: 32 additions & 0 deletions tools/deploy_documentation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# This code is part of Qiskit.
#
# (C) Copyright IBM 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

# Script for pushing the documentation to qiskit.org/ecosystem.
set -e

curl https://downloads.rclone.org/rclone-current-linux-amd64.deb -o rclone.deb
sudo apt-get install -y ./rclone.deb

RCLONE_CONFIG_PATH=$(rclone config file | tail -1)

# Build the documentation.
tox -edocs

echo "show current dir: "
pwd

# Push to qiskit.org/ecosystem
openssl aes-256-cbc -K $encrypted_rclone_key -iv $encrypted_rclone_iv -in tools/rclone.conf.enc -out $RCLONE_CONFIG_PATH -d
echo "Pushing built docs to qiskit.org/ecosystem"
rclone sync --progress ./docs/_build/html IBMCOS:qiskit-org-web-resources/ecosystem/ibmq-provider
Binary file added tools/rclone.conf.enc
Binary file not shown.
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ deps =
qiskit-aer
commands =
pip install -c{toxinidir}/constraints.txt -U -r requirements-dev.txt
sphinx-build -W -b html {posargs} {toxinidir}/docs {toxinidir}/docs/_build/html
sphinx-build -W -b html {posargs} {toxinidir}/docs {toxinidir}/docs/_build/html -d {toxinidir}/docs/.doctrees

[testenv:gettext]
envdir = .tox/docs
Expand All @@ -48,7 +48,7 @@ deps =
-r requirements-dev.txt
qiskit-aer
commands =
sphinx-build -W -b gettext docs/ docs/_build/gettext {posargs}
sphinx-build -W -b gettext {toxinidir}/docs/ {toxinidir}/docs/_build/gettext {posargs}

[doc8]
max-line-length=100
Expand Down