Skip to content

Commit

Permalink
shared workspace for rust deps
Browse files Browse the repository at this point in the history
This is especially helpful when doing patch over-rides, since data_prep
depends on backend.
  • Loading branch information
michaelkirk committed Feb 21, 2025
1 parent a17800a commit 89c22c7
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 1,166 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ jobs:

- name: Run tests
run: |
cd backend
cargo test --release
35 changes: 35 additions & 0 deletions backend/Cargo.lock → Cargo.lock

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

28 changes: 28 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[workspace]
members = [
"backend",
"data_prep/scotland",
]

resolver = "2"

[workspace.package]
edition = "2021"

[workspace.dependencies]
anyhow = "1.0.82"
bincode = "1.3.3"
geo = { git = "https://github.com/georust/geo" }
geojson = { git = "https://github.com/georust/geojson", features = ["geo-types"] }
serde = "1.0.188"
utils = { git = "https://github.com/a-b-street/utils", features = ["serde"] }

# For local development, build dependencies in release mode once, but otherwise
# use dev profile and avoid wasm-opt.
[profile.dev.package."*"]
opt-level = 3

[patch.crates-io]
geo = { git = "https://github.com/georust/geo" }
geo-types = { git = "https://github.com/georust/geo" }

28 changes: 10 additions & 18 deletions backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[package]
name = "backend"
version = "0.1.0"
edition = "2021"
edition.workspace = true

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
anyhow = "1.0.82"
bincode = "1.3.3"
anyhow.workspace = true
bincode.workspace = true
console_error_panic_hook = "0.1.6"
console_log = "1.0.0"
contour = "0.12.0"
fast_paths = "1.0.0"
geo = "0.29.1"
geojson = { git = "https://github.com/georust/geojson", features = ["geo-types"] }
geo.workspace = true
geojson.workspace = true
# Note: i_overlay doesn't follow semver, and only guarantees non-breaking across patch versions.
# https://github.com/iShape-Rust/iOverlay?tab=readme-ov-file#versioning-policy
# So we pin to a minor version.
Expand All @@ -25,10 +25,10 @@ nanorand = { version = "0.7.0", default-features = false, features = ["wyrand"]
osm-reader = { git = "https://github.com/a-b-street/osm-reader" }
route-snapper-graph = { git = "https://github.com/dabreegster/route_snapper" }
rstar = "0.12.0"
serde = "1.0.188"
serde.workspace = true
serde_json = "1.0.105"
serde-wasm-bindgen = "0.6.0"
utils = { git = "https://github.com/a-b-street/utils", features = ["serde"] }
utils.workspace = true
wasm-bindgen = "0.2.87"
web-sys = { version = "0.3.64", features = ["console"] }
web-time = "1.0.0"
Expand All @@ -38,26 +38,18 @@ petgraph = "0.7.1"
criterion = "0.5.1"
approx = "0.5.1"

# For local development, build dependencies in release mode once, but otherwise
# use dev profile and avoid wasm-opt.
[profile.dev.package."*"]
opt-level = 3

[[bench]]
name = "build_map_model"
harness = false

[[bench]]
name = "build_neighbourhood"
harness = false

[[bench]]
name = "router"
harness = false

[[bench]]
name = "shortcuts"
harness = false

[patch.crates-io]
# use unreleased `geo` and `geo-types` to fix crash: https://github.com/a-b-street/ltn/issues/54
# (awaiting release of https://github.com/georust/geo/pull/1279)
geo = { git = "https://github.com/georust/geo" }
geo-types = { git = "https://github.com/georust/geo" }
Loading

0 comments on commit 89c22c7

Please sign in to comment.