Skip to content

Commit

Permalink
Relax constraints in rustworkx-core for hashbrown and indexmap (#929)
Browse files Browse the repository at this point in the history
* Relax constraints in rustworkx-core for hashbrown and indexmap

This commit updates the version constraints on the hashbrown and
indexmap dependencies in rustworkx-core's dependency list. These 2
dependencies are used for I/O to rustworkx-core and we previously had
our versions set to the highest version compatible with the msrv.
However, for users of rustworkx-core with newer MSRVs this limited
version support caused issues if they wanted to use a newer version of
these library (which was compatible with their MSRV) as an input or output
to rustworkx-core. For example, as described in #911 qiskit-terra was
using hashbrown 0.13.x and had errors because the released version of
rustworkx-core only was listed as compatible with hashbrown 0.12. This
version mismatch meant that the hashbrown objects created in
qiskit-terra were not recognized by rustworkx-core because of the
version mismatch. This commit attempts to fix this issue by increasing
the allowable range of versions to be greater than or equal to our
previous fixed version and capped at the last known working version.
This should enable users to set a fixed library version that they want
even if it's newer and requires a higher MSRV.

This commit is for the stable/0.13 branch as the minimum version is
lower on the stable branch as the MSRV for the 0.13.0 is much older than
what we're using on the main branch now. A separate PR will be pushed up
for main to update it there. This was done in reverse in the interest of
ensuring we include this in 0.13.1 and the inevitable backport conflict
if we started with main first.

Fixes #911

* Try manually setting package version in msrv ci job

* Apply suggestions from code review

---------

Co-authored-by: Ivan Carvalho <8753214+IvanIsCoding@users.noreply.github.com>
  • Loading branch information
mtreinish and IvanIsCoding committed Jul 20, 2023
1 parent 14af315 commit f874efc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ jobs:
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.platform.rust-target }}
- name: 'Set msrv min versions'
run: |
cargo update -p hashbrown:0.12.3 --precise 0.12.3 --workspace
cargo update -p indexmap:1.9.3 --precise 1.9.3 --workspace
if: ${{ matrix.msrv == 'MSRV' }}
- name: 'Install dependencies'
run: python -m pip install --upgrade tox
- name: 'Install binary dependencies'
Expand Down
7 changes: 2 additions & 5 deletions rustworkx-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ priority-queue = "1.2"
rayon-cond = "0.2"

[dependencies.hashbrown]
version = "0.12"
version = ">=0.12, <0.15"
features = ["rayon"]

[dependencies.indexmap]
version = "1.9"
version = ">=1.9, < 3"
features = ["rayon"]

[dev-dependencies]
rand = "0.8"

0 comments on commit f874efc

Please sign in to comment.