-
Notifications
You must be signed in to change notification settings - Fork 312
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
Upgrade to rand 0.7.0 #659
Conversation
Does anyone have an immediate idea of how to resolve this:
|
Hey - nice to see the work going on here. I approve of the developments :) ndarray-rand has been really simple, it can be version bumped and released whenever either of rand or ndarray gains a version, so it's running at double speed, and it has worked, if you want to continue using that. That said, the active maintainers are the boss. The error is probably due to mixing types/traits from rand and rand_disr - when ndarray-rand is upgraded, it should no longer use the rand version of Distribution and Normal? |
Thanks for responding @bluss I moved the
|
Ah - it's obvious actually - |
I bumped the ndarray-rand version to |
Because of https://github.com/rust-random/getrandom, we need to bump the rust version to 1.32 for this to work. Not sure whether that's acceptable or not? |
To avoid the issues reported in #658, I believe we should re-export As @bluss said, we are already bumping up |
# Conflicts: # ndarray-rand/Cargo.toml # ndarray-rand/src/lib.rs
I read up on this just a couple of days ago, so my understanding is a bit shaky. I had thought that if a crate exported anything from a dependency, cargo prevented conflicts (but maybe only on What would that suggestion look like? If you have any links to hand for more context, I'm happy to add it to this PR. |
I think I had read this, which is only a proposal: https://github.com/rust-lang/rfcs/blob/master/text/1977-public-private-dependencies.md |
And then according to this, rust already prevents dependency conflicts: https://stephencoakley.com/2019/04/24/how-rust-solved-dependency-hell ...but that seems to not be true - I independently tested @ngoldbaum's example, and cargo will let you install |
Sure, let me open a PR against the master branch of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generally looks good to me. I just had comments about the dependency on rand_distr
.
Since users seem to keep having confusion with rand
versions, we should consider adding a prominent note in the docs that says something like:
ndarray-rand
depends onrand
0.7. If you use any other items fromrand
, you need to specify a compatible version ofrand
in yourCargo.toml
. If you want to use a RNG or distribution from another crate withndarray-rand
, you need to make sure that crate also depends on the correct version ofrand
. Otherwise, the compiler will return errors saying that the items are not compatible (e.g. that a type doesn't implement a necessary trait).
Great, thanks @jturner314 I added the docs note to the readme - is that the right place? Any additional feedback? |
It would be good to also add the note to the main Everything else looks good to me. |
Ah great, thanks for the pointer @jturner314 - added. Lmk any other changes |
If I run
I don't get the same errors if I close the |
I just tried this and got the same errors until I ran |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good to me.
Any follow-ups here remaining? |
I don't know why this is languishing. We should not version bump rand in ndarray-rand without making a release. |
Was this on me? Apologies if so |
Mostly on me - I was waiting to understand our decision on #663 to cut a release. |
Sorry for overreacting, I had hoped I could fix it by releasing but since the rand distr PR is open it makes sense to resolve it first. |
Would close #658
I'm not sure what the policy is on upgrading dependencies; posting as draft