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

refactor(hugr-model)!: Reexport indexmap, bumpalo, and fxhash from hugr-model #1870

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

doug-q
Copy link
Collaborator

@doug-q doug-q commented Jan 17, 2025

BREAKING CHANGE: read_from_slice now returns a new type ReadError.

@doug-q doug-q requested a review from a team as a code owner January 17, 2025 10:22
@doug-q doug-q requested review from tatiana-s and zrho January 17, 2025 10:22
@doug-q doug-q force-pushed the doug/privatize-model-deps branch from 7425257 to 0ac2e5f Compare January 17, 2025 10:23
@ss2165
Copy link
Member

ss2165 commented Jan 17, 2025

is it possible to export just the relevant types, perhaps using aliases? e.g. pub type Bump = bumpalo::Bump;

rather than re-exporting entire dependencies. Changes to these exports would be breaking in future.

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.52%. Comparing base (b38a2e8) to head (dda6f43).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1870   +/-   ##
=======================================
  Coverage   86.52%   86.52%           
=======================================
  Files         194      194           
  Lines       35250    35250           
  Branches    32063    32063           
=======================================
  Hits        30501    30501           
  Misses       2973     2973           
  Partials     1776     1776           
Flag Coverage Δ
python 92.34% <ø> (ø)
rust 85.94% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@doug-q
Copy link
Collaborator Author

doug-q commented Jan 17, 2025

is it possible to export just the relevant types, perhaps using aliases? e.g. pub type Bump = bumpalo::Bump;

rather than re-exporting entire dependencies. Changes to these exports would be breaking in future.

I don't see any reason to prefer an alias over a pub use?

That's what I started with, but I decided I would rather not make a decision on what are the relevant items.

To be clear before this PR breaking changes to these dependencies would already be breaking changes for hugr-model, but in a much more annoying way.

When there are not breaking changes this approach is the most useful for users, because we have not excluded something they need.

Happy to revise if you think it's much better. I would include:

  • bumpalo::Bump as Bump
  • bumpalo::collections::String as BumpString
  • bumpalo::collections::Vec as BumpVec
  • bumpalo::AllocErr as AllocErr
  • indexmap::IndexMap
  • fxhash::FxHashMap as FxHashMap

all in hugr_model::v0

@ss2165
Copy link
Member

ss2165 commented Jan 17, 2025

fair enough, I'd like to hear @zrho 's opinion on what are the useful set of things to make part of the interface

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants