diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 08e5c4130..4d98b2e3e 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -42,45 +42,20 @@ jobs: pip install jupyter qiskit[visualization] sudo apt-get install -y pandoc graphviz shell: bash - - name: Build and publish + - name: Build docs env: - encrypted_rclone_key: ${{ secrets.encrypted_rclone_key }} - encrypted_rclone_iv: ${{ secrets.encrypted_rclone_iv }} QISKIT_PARALLEL: False QISKIT_DOCS_BUILD_TUTORIALS: 'always' run: | echo "earliest_version: 0.1.0" >> releasenotes/config.yaml tools/ignore_untagged_notes.sh make html - tools/deploy_documentation.sh shell: bash - deploy-translatable-strings: - if: ${{ startsWith(github.ref, 'refs/heads/stable') && contains('["t-imamichi","mtreinish","stefan-woerner","woodsp-ibm","dthuerck","Sofranac-Boro"]', github.actor) }} - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.8] - steps: - - uses: actions/checkout@v3 + - name: Bypass Jekyll Processing # Necessary for setting the correct css path + run: touch docs/_build/html/.nojekyll + - name: Deploy + uses: JamesIves/github-pages-deploy-action@v4 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 jupyter qiskit[visualization] torchvision tox - sudo apt-get install -y pandoc graphviz - shell: bash - - name: Build and publish - env: - encrypted_deploy_po_branch_key: ${{ secrets.encrypted_deploy_po_branch_key }} - encrypted_deploy_po_branch_iv: ${{ secrets.encrypted_deploy_po_branch_iv }} - QISKIT_PARALLEL: False - QISKIT_DOCS_BUILD_TUTORIALS: 'always' - run: | - echo "earliest_version: 0.1.0" >> releasenotes/config.yaml - tools/ignore_untagged_notes.sh - tools/deploy_translatable_strings.sh - shell: bash + folder: docs/_build/html/ + clean-exclude: | + locale/* diff --git a/docs/conf.py b/docs/conf.py index aaf982c86..afc014cde 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,6 @@ # This code is part of a Qiskit project. # -# (C) Copyright IBM 2021, 2023. +# (C) Copyright IBM 2021, 2024. # # 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 @@ -41,7 +41,7 @@ copyright = f"2018, {date.today().year}, Qiskit Optimization Development Team" # pylint: disable=redefined-builtin author = "Qiskit Optimization Development Team" -docs_url_prefix = "ecosystem/optimization" +docs_url_prefix = "qiskit-optimization" # The short X.Y version version = qiskit_optimization.__version__ @@ -148,8 +148,6 @@ ("es_UN", "Spanish"), ] language = "en" -locale_dirs = ["locale/"] -gettext_compact = False # optional. # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. diff --git a/tools/deploy_documentation.sh b/tools/deploy_documentation.sh deleted file mode 100755 index c6defd783..000000000 --- a/tools/deploy_documentation.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# This code is part of a Qiskit project. -# -# (C) Copyright IBM 2018, 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) - -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 --exclude locale/** ./docs/_build/html IBMCOS:qiskit-org-web-resources/ecosystem/optimization diff --git a/tools/deploy_translatable_strings.sh b/tools/deploy_translatable_strings.sh deleted file mode 100755 index 7941f33d3..000000000 --- a/tools/deploy_translatable_strings.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash - -# This code is part of a Qiskit project. -# -# (C) Copyright IBM 2018, 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 translatable strings to qiskit-translations repo. - -# Non-travis variables used by this script. -SOURCE_REPOSITORY="git@github.com:Qiskit/qiskit-optimization.git" -SOURCE_DIR=`pwd` -SOURCE_LANG='en' - -TARGET_REPOSITORY="git@github.com:qiskit-community/qiskit-translations.git" -TARGET_BRANCH_PO="main" - -DOC_DIR_PO="docs/locale/" - -echo "show current dir: " -pwd - -pushd docs - -# Extract document's translatable messages into pot files -# https://sphinx-intl.readthedocs.io/en/master/quickstart.html -echo "Extract document's translatable messages into pot files and generate po files" -tox -egettext -- -D language=$SOURCE_LANG - -echo "Setup ssh keys" -pwd -set -e -# Add qiskit-translations push key to ssh-agent -openssl enc -aes-256-cbc -d -in ../tools/github_poBranch_update_key.enc -out github_poBranch_deploy_key -K $encrypted_deploy_po_branch_key -iv $encrypted_deploy_po_branch_iv -chmod 600 github_poBranch_deploy_key -eval $(ssh-agent -s) -ssh-add github_poBranch_deploy_key - -# Clone to the working repository for .po and pot files -popd -pwd -echo "git clone for working repo" -git clone --depth 1 $TARGET_REPOSITORY temp --single-branch --branch $TARGET_BRANCH_PO -pushd temp - -git config user.name "Qiskit (Optimization) Autodeploy" -git config user.email "qiskit@qiskit.org" - -echo "git rm -rf for the translation po files" -git rm -rf --ignore-unmatch optimization/$DOC_DIR_PO/$SOURCE_LANG/LC_MESSAGES/*.po \ - optimization/$DOC_DIR_PO/$SOURCE_LANG/LC_MESSAGES/api \ - optimization/$DOC_DIR_PO/$SOURCE_LANG/LC_MESSAGES/apidocs \ - optimization/$DOC_DIR_PO/$SOURCE_LANG/LC_MESSAGES/stubs \ - optimization/$DOC_DIR_PO/$SOURCE_LANG/LC_MESSAGES/release_notes.po \ - optimization/$DOC_DIR_PO/$SOURCE_LANG/LC_MESSAGES/theme \ - optimization/$DOC_DIR_PO/$SOURCE_LANG/LC_MESSAGES/_* - -# Remove api/ and apidoc/ to avoid confusion while translating -rm -rf $SOURCE_DIR/$DOC_DIR_PO/$SOURCE_LANG/LC_MESSAGES/api/ \ - $SOURCE_DIR/$DOC_DIR_PO/$SOURCE_LANG/LC_MESSAGES/apidocs \ - $SOURCE_DIR/$DOC_DIR_PO/$SOURCE_LANG/LC_MESSAGES/stubs \ - $SOURCE_DIR/$DOC_DIR_PO/$SOURCE_LANG/LC_MESSAGES/release_notes.po \ - $SOURCE_DIR/$DOC_DIR_PO/$SOURCE_LANG/LC_MESSAGES/theme/ - -# Copy the new rendered files and add them to the commit. -echo "copy directory" -cp -r $SOURCE_DIR/$DOC_DIR_PO/ optimization/docs -cp $SOURCE_DIR/setup.py optimization/. -cp $SOURCE_DIR/requirements-dev.txt optimization/. -cp $SOURCE_DIR/requirements.txt optimization/. -cp $SOURCE_DIR/README.md optimization/. -cp $SOURCE_DIR/qiskit_optimization/VERSION.txt optimization/qiskit_optimization/. - -# git checkout translationDocs -echo "add to po files to target dir" -git add optimization/ - -# Commit and push the changes. -git commit -m "[Qiskit Optimization] Automated documentation update to add .po files" -m "skip ci" -m "Commit: $GITHUB_SHA" -m "Github Actions Run: https://github.com/Qiskit/qiskit/runs/$GITHUB_RUN_NUMBER" -echo "git push" -git push --quiet origin $TARGET_BRANCH_PO -echo "********** End of pushing po to working repo! *************" -popd diff --git a/tools/github_poBranch_update_key.enc b/tools/github_poBranch_update_key.enc deleted file mode 100644 index cbffab9d4..000000000 Binary files a/tools/github_poBranch_update_key.enc and /dev/null differ diff --git a/tools/rclone.conf.enc b/tools/rclone.conf.enc deleted file mode 100644 index 985bd728a..000000000 Binary files a/tools/rclone.conf.enc and /dev/null differ diff --git a/tox.ini b/tox.ini index 7b9af1469..ca4cbc508 100644 --- a/tox.ini +++ b/tox.ini @@ -57,17 +57,6 @@ deps = commands = sphinx-build -j auto -W -T --keep-going -b html {posargs} docs/ docs/_build/html -[testenv:gettext] -envdir = .tox/docs -deps = - -r{toxinidir}/requirements.txt - -r{toxinidir}/requirements-dev.txt - sphinx-intl - jupyter -commands = - sphinx-build -W -T --keep-going -b gettext docs/ docs/_build/gettext {posargs} - sphinx-intl -c docs/conf.py update -p docs/_build/gettext -l en -d docs/locale - [pycodestyle] max-line-length = 105 # + E203 because of a difference of opinion with black