From 25ad6c6caa84cd3d1d84d35042dc6d2d2e985a3a Mon Sep 17 00:00:00 2001 From: Ivan Carvalho Date: Sat, 2 Sep 2023 15:24:23 -0400 Subject: [PATCH 1/2] Replace old environment variables refering to retworkx --- CONTRIBUTING.md | 4 ++-- docs/source/conf.py | 4 ++-- .../retworkx_backwards_compat/visualization/test_graphviz.py | 2 +- tests/retworkx_backwards_compat/visualization/test_mpl.py | 2 +- tests/rustworkx_tests/visualization/test_graphviz.py | 2 +- tests/rustworkx_tests/visualization/test_mpl.py | 2 +- tools/deploy_documentation_dev.sh | 2 +- tox.ini | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bd6ebdaa73..a04b2aaed6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -172,12 +172,12 @@ not include any way to view the images from the visualization tests. If you want to inspect the output from the visualization tests (which is common if you're working on visualizations) you can set the -`RETWORKX_TEST_PRESERVE_IMAGES` environment variable to any value and this will +`RUSTWORKX_TEST_PRESERVE_IMAGES` environment variable to any value and this will skip the cleanup. This will enable you to look at the output image and ensure the visualization is correct. For example, running: ``` -RETWORKX_TEST_PRESERVE_IMAGES=1 tox -epy +RUSTWORKX_TEST_PRESERVE_IMAGES=1 tox -epy ``` will run the visualization tests and preserve the generated image files after diff --git a/docs/source/conf.py b/docs/source/conf.py index 0addab6efb..3b1a8fe066 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -71,7 +71,7 @@ # Prepend warning for development docs: -if not os.getenv('RETWORKX_DEV_DOCS', None): +if not os.getenv('RUSTWORKX_DEV_DOCS', None): rst_prolog = """ .. raw:: html @@ -152,7 +152,7 @@ def _get_versions(app, config): def _get_version_label(current_version): - if not os.getenv('RETWORKX_DEV_DOCS', None): + if not os.getenv('RUSTWORKX_DEV_DOCS', None): current_version_info = current_version.split('.') return ".".join(current_version_info[:-1]) else: diff --git a/tests/retworkx_backwards_compat/visualization/test_graphviz.py b/tests/retworkx_backwards_compat/visualization/test_graphviz.py index 8a9ee64936..5d90395375 100644 --- a/tests/retworkx_backwards_compat/visualization/test_graphviz.py +++ b/tests/retworkx_backwards_compat/visualization/test_graphviz.py @@ -31,7 +31,7 @@ except Exception: HAS_PILLOW = False -SAVE_IMAGES = os.getenv("RETWORKX_TEST_PRESERVE_IMAGES", None) +SAVE_IMAGES = os.getenv("RUSTWORKX_TEST_PRESERVE_IMAGES", None) def _save_image(image, path): diff --git a/tests/retworkx_backwards_compat/visualization/test_mpl.py b/tests/retworkx_backwards_compat/visualization/test_mpl.py index eb5f4b5e9e..4d600c19be 100644 --- a/tests/retworkx_backwards_compat/visualization/test_mpl.py +++ b/tests/retworkx_backwards_compat/visualization/test_mpl.py @@ -29,7 +29,7 @@ except ImportError: HAS_MPL = False -SAVE_IMAGES = os.getenv("RETWORKX_TEST_PRESERVE_IMAGES", None) +SAVE_IMAGES = os.getenv("RUSTWORKX_TEST_PRESERVE_IMAGES", None) def _save_images(fig, path): diff --git a/tests/rustworkx_tests/visualization/test_graphviz.py b/tests/rustworkx_tests/visualization/test_graphviz.py index af2733141a..f0be1d5621 100644 --- a/tests/rustworkx_tests/visualization/test_graphviz.py +++ b/tests/rustworkx_tests/visualization/test_graphviz.py @@ -31,7 +31,7 @@ except Exception: HAS_PILLOW = False -SAVE_IMAGES = os.getenv("RETWORKX_TEST_PRESERVE_IMAGES", None) +SAVE_IMAGES = os.getenv("RUSTWORKX_TEST_PRESERVE_IMAGES", None) def _save_image(image, path): diff --git a/tests/rustworkx_tests/visualization/test_mpl.py b/tests/rustworkx_tests/visualization/test_mpl.py index 001f0e658a..312c857f66 100644 --- a/tests/rustworkx_tests/visualization/test_mpl.py +++ b/tests/rustworkx_tests/visualization/test_mpl.py @@ -29,7 +29,7 @@ except ImportError: HAS_MPL = False -SAVE_IMAGES = os.getenv("RETWORKX_TEST_PRESERVE_IMAGES", None) +SAVE_IMAGES = os.getenv("RUSTWORKX_TEST_PRESERVE_IMAGES", None) def _save_images(fig, path): diff --git a/tools/deploy_documentation_dev.sh b/tools/deploy_documentation_dev.sh index 123443a99e..80ad47c8ea 100755 --- a/tools/deploy_documentation_dev.sh +++ b/tools/deploy_documentation_dev.sh @@ -21,7 +21,7 @@ sudo apt-get install -y ./rclone.deb RCLONE_CONFIG_PATH=$(rclone config file | tail -1) # Build the documentation. -RETWORKX_DEV_DOCS=1 tox -edocs +RUSTWORKX_DEV_DOCS=1 tox -edocs echo "show current dir: " pwd diff --git a/tox.ini b/tox.ini index aeab7f94c5..d73b97b548 100644 --- a/tox.ini +++ b/tox.ini @@ -22,7 +22,7 @@ extras = mpl graphviz passenv = - RETWORKX_TEST_PRESERVE_IMAGES + RUSTWORKX_TEST_PRESERVE_IMAGES RUSTWORKX_PKG_NAME RUSTWORKX_DEBUG changedir = {toxinidir}/tests @@ -51,7 +51,7 @@ deps = -r {toxinidir}/docs/source/requirements.txt passenv = {[testenv]passenv} - RETWORKX_DEV_DOCS + RUSTWORKX_DEV_DOCS RETWORKX_LEGACY_DOCS RUST_DEBUG changedir = {toxinidir}/docs From d0cffe1fe23a1765c060093c7e0bd8da310d6fd9 Mon Sep 17 00:00:00 2001 From: Ivan Carvalho Date: Sat, 2 Sep 2023 15:25:26 -0400 Subject: [PATCH 2/2] More flags --- docs/source/conf.py | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 3b1a8fe066..038c463b3b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -124,7 +124,7 @@ for source_str in fd: redirects[f"stubs/{source_str}"] = f"../apiref/{source_str}" -if os.getenv("RETWORKX_LEGACY_DOCS", None) is not None: +if os.getenv("RUSTWORKX_LEGACY_DOCS", None) is not None: redirects["*"] = "https://qiskit.org/ecosystem/rustworkx/$source.html" html_baseurl = "https://qiskit.org/ecosystem/rustworkx/" diff --git a/tox.ini b/tox.ini index d73b97b548..16649d6bc3 100644 --- a/tox.ini +++ b/tox.ini @@ -52,7 +52,7 @@ deps = passenv = {[testenv]passenv} RUSTWORKX_DEV_DOCS - RETWORKX_LEGACY_DOCS + RUSTWORKX_LEGACY_DOCS RUST_DEBUG changedir = {toxinidir}/docs commands =