Fix `tox -e docs` for macOS (#9765)

* Fix `tox -e docs` for macOS

Co-authored-by: Jake Lishman <jake@binhbar.com>

* Fix two issues. Duh, thanks Jake

* Update Azure job to set RUST_DEBUG

Not strictly necessary since Tox already sets it. But makes things consistent and avoids accidentally
removing this in the future

---------

Co-authored-by: Jake Lishman <jake@binhbar.com>
This commit is contained in:
Eric Arellano 2023-03-09 17:56:54 -06:00 committed by GitHub
parent d272919172
commit 3284ea088b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 16 deletions

View File

@ -9,6 +9,7 @@ jobs:
variables:
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
RUST_DEBUG: 1
steps:
- checkout: self
@ -29,8 +30,6 @@ jobs:
- bash: |
tox -edocs
displayName: 'Run Docs build'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- task: ArchiveFiles@2
inputs:

View File

@ -14,8 +14,7 @@
import os
import re
import sys
from setuptools import setup, find_packages, Extension
from setuptools import setup, find_packages
from setuptools_rust import Binding, RustExtension
@ -100,7 +99,14 @@ setup(
"Source Code": "https://github.com/Qiskit/qiskit-terra",
},
rust_extensions=[
RustExtension("qiskit._accelerate", "crates/accelerate/Cargo.toml", binding=Binding.PyO3)
RustExtension(
"qiskit._accelerate",
"crates/accelerate/Cargo.toml",
binding=Binding.PyO3,
# If RUST_DEBUG is set, force compiling in debug mode. Else, use the default behavior
# of whether it's an editable installation.
debug=True if os.getenv("RUST_DEBUG") == "1" else None,
)
],
zip_safe=False,
entry_points={

14
tox.ini
View File

@ -67,24 +67,16 @@ commands =
coverage3 report
[testenv:docs]
# Editable mode breaks macOS: https://github.com/sphinx-doc/sphinx/issues/10943
usedevelop = False
basepython = python3
setenv =
{[testenv]setenv}
QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y
RUST_DEBUG=1 # Faster to compile.
deps =
setuptools_rust # This is work around for the bug of tox 3 (see #8606 for more details.)
-r{toxinidir}/requirements-dev.txt
qiskit-aer
commands =
sphinx-build -W -j auto -T --keep-going -b html docs/ docs/_build/html {posargs}
[pycodestyle]
max-line-length = 105
# default ignores + E741 because of opflow global variable I
# + E203 because of a difference of opinion with black
# codebase does currently comply with: E133, E242, E704, W505
ignore = E121, E123, E126, E133, E226, E241, E242, E704, W503, W504, W505, E741, E203
[flake8]
max-line-length = 105
extend-ignore = E203, E741