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

Allow any version requirement string for searching #11

Open
dagolden opened this issue Nov 21, 2014 · 2 comments
Open

Allow any version requirement string for searching #11

dagolden opened this issue Nov 21, 2014 · 2 comments

Comments

@dagolden
Copy link

The API should allow either a scalar version requirement string, not
just a single version.

It's a breaking change unless single versions are prefixed with "=",
but I'm not sure it's a bad breaking change anyway. Making
index lookup function more like what CPAN clients expect is probably
less surprising.

@kentfredric
Copy link

I'd possibly define such a search API that allows either returning one of the following:

  • The "newest" version that meets a criteria
  • The "oldest" version that meets a criteria (I'll explain)
  • A list of packages that meet a criteria.

This is obviously not so straight forward to do with all backends, but there's a lot of things that are possible if one ever adds a MetaCPAN::API backend.

Oldest criteria

Often when you have a larger project, you might need an extra dependency.

That dependency in turn, may itself, require a dependency of something newer than you already have.

Common behaviour at present is to simply update to the latest version, which can have a bunch of negative effects, importantly:

  • Pulling more dependencies you don't want/need
  • Doing a more radical upgrade than you intended and breaking a lot of code

Hence, I consider it to be useful to perform a "minimal upgrade" to satisfy a dependency, instead of a maximal one.

However, no tools presently make doing that straight forward that I'm aware of.

Side note I don't know how to classify

There also needs to be some sort of way of saying:

needs X 0.5
needs Y 0.6

And having the system intelligently realise that X 0.7 and Y 0.7 are the same distrubition and offer you install choices respectively.

But also when it opts to install only X 0.5 and Y 0.6 which are Different distributions, offer the right install results that way too.

Reason: One common problem I'll see is cpanm installing something to satisfy one dependency , and then later having to downgrade the dependency it just installed in the same dependency tree.

( An example I hit regularly is simplified here: miyagawa/cpanminus#388 )

But I have no idea where in the levels such a query should go.

@dagolden
Copy link
Author

dagolden commented Dec 8, 2014

IIRC, my original search API thoughts were to return a high-to-low ordered list of distributions that match the search criteria. This would leave "oldest" or "newest" logic up to the consumer.

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

No branches or pull requests

1 participant