2023-12-06 00:05:44 +08:00
|
|
|
[tox]
|
|
|
|
min_version = 4.0
|
Restore Serverless 0.15.2 and test notebooks when changing requirements (#1831)
Closes https://github.com/Qiskit/documentation/issues/1826.
## Switches to Python 3.11
Qiskit Serverless requires Python 3.11+ now, even though Qiskit SDK
still supports 3.9 and 3.10. While I'm talking to the Serverless team,
it seems very unlikely they are going to change their mind on this due
to their own constraints.
Unfortunately, this means that we need to always use Python 3.11 with
our repository so that we can install serverless for the files that use
it. Our other alternative is to stop testing the files with Serverless,
but that seems even worse.
The risk with using 3.11 in CI rather than 3.9 is that we may use syntax
not in Python 3.9 and 3.10. However, given the actual history of our
docs, this seems unlikely: we don't use new Python syntax like type
hints. If we do use Python 3.11-syntax, it's not the end of the world.
## Tests all notebooks on changes to requirements.txt
This was an oversight that we would not test the notebooks when changing
requirements.txt. So, we merged a change that worked locally but broke
CI. Now, we test all notebooks when the nb-tester program and config
changes.
## Also upgrades Runtime
This is necessary to make Serverless happy. According to
https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/release-notes#0270-2024-08-08,
there are no breaking changes. CI also shows everything passes.
2024-08-15 05:57:57 +08:00
|
|
|
env_list = py311
|
2023-12-06 00:05:44 +08:00
|
|
|
skipsdist = true
|
|
|
|
|
|
|
|
[testenv]
|
2024-04-24 23:14:49 +08:00
|
|
|
deps =
|
|
|
|
-e scripts/nb-tester
|
|
|
|
-r scripts/nb-tester/requirements.txt
|
2023-12-06 00:05:44 +08:00
|
|
|
setenv = PYDEVD_DISABLE_FILE_VALIDATION=1
|
2024-07-24 00:58:30 +08:00
|
|
|
commands = test-docs-notebooks {posargs} --config-path scripts/config/notebook-testing.toml
|
2024-02-16 22:50:08 +08:00
|
|
|
|
2024-04-24 23:14:49 +08:00
|
|
|
[testenv:{lint,fix}]
|
|
|
|
deps = squeaky==0.7.0
|
|
|
|
commands =
|
2024-07-16 04:17:34 +08:00
|
|
|
lint: squeaky --check --no-advice {posargs:docs}
|
|
|
|
fix: squeaky {posargs:docs}
|
2024-05-18 04:24:08 +08:00
|
|
|
|
|
|
|
[testenv:nb-tester]
|
|
|
|
deps =
|
|
|
|
-e scripts/nb-tester
|
|
|
|
pytest
|
|
|
|
commands = pytest scripts/nb-tester
|