Skip to content

Commit b7c6762

Browse files
Merge pull request #202 from egraphs-good/siu
Add support for anonymous functions
2 parents 3b877e4 + 3053ed1 commit b7c6762

35 files changed

+1596
-635
lines changed

Cargo.lock

Lines changed: 92 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
[package]
2-
name = "egglog-python"
2+
name = "egglog_python"
33
version = "7.2.0"
44
edition = "2021"
55

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

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

1414
# https://github.com/egraphs-good/egglog/compare/ceed816e9369570ffed9feeba157b19471dda70d...main
15-
egglog = { git = "https://github.com/egraphs-good/egglog", rev = "fb4a9f114f9bb93154d6eff0dbab079b5cb4ebb6" }
15+
# egglog = { git = "https://github.com/egraphs-good/egglog", rev = "fb4a9f114f9bb93154d6eff0dbab079b5cb4ebb6" }
16+
# egglog = { path = "../egg-smol" }
1617
# egglog = { git = "https://github.com/oflatt/egg-smol", branch = "oflatt-fast-terms" }
17-
# egglog = { git = "https://github.com/saulshanabrook/egg-smol", rev = "38b3014b34399cc78887ede09c845b2a5d6c7d19" }
18-
egraph-serialize = { git = "https://github.com/egraphs-good/egraph-serialize", rev = "5838c036623e91540831745b1574539e01c8cb23" }
18+
egglog = { git = "https://github.com/saulshanabrook/egg-smol", rev = "a555b2f5e82c684442775cc1a5da94b71930113c" }
19+
egraph-serialize = { git = "https://github.com/saulshanabrook/egraph-serialize", rev = "1c205fcc6d3426800b828e9264dbadbd4a5ef6e9", features = [
20+
"serde",
21+
"graphviz",
22+
] }
23+
# egraph-serialize = { path = "../egraph-serialize", features = [
24+
# "serde",
25+
# "graphviz",
26+
# ] }
1927
serde_json = "*"
2028
pyo3-log = "0.10.0"
2129
log = "0.4.21"
@@ -24,10 +32,11 @@ ordered-float = "*"
2432
uuid = { version = "1.8.0", features = ["v4"] }
2533
num-rational = "*"
2634

27-
[package.metadata.maturin]
28-
name = "egglog.bindings"
29-
3035
# Use unreleased version of egraph-serialize in egglog as well
31-
[patch.crates-io]
32-
egraph-serialize = { git = "https://github.com/egraphs-good/egraph-serialize", rev = "5838c036623e91540831745b1574539e01c8cb23" }
36+
# [patch.crates-io]
37+
# egraph-serialize = { git = "https://github.com/egraphs-good/egraph-serialize", rev = "5838c036623e91540831745b1574539e01c8cb23" }
3338
# egraph-serialize = { path = "../egraph-serialize" }
39+
40+
# enable debug symbols for easier profiling
41+
# [profile.release]
42+
# debug = 1

docs/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ _This project uses semantic versioning_
66

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

1014
## 7.2.0 (2024-05-23)
1115

docs/reference/contributing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ conda activate egglog-python
3232
Then install the package in editable mode with the development dependencies:
3333

3434
```bash
35-
pip install -e .[dev]
35+
maturin develop -E .[dev]
3636
```
3737

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

4040
### Running Tests
4141

pyproject.toml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["maturin>=0.13,<0.14"]
2+
requires = ["maturin>=1.0,<2.0"]
33
build-backend = "maturin"
44

55
[project]
@@ -62,7 +62,7 @@ docs = [
6262
"ablog",
6363
]
6464

65-
[tool.ruff]
65+
[tool.ruff.lint]
6666
ignore = [
6767
# Allow uppercase vars
6868
"N806",
@@ -74,7 +74,7 @@ ignore = [
7474
# Allow exec
7575
"S102",
7676
"S307",
77-
"PGH001",
77+
"S307",
7878
# allow star imports
7979
"F405",
8080
"F403",
@@ -173,12 +173,16 @@ ignore = [
173173
"D401",
174174
# Allow private member refs
175175
"SLF001",
176+
# allow blind exception to add context
177+
"BLE001",
176178
]
179+
select = ["ALL"]
180+
181+
[tool.ruff]
177182

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

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

202206
[tool.maturin]
203207
python-source = "python"
208+
module-name = "egglog.bindings"
204209

205210
[tool.pytest.ini_options]
206211
addopts = ["--import-mode=importlib"]

0 commit comments

Comments
 (0)