microsoft/spacy-ann-linker

Relax dependency version pins

Opened this issue · 0 comments

jayqi commented

Currently this library has fairly strict dependency version requirements, with some of them pinned to exact versions.

requires = [
"nmslib >= 2.1.1, <2.2",
"pydantic == 1.5",
"scikit-learn == 0.23.1",
"scipy >= 1.5.1, <1.6.0",
"spacy >= 2.2.1, <3.0.0",
"typer == 0.3.0",
"tqdm == 4.47.0"
]

It's generally a best practice for reusable libraries to have more relaxed version requirements, one of:

  1. Version floor only, e.g., tqdm >= 4.47.0
  2. Version floor with version ceiling on major version. That assumes the dependency follows semver and that major version changes have backwards incompatible changes, e.g., tqdm >= 4.47, <5

with more specific version ceilings introduced only if a specific update introduces a known incompatibility.

Whether (1) or (2) is followed is not a settled thing, but my preference is for (1) because it gives users the most flexibility and has the most limited scope of failure (only causes problems if a major version change specifically breaks an API used by this library, as opposed to any time another dependency floors on the new major version).

The reason for doing so is that unnecessarily strict version requirements makes it really difficult for users of a library to reconcile dependency resolution against other dependencies. Having strict exact pins is a practice for applications for stable reproducibility.

References: