question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: concise "compatibility" matching

See original GitHub issue

I’d really like a concise expression for “is version x compatible with version y?”

Specifically, suppose I write code against one version of an API, and the API exposes a semver-compliant version. Is v_caller compatible with v_api?

The most concise expression I can come up with is something like v_caller <= v_api and v_caller.major == v_api.major, but I really wish this was simpler and more readable. Maybe v_caller.compatible(v_api); or maybe v_caller.can_call(v_api) better illustrates which operand is which.

I know this would be covered by #241, but its scope is quite broad. I wanted to specifically call out this feature.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:23 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
tlaferrierecommented, Nov 16, 2022

From what I understand, the current a.is_compatible(b) shows if you could replace package b with package a without any problems right? I don’t think the is_breaking would reflect that behaviour at all?

Just so I understand

  • 1.2.0 is compatible with 1.1.1
  • 2.0.0 is not compatible with 1.1.1
  • 1.1.1 is compatible with 1.1.1
  • 1.1.0 is not compatible with 1.1.1

Right?

@Lexicality you are very right indeed. The direction of the relation I was talking about was not that of the dependency, but the bump (I totally misunderstood that). Therefore this would make more sense:

def is_compatible_with(self, new: Version) -> bool:
    ...

Or

def is_compatible(old: Version, new: Version):
    ...

So please disregard anything I said about dependency relationships, and replace it with old/new relationship instead 😅

1reaction
Lexicalitycommented, Nov 16, 2022

From what I understand, the current a.is_compatible(b) shows if you could replace package b with package a without any problems right? I don’t think the is_breaking would reflect that behaviour at all?

Just so I understand

  • 1.2.0 is compatible with 1.1.1
  • 2.0.0 is not compatible with 1.1.1
  • 1.1.1 is compatible with 1.1.1
  • 1.1.0 is not compatible with 1.1.1

Right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BACKPORT][v1.3.1][IMPROVEMENT] Reduce syscalls while ...
Is your improvement request related to a feature? Please describe #4122 Describe the solution you'd like A clear and concise description of what...
Read more >
Submitting a Product Idea - Qualtrics
Qtip: Be sure your idea's title is short and concise. This is how users will be able to search for your idea. Fill...
Read more >
Mobile Feature Requests | Vivaldi Forum
Welcome to Vivaldi's Feature Requests for Vivaldi for Android ... Choose a clear and concise title for the topic, describe the feature in...
Read more >
Concise Promela Reference - Spin
Constants in the list of a receive, constrain its enabledness by forcing the corresponding values in the oldest message (or matching send) to...
Read more >
Merge requests workflow - GitLab Docs
In general, bug fixes that include a regression test are merged quickly. New features without proper tests might be slower to receive feedback....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found