Skip to content

Commit

Permalink
Merge pull request #202 from egraphs-good/siu
Browse files Browse the repository at this point in the history
Add support for anonymous functions
  • Loading branch information
saulshanabrook authored Aug 14, 2024
2 parents 3b877e4 + 3053ed1 commit b7c6762
Show file tree
Hide file tree
Showing 35 changed files with 1,596 additions and 635 deletions.
110 changes: 92 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 19 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
[package]
name = "egglog-python"
name = "egglog_python"
version = "7.2.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "egglog_python"
name = "egglog"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.21", features = ["extension-module"] }

# https://github.com/egraphs-good/egglog/compare/ceed816e9369570ffed9feeba157b19471dda70d...main
egglog = { git = "https://github.com/egraphs-good/egglog", rev = "fb4a9f114f9bb93154d6eff0dbab079b5cb4ebb6" }
# egglog = { git = "https://github.com/egraphs-good/egglog", rev = "fb4a9f114f9bb93154d6eff0dbab079b5cb4ebb6" }
# egglog = { path = "../egg-smol" }
# egglog = { git = "https://github.com/oflatt/egg-smol", branch = "oflatt-fast-terms" }
# egglog = { git = "https://github.com/saulshanabrook/egg-smol", rev = "38b3014b34399cc78887ede09c845b2a5d6c7d19" }
egraph-serialize = { git = "https://github.com/egraphs-good/egraph-serialize", rev = "5838c036623e91540831745b1574539e01c8cb23" }
egglog = { git = "https://github.com/saulshanabrook/egg-smol", rev = "a555b2f5e82c684442775cc1a5da94b71930113c" }
egraph-serialize = { git = "https://github.com/saulshanabrook/egraph-serialize", rev = "1c205fcc6d3426800b828e9264dbadbd4a5ef6e9", features = [
"serde",
"graphviz",
] }
# egraph-serialize = { path = "../egraph-serialize", features = [
# "serde",
# "graphviz",
# ] }
serde_json = "*"
pyo3-log = "0.10.0"
log = "0.4.21"
Expand All @@ -24,10 +32,11 @@ ordered-float = "*"
uuid = { version = "1.8.0", features = ["v4"] }
num-rational = "*"

[package.metadata.maturin]
name = "egglog.bindings"

# Use unreleased version of egraph-serialize in egglog as well
[patch.crates-io]
egraph-serialize = { git = "https://github.com/egraphs-good/egraph-serialize", rev = "5838c036623e91540831745b1574539e01c8cb23" }
# [patch.crates-io]
# egraph-serialize = { git = "https://github.com/egraphs-good/egraph-serialize", rev = "5838c036623e91540831745b1574539e01c8cb23" }
# egraph-serialize = { path = "../egraph-serialize" }

# enable debug symbols for easier profiling
# [profile.release]
# debug = 1
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ _This project uses semantic versioning_

- Adds ability to use anonymous functions where callables are needed. These are automatically transformed to egglog
functions with default rewrites.
- Upgrade [egglog](https://github.com/egraphs-good/egglog/compare/fb4a9f114f9bb93154d6eff0dbab079b5cb4ebb6...saulshanabrook:egg-smol:a555b2f5e82c684442775cc1a5da94b71930113c)
- Adds source annotations to expressions for tracebacks
- Adds ability to inline other functions besides primitives in serialized output
- Adds `remove` and `set` methods to `Vec`

## 7.2.0 (2024-05-23)

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ conda activate egglog-python
Then install the package in editable mode with the development dependencies:

```bash
pip install -e .[dev]
maturin develop -E .[dev]
```

Anytime you change the rust code, you can run `pip install -e .` to recompile the rust code.
Anytime you change the rust code, you can run `maturin develop -E` to recompile the rust code.

### Running Tests

Expand Down
13 changes: 9 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["maturin>=0.13,<0.14"]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"

[project]
Expand Down Expand Up @@ -62,7 +62,7 @@ docs = [
"ablog",
]

[tool.ruff]
[tool.ruff.lint]
ignore = [
# Allow uppercase vars
"N806",
Expand All @@ -74,7 +74,7 @@ ignore = [
# Allow exec
"S102",
"S307",
"PGH001",
"S307",
# allow star imports
"F405",
"F403",
Expand Down Expand Up @@ -173,12 +173,16 @@ ignore = [
"D401",
# Allow private member refs
"SLF001",
# allow blind exception to add context
"BLE001",
]
select = ["ALL"]

[tool.ruff]

line-length = 120
# Allow lines to be as long as 120.
src = ["python"]
select = ["ALL"]
extend-exclude = ["python/tests/__snapshots__"]
unsafe-fixes = true

Expand All @@ -201,6 +205,7 @@ exclude = ["__snapshots__", "_build", "^conftest.py$"]

[tool.maturin]
python-source = "python"
module-name = "egglog.bindings"

[tool.pytest.ini_options]
addopts = ["--import-mode=importlib"]
Expand Down
Loading

0 comments on commit b7c6762

Please sign in to comment.