Move config files to scripts/config (#1748)

This is meant to better split config files vs source code, to make it
more obvious what should be changed by everyday script users.

Not all of the scripts use `config/` yet, but could be refactored in the
future if we want.
This commit is contained in:
Eric Arellano 2024-07-23 12:58:30 -04:00 committed by GitHub
parent aba45e1fa4
commit 3f89260563
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 11 additions and 13 deletions

View File

@ -94,7 +94,7 @@ API docs authors can preview their changes to one of the APIs by using the `-a`
### Add a new notebook
When adding a new notebook, you'll need to tell the testing tools how to handle it.
To do this, add the file path to `scripts/nb-tester/notebooks.toml`. There are
To do this, add the file path to `scripts/config/notebook-testing.toml`. There are
four categories:
- `notebooks_normal_test`: Notebooks to be run normally in CI. These notebooks
@ -316,7 +316,7 @@ There are two ways to deal with cSpell incorrectly complaining about a word, suc
Ayyyyy, this is a fake description.
```
2. If the word is a name, add it to the `cspell/dictionaries/people.txt` file. If it is a scientific or quantum specific word, add it to the `cspell/dictionaries/qiskit.txt` file. If it doesn't fit in either category, add it to the `words` section in `cspell/cSpell.json`. The word is not case-sensitive.
2. If the word is a name, add it to the `scripts/config/cspell/dictionaries/people.txt` file. If it is a scientific or quantum specific word, add it to the `scripts/config/cspell/dictionaries/qiskit.txt` file. If it doesn't fit in either category, add it to the `words` section in `scripts/config/cspell/cSpell.json`. The word is not case-sensitive.
If the word appears in multiple files, prefer the second approach to add it to one of the dictionaries or `cSpell.json`.
@ -386,7 +386,7 @@ This is useful when new docs content is published, usually corresponding to new
7. Select `People with the link` and go to `Link Settings`.
8. Under `Link Expiration` select `Disable Shared Link on` and set an expiration date of ~10 years into the future.
9. Copy the direct link at the end of the `Shared Link Settings` tab.
10. Modify the `scripts/api-html-artifacts.json` file adding the new versions with the direct link from step 9.
10. Modify the `scripts/config/api-html-artifacts.json` file, adding the new versions with the direct link from step 9.
11. Run `npm run gen-api -- -p <pkg-name> -v <version>`,
e.g. `npm run gen-api -- -p qiskit -v 0.45.0`

View File

@ -10,7 +10,7 @@
"typecheck": "tsc",
"check": "npm run check:qiskit-bot && npm run check:patterns-index && npm run check:metadata && npm run check:spelling && npm run check:internal-links && npm run check:orphan-pages && npm run check:fmt",
"check:metadata": "node -r esbuild-register scripts/js/commands/checkMetadata.ts",
"check:spelling": "cspell --relative --no-progress docs/**/*.md* docs/api/**/*.md* --config cspell/cSpell.json",
"check:spelling": "cspell --no-progress docs/**/*.mdx docs/api/**/*.mdx --config scripts/config/cspell/cSpell.json",
"check:fmt": "prettier --check .",
"check:internal-links": "node -r esbuild-register scripts/js/commands/checkInternalLinks.ts",
"check:external-links": "node -r esbuild-register scripts/js/commands/checkExternalLinks.ts",

View File

@ -50,9 +50,9 @@
],
"ignorePaths": [
// We cannot easily control these API docs since they live in other repositories.
"../docs/api/qiskit/**/*.mdx",
"../docs/api/qiskit-ibm-runtime/**/*.mdx",
"../docs/api/qiskit-ibm-provider/**/*.mdx",
"../docs/api/qiskit-transpiler-service/**/*.mdx"
"../../../docs/api/qiskit/**/*.mdx",
"../../../docs/api/qiskit-ibm-runtime/**/*.mdx",
"../../../docs/api/qiskit-ibm-provider/**/*.mdx",
"../../../docs/api/qiskit-transpiler-service/**/*.mdx"
]
}

View File

@ -42,7 +42,7 @@ export async function downloadSphinxArtifact(pkg: Pkg, artifactFolder: string) {
}
const artifactJson = JSON.parse(
fs.readFileSync(`scripts/api-html-artifacts.json`, "utf-8"),
fs.readFileSync(`scripts/config/api-html-artifacts.json`, "utf-8"),
);
const artifactName = pkg.isDev() ? "dev" : `${pkg.versionWithoutPatch}`;

View File

@ -9,12 +9,10 @@ def test_all_notebooks_are_classified():
filenames=None,
write=False,
submit_jobs=True,
config_path="scripts/nb-tester/notebooks.toml"
config_path="scripts/config/notebook-testing.toml"
)
config = Config.from_args(args)
unclassified = [
path for path in Path(".").glob("[!.]*/**/*.ipynb")
if not matches(path, config.all_notebooks)

View File

@ -8,7 +8,7 @@ deps =
-e scripts/nb-tester
-r scripts/nb-tester/requirements.txt
setenv = PYDEVD_DISABLE_FILE_VALIDATION=1
commands = test-docs-notebooks {posargs} --config-path scripts/nb-tester/notebooks.toml
commands = test-docs-notebooks {posargs} --config-path scripts/config/notebook-testing.toml
[testenv:{lint,fix}]
deps = squeaky==0.7.0