Skip to content

Commit

Permalink
Fix tox -e docs for macOS (Qiskit#9765)
Browse files Browse the repository at this point in the history
* Fix `tox -e docs` for macOS

Co-authored-by: Jake Lishman <[email protected]>

* 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 <[email protected]>
  • Loading branch information
Eric-Arellano and jakelishman authored Mar 9, 2023
1 parent d272919 commit 3284ea0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .azure/docs-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:

variables:
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
RUST_DEBUG: 1

steps:
- checkout: self
Expand All @@ -29,8 +30,6 @@ jobs:
- bash: |
tox -edocs
displayName: 'Run Docs build'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- task: ArchiveFiles@2
inputs:
Expand Down
12 changes: 9 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -100,7 +99,14 @@
"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={
Expand Down
14 changes: 3 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3284ea0

Please sign in to comment.