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

greater than (e.g. >=3.6) not supported #34

Open
tacman opened this issue Jan 30, 2024 · 3 comments
Open

greater than (e.g. >=3.6) not supported #34

tacman opened this issue Jan 30, 2024 · 3 comments
Assignees

Comments

@tacman
Copy link

tacman commented Jan 30, 2024

I'm trying to parse the version string

 symfony/monolog-bundle: >=3.6 

on https://packagist.org/packages/antonchernik/logging-bundle,

3^ PharIo\Version\UnsupportedVersionConstraintException^ {#4853
  #message: "Version constraint >=3.6 is not supported."
  #code: 0
  #file: "./vendor/phar-io/version/src/VersionConstraintParser.php"
  #line: 22
  trace: {
    ./vendor/phar-io/version/src/VersionConstraintParser.php:22 { …}
@tacman tacman changed the title greater than (e.g. >3.6) not supported greater than (e.g. >=3.6) not supported Jan 30, 2024
@theseer theseer self-assigned this Jan 31, 2024
@theseer
Copy link
Member

theseer commented Jan 31, 2024

We so far did not implement these as their use is discouraged.
Using unbounded constraints like these is a disaster waiting to happen but I can see that we might have to support (read: at least understand) it.

@tacman
Copy link
Author

tacman commented Jan 31, 2024

Please consider it, I'm working on an open-source app that allows searching packagist for Symfony bundles that meet certain criteria (like at least php 8.2 and Symfony at least 6.4 or 7.0). I can assure you that LOTS of packages use this format, and even the composer docs talk about it.

When you write a version constraint, it may reference a specific tag (e.g., 1.1) or it may reference a valid range of tags (e.g., >=1.1 <2.0, or ~4.0).

https://getcomposer.org/doc/articles/versions.md#tags

@tacman
Copy link
Author

tacman commented Feb 1, 2024

I agree with you on the problems. In fact, many bundles are returned as being compatible with Symfony 7 because the constrait is ">= 2.2". Terrible.

BUT many of the php constraints do work, even php >= 7.2 often works, where php ^7.2 fails with PHP 8, even if php 8 works. And getting authors of these old libraries to accept PRs is often difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants