Skip to content

Upgrade dependencies and switch from alga to simba#3

Merged
hmeyer merged 2 commits intohmeyer:masterfrom
dflemstr:master
Jun 13, 2021
Merged

Upgrade dependencies and switch from alga to simba#3
hmeyer merged 2 commits intohmeyer:masterfrom
dflemstr:master

Conversation

@dflemstr
Copy link
Copy Markdown
Contributor

@dflemstr dflemstr commented Jun 8, 2021

The alga crate is deprecated and has been replaced by simba. This PR also allows the introduction of a much newer nalgebra version which is pretty significant

Copy link
Copy Markdown
Owner

@hmeyer hmeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this change.
Please also bump the minor version of this package to 0.12.

alga = "0.9"
num-traits = "0.2"
approx = "0.4"
approx = "0.5.0"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it preferable to specify the full version instead of just the major+minor?

Copy link
Copy Markdown
Contributor Author

@dflemstr dflemstr Jun 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using the default conventions of the cargo-edit tool which was what I used to automate this change. I suppose it might help ensure that users of this crate get at least the version of a dependency that was used to run the test suite. Imagine if 0.5.2 is buggy, 0.5.3 is fine, and the tests of this crate were tested against 0.5.3. Setting the patch version ensures that users don't accidentally get the 0.5.2 version (ie. they get at least the version that this crate was tested against).

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't ~0.5.3 be preferable in this case?
I think crates should not overly specific in their version requirements.
This is b/c if this crate required approx 0.5.3 and another crate foo required approx 0.5.4 then a binary using both bbox and foo would end up linking both approx 0.5.3 and 0.5.4.

Copy link
Copy Markdown
Contributor Author

@dflemstr dflemstr Jun 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose that in cargo, the default constraint is ^ (so writing x.y.z is the same as ^x.y.z). ^ behaves like ~ but also allows updates up to but not including the next major version. In essence, the version I specified here is equivalent to 0.5.0 <= x < 1.0.0.

I didn't put much thought into it to be honest, I just defaulted to whatever the rust tools do by default, which is using the best practices as set by the rust book/crates.io (which recommends defaulting to using bare x.y.z versions) and cargo-edit (which also calls out wanting to align with these best practices). Since this is your crate, you of course get to make the final call, and I would recommend sticking to the conventions as used by the cargo tools, but let me know if you prefer not to, and I can try to match the constraint convention you used before.

All bets are off here anyway since these crates aren't using semver major version 1, so technically 0.5.3 and 0.5.4 could have completely different APIs.

@hmeyer hmeyer merged commit 7b7fabc into hmeyer:master Jun 13, 2021
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