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

Check version numbers in =1.2.3 and >1.2.3, and >=1.2.3 #115

Merged
merged 1 commit into from
Nov 28, 2021

Conversation

mgeisler
Copy link
Owner

Before, a dependency specified as

[dependencies]
foo = ">= 1.2.3, < 2.0"

was ignored since it was deemed too complicated to check versions
requirements with multiple comparators.

We now handle such cases by checking every comparator individually.
Comparators which form a lower-bound for the version is checked. This
means that version requirements of the form

  • 1.2 and ^1.2
  • ~1.2
  • =1.2
  • >1.2
  • >=1.2
  • 1.2.*

are all checked for compatibility with the actual crate version. If
the crate version is higher than the version requirement, an error is
returned.

Upper-build version requirements such as <2.0 are ignored like
before.

Before, a dependency specified as

```toml
[dependencies]
foo = ">= 1.2.3, < 2.0"
```

was ignored since it was deemed too complicated to check versions
requirements with multiple comparators.

We now handle such cases by checking every comparator individually.
Comparators which form a lower-bound for the version is checked. This
means that version requirements of the form

* `1.2` and `^1.2`
* `~1.2`
* `=1.2`
* `>1.2`
* `>=1.2`
* `1.2.*`

are all checked for compatibility with the actual crate version. If
the crate version is higher than the version requirement, an error is
returned.

Upper-build version requirements such as `<2.0` are ignored like
before.
@mgeisler mgeisler enabled auto-merge November 28, 2021 21:48
@mgeisler mgeisler merged commit c55e8c2 into master Nov 28, 2021
@mgeisler mgeisler deleted the check-more-comparators branch November 28, 2021 21:49
@github-actions github-actions bot mentioned this pull request Dec 12, 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.

1 participant