Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add env variable to Python builds to force debug builds #876

Merged
merged 4 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
from setuptools_rust import Binding, RustExtension


# If RUST_DEBUG is set, force compiling in debug mode. Else, use the default behavior of whether
# it's an editable installation.
rustworkx_debug = True if os.getenv("RUSTWORKX_DEBUG") == "1" else None


def readme():
with open('README.md') as f:
return f.read()
Expand All @@ -25,7 +30,7 @@ def readme():
PKG_PACKAGES = ["rustworkx", "rustworkx.visualization"]
PKG_INSTALL_REQUIRES = ['numpy>=1.16.0']
RUST_EXTENSIONS = [RustExtension("rustworkx.rustworkx", "Cargo.toml",
binding=Binding.PyO3)]
binding=Binding.PyO3, debug=rustworkx_debug)]

retworkx_readme_compat = """# retworkx

Expand Down
4 changes: 4 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ setenv =
LANGUAGE=en_US
LC_ALL=en_US.utf-8
ARGS="-V"
RUST_DEBUG=1
deps =
setuptools-rust
fixtures
Expand All @@ -22,6 +23,7 @@ extras =
passenv =
RETWORKX_TEST_PRESERVE_IMAGES
RUSTWORKX_PKG_NAME
RUSTWORKX_DEBUG
changedir = {toxinidir}/tests
commands =
stestr run {posargs}
Expand All @@ -43,12 +45,14 @@ commands =
basepython = python3
setenv =
{[testenv]setenv}
RUSTWORKX_DEBUG=1
deps =
-r {toxinidir}/docs/source/requirements.txt
passenv =
{[testenv]passenv}
RETWORKX_DEV_DOCS
RETWORKX_LEGACY_DOCS
RUST_DEBUG
changedir = {toxinidir}/docs
commands =
python -m ipykernel install --user
Expand Down