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

fix: make pumpkin-py build without any additional installs #113

Merged
merged 1 commit into from
Dec 19, 2024
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
2 changes: 1 addition & 1 deletion pumpkin-py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ name = "pumpkin_py"
crate-type = ["cdylib"]

[dependencies]
pyo3 = "0.23.0"
pyo3 = { version = "0.23.3", features= ["extension-module"] }
pumpkin-solver = { path = "../pumpkin-solver" }
21 changes: 20 additions & 1 deletion pumpkin-py/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,24 @@ again.

Then, the examples (for example `nqueens`) can be run with
```
python python/examples/nqueens.py 5
python examples/nqueens.py 5
```

### PyO3 rebuilds

When developing in an IDE that runs `cargo check` on save, the PyO3 build
cache can get invalidated unnecessarily. See https://github.com/PyO3/pyo3/issues/1708
for more details. One way to fix this is by making `rust-analyzer` use a
different directory. In VSCode, you could fix this by adding the following
to your `.vscode/settings.json` (in the main project directory):

```json
{
"rust-analyzer.server.extraEnv": {
"CARGO_TARGET_DIR": "target/analyzer"
},
"rust-analyzer.check.extraArgs": [
"--target-dir=target/analyzer"
]
}
```
2 changes: 1 addition & 1 deletion pumpkin-py/examples/nqueens.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def main(n: int, proof: Path | None):
for row in range(n):
print(f"{row_separator}");

queen_col = solution.value(variables[row])
queen_col = solution.int_value(variables[row])

for col in range(n):
string = "| * " if queen_col == col else "| "
Expand Down
Loading