Skip to content

Only set PYTHONDONTWRITEBYTECODE env variable for subprocess #165

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

Merged
merged 1 commit into from
Apr 1, 2025
Merged
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
13 changes: 6 additions & 7 deletions style/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,17 @@ fn generate_properties(engine: &str) {
}
}

// `cargo publish` isn't happy with the `__pycache__` files that are created
// when we run the property generator.
//
// TODO(mrobinson): Is this happening because of how we run this script? It
// would be better to ensure are just placed in the output directory.
env::set_var("PYTHONDONTWRITEBYTECODE", "1");

let script = Path::new(&env::var_os("CARGO_MANIFEST_DIR").unwrap())
.join("properties")
.join("build.py");

let status = Command::new(&*PYTHON)
// `cargo publish` isn't happy with the `__pycache__` files that are created
// when we run the property generator.
//
// TODO(mrobinson): Is this happening because of how we run this script? It
// would be better to ensure are just placed in the output directory.
.env("PYTHONDONTWRITEBYTECODE", "1")
.arg(&script)
.arg(engine)
.arg("style-crate")
Expand Down