Ocramius/PackageVersions

add composer 2.0 support

glensc opened this issue · 7 comments

with composer 2.0 the install is rejected:

$ composer install
The "ocramius/package-versions" plugin was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - ocramius/package-versions 1.4.0 requires composer-plugin-api ^1.0.0 -> no matching package found.
    - ocramius/package-versions 1.4.0 requires composer-plugin-api ^1.0.0 -> no matching package found.
    - Installation request for ocramius/package-versions 1.4.0 -> satisfiable by ocramius/package-versions[1.4.0].

to test:

git clone --depth=1 -b 2.0 https://github.com/composer/composer
(cd composer && composer install)
composer/bin/composer init -n
composer/bin/composer require ocramius/package-versions

That is correct: composer-plugin-api 1.0.0 is required.

so, no plans to support composer:2.0 anytime soon?

Once it's released, or at least once the composer-plugin-api is stable.

This problem applies to anything that is a plugin.

Hoi,
I'm getting this error when i try to update my application pakkages:

composer update
The "ocramius/package-versions" plugin was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- mezzio/mezzio-tooling[1.0.0, ..., 1.3.0] require ocramius/package-versions ^1.3 -> satisfiable by ocramius/package-versions[1.3.0, ..., 1.11.0].
- ocramius/package-versions[1.3.0, ..., 1.5.1] require composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
- ocramius/package-versions[1.6.0, ..., 1.9.0] require php ^7.4.0 -> your php version (7.3.25) does not satisfy that requirement.
- ocramius/package-versions[1.10.0, ..., 1.11.0] require php ^7.4.7 -> your php version (7.3.25) does not satisfy that requirement.
- Root composer.json requires mezzio/mezzio-tooling ^1.0 -> satisfiable by mezzio/mezzio-tooling[1.0.0, ..., 1.3.0].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

ocramius/package-versions only provides support for Composer 2 in 1.8+, which requires PHP 7.4.
If you can not upgrade PHP you can require composer/package-versions-deprecated to resolve this with PHP 7.0+.

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

Is there a plan to upgrade to version 2?

This package already supports composer/composer:^2 in its newer released, but you do indeed need to upgrade to PHP 7.4+ first, since PHP 7.3 support has been dropped well over a year ago.

@Ocramius I am using PHP 7.4.9 and composer 2.0.11 but i still get the same error?