From 4f19461aff8feefd9b54c2c36dfb84da962b7634 Mon Sep 17 00:00:00 2001 From: Ivan Carvalho Date: Fri, 11 Apr 2025 22:17:18 -0400 Subject: [PATCH 1/2] Remove tox.ini --- pyproject.toml | 14 +++++++- tox.ini | 93 -------------------------------------------------- 2 files changed, 13 insertions(+), 94 deletions(-) delete mode 100644 tox.ini diff --git a/pyproject.toml b/pyproject.toml index 03dfdb0ab8..7dcfda0c38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,4 +55,16 @@ environment = "MACOSX_DEPLOYMENT_TARGET=10.12" repair-wheel-command = "brew install pipx && pipx ensurepath && pipx run --spec delocate==0.11.0 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} && pipx run abi3audit==0.0.9 --strict --report {wheel}" [tool.cibuildwheel.windows] -repair-wheel-command = "cp {wheel} {dest_dir}/. && pipx run abi3audit==0.0.9 --strict --report {wheel}" \ No newline at end of file +repair-wheel-command = "cp {wheel} {dest_dir}/. && pipx run abi3audit==0.0.9 --strict --report {wheel}" + +[tool.tox] +legacy_tox_ini = """ + [tox] + minversion = 4.4.0 + envlist = py, lint, tests, docs, stubs, black + + [testenv] + deps = nox + commands = nox -e {envname} + skip_install = true +""" \ No newline at end of file diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 618baf3927..0000000000 --- a/tox.ini +++ /dev/null @@ -1,93 +0,0 @@ -[tox] -minversion = 4.4.0 -envlist = py39, py310, py311, lint -isolated_build = true - -[testenv] -install_command = python -I -m pip install -c{toxinidir}/constraints.txt -U {opts} {packages} -setenv = - VIRTUAL_ENV={envdir} - LANGUAGE=en_US - LC_ALL=en_US.utf-8 - ARGS="-V" - RUST_DEBUG=1 -deps = - setuptools-rust - fixtures - testtools>=2.5.0 - networkx>=2.5 - stestr>=4.1 -extras = - mpl - graphviz -passenv = - RUSTWORKX_TEST_PRESERVE_IMAGES - RUSTWORKX_PKG_NAME - RUSTWORKX_DEBUG -changedir = {toxinidir}/tests -commands = - stestr run {posargs} - python -c "print('\nrustworkx no longer supports tox. Please run the equivalent command with nox:\n\n\tnox -e test\n')" - -[testenv:lint] -basepython = python3 -skip_install = true -deps = - black~=24.8 - ruff -allowlist_externals=cargo -commands = - black --check --diff {posargs} '../rustworkx' '../tests' '../retworkx' - ruff check ../rustworkx ../retworkx . ../setup.py - cargo fmt --all -- --check - python {toxinidir}/tools/find_stray_release_notes.py - python -c "print('\nrustworkx no longer supports tox. Please run the equivalent command with nox:\n\n\tnox -e lint\n')" - - -[testenv:docs] -basepython = python3 -setenv = - {[testenv]setenv} - RUSTWORKX_DEBUG=1 -deps = - -r {toxinidir}/docs/source/requirements.txt -passenv = - {[testenv]passenv} - RUSTWORKX_DEV_DOCS - RUSTWORKX_LEGACY_DOCS - RUST_DEBUG -changedir = {toxinidir}/docs -commands = - python -m ipykernel install --user - jupyter kernelspec list - sphinx-build -W -d {toxinidir}/docs/build/.doctrees -b html source build/html {posargs} - python -c "print('\nrustworkx no longer supports tox. Please run the equivalent command with nox:\n\n\tnox -e docs\n')" - -[testenv:docs-clean] -skip_install = true -deps = -allowlist_externals = rm -commands = - rm -rf {toxinidir}/docs/build {toxinidir}/docs/source/apiref - python -c "print('\nrustworkx no longer supports tox. Please run the equivalent command with nox:\n\n\tnox -e docs_clean\n')" - -[testenv:black] -basepython = python3 -skip_install = true -deps = - black~=24.8 -commands = - black {posargs} '../rustworkx' '../tests' '../retworkx' - python -c "print('\nrustworkx no longer supports tox. Please run the equivalent command with nox:\n\tnox -e black\n')" - -[testenv:stubs] -basepython = python3 -deps = - mypy==1.8.0 - typing-extensions -extras = - mpl - graphviz -commands = - python -m mypy.stubtest --concise rustworkx - python -c "print('\nrustworkx no longer supports tox. Please run the equivalent command with nox:\n\n\tnox -e stubs\n')" From c16e25b10213b6600387c346885bb4cc8c8e124a Mon Sep 17 00:00:00 2001 From: Ivan Carvalho Date: Fri, 11 Apr 2025 22:26:46 -0400 Subject: [PATCH 2/2] Document tox support --- CONTRIBUTING.md | 8 +++++++- pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c02d3180d6..d218e27d76 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -122,11 +122,17 @@ rust code (or packaged python code) changes to the repo since then. Otherwise the rustworkx package Nox installs in its virtualenv will be out of date (or missing). -Note, if you run tests outside of Nox that you can **not** run the tests from +> [!NOTE] +> If you run tests outside of Nox that you can **not** run the tests from the root of the repo, this is because rustworkx packaging shim will conflict with imports from rustworkx the installed version of rustworkx (which contains the compiled extension). + +> [!NOTE] +> For compatibility purposes, rustworkx tests can also be run with `tox`. +Most commands should work by just replacing `nox` with `tox`. + #### Running tests with a specific Python version If you want to run the tests with a specific version of Python, use the `test_with_version` diff --git a/pyproject.toml b/pyproject.toml index 7dcfda0c38..8561315d35 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,6 +65,6 @@ legacy_tox_ini = """ [testenv] deps = nox - commands = nox -e {envname} + commands = nox -e {envname} -- {posargs} skip_install = true """ \ No newline at end of file