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

Compatibility with Composer 2 #23

Open
prudloff-insite opened this issue Jun 29, 2020 · 15 comments
Open

Compatibility with Composer 2 #23

prudloff-insite opened this issue Jun 29, 2020 · 15 comments

Comments

@prudloff-insite
Copy link

This plugin is currently not compatible with Composer 2:

The "drupal/console-extend-plugin" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0").

Here is what needs to be changed: https://github.com/composer/composer/blob/2.0.0-alpha1/UPGRADE-2.0.md#for-integrators-and-plugin-authors

@Eduardo-Morales-Alberti

Same error here.

@pefferen
Copy link

Since the release of Composer 2.x this issue is (about to be) breaking in many projects. The related PR seems pretty decent. Would love to see it merged in this package.

@atarim-info
Copy link

Getting the following error:

$ composer update --no-plugins

DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- drupal/console-extend-plugin[0.9.0, ..., 0.9.4] require composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
- Root composer.json requires drupal/console-extend-plugin ^0.9 -> satisfiable by drupal/console-extend-plugin[0.9.0, ..., 0.9.4].

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.

@ossobuffo
Copy link
Contributor

@atarim-info I found I had to do the following little three-step dance:

  1. rm composer.lock
  2. composer update --no-plugins
  3. composer update

@atarim-info
Copy link

@atarim-info I found I had to do the following little three-step dance:

1. rm composer.lock

2. composer update --no-plugins

3. composer update

Sorry, that doesn't work:
$ composer update --no-plugins

DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- drupal/console-extend-plugin[0.9.0, ..., 0.9.4] require composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
- Root composer.json requires drupal/console-extend-plugin ^0.9 -> satisfiable by drupal/console-extend-plugin[0.9.0, ..., 0.9.4].

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.

$ composer update
The "plesk/composer-command-info" plugin was skipped because it requires a Plugin API version ("^1.1") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.

DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- drupal/console-extend-plugin[0.9.0, ..., 0.9.4] require composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
- Root composer.json requires drupal/console-extend-plugin ^0.9 -> satisfiable by drupal/console-extend-plugin[0.9.0, ..., 0.9.4].

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.
- Root composer.json requires drupal/console-extend-plugin ^0.9 -> satisfiable by drupal/console-extend-plugin[0.9.0, ..., 0.9.4].

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.

@steinmb
Copy link

steinmb commented Oct 28, 2020

Same here. Non of the steps above works. I also tried to nuke everything;

  1. rm composer.*
  2. rm -fr vendor
  3. composer require 'drush/drush:^8.0'

still get:

The "drupal/console-extend-plugin" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "dealerdirect/phpcodesniffer-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.

Drush do start though without any warnings

drush --version

Drush Version   :  8.4.5

@pefferen
Copy link

@steinmb those packages are not a dependency of Drush.
Possibly the packages are locked by some other dependency(or directly) in your projects composer.json. The latest version of 'dealerdirect/phpcodesniffer-composer-installer' is compatible with Composer 2.x

@steinmb
Copy link

steinmb commented Oct 28, 2020

Thank you for your swift reply.
My composer.json only have one requirement:

"require": {
        "drush/drush": "^8.0"
}

composer show drupal/console-extend-plugin --all

name     : drupal/console-extend-plugin
descrip. : Drupal Console Extend Plugin
keywords :
versions : dev-master, 0.9.4, 0.9.3, 0.9.2, 0.9.1, 0.9.0, 0.8.0, 0.7.0, 0.6.0, 0.5.0, 0.4.0, 0.3.0, 0.2.0, 0.1.0, dev-add-composer-lock-gitignore, dev-feature/D9-support, dev-rename-cache-service-file
type     : composer-plugin
license  : GNU General Public License v2.0 or later (GPL-2.0+) (OSI approved) https://spdx.org/licenses/GPL-2.0+.html#licenseText
homepage :
source   : [git] https://github.com/hechoendrupal/drupal-console-extend-plugin.git a8cf84eaa61cf60e9cebfe131073d7628550625a
dist     : [zip] https://api.github.com/repos/hechoendrupal/drupal-console-extend-plugin/zipball/a8cf84eaa61cf60e9cebfe131073d7628550625a a8cf84eaa61cf60e9cebfe131073d7628550625a
names    : drupal/console-extend-plugin

autoload
psr-4
Drupal\Console\Composer\Plugin\ => src

requires
composer-plugin-api ^1.0
composer/installers ^1.2
symfony/yaml ~3.0|^4.4
symfony/finder ~3.0|^4.4

@steinmb
Copy link

steinmb commented Oct 28, 2020

Or perhaps this is more relevant?

composer show drush/drush

name     : drush/drush
descrip. : Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.
keywords :
versions : * 8.4.5
type     : library
license  : GNU General Public License v2.0 or later (GPL-2.0-or-later) (OSI approved) https://spdx.org/licenses/GPL-2.0-or-later.html#licenseText
homepage : http://www.drush.org
source   : [git] https://github.com/drush-ops/drush.git 29ab4fc41e6b516abc34b8dc477b3039fb5c0e96
dist     : [zip] https://api.github.com/repos/drush-ops/drush/zipball/29ab4fc41e6b516abc34b8dc477b3039fb5c0e96 29ab4fc41e6b516abc34b8dc477b3039fb5c0e96
path     : /Users/steinmb/sites/elmcip.net/vendor/drush/drush
names    : drush/drush

support
forum : http://drupal.stackexchange.com/questions/tagged/drush
irc : irc://irc.freenode.org/drush
issues : https://github.com/drush-ops/drush/issues
source : https://github.com/drush-ops/drush/tree/8.4.5

autoload
psr-0
Drush\ => lib/
Consolidation\ => lib/
psr-4
Drush\ => src/

requires
consolidation/annotated-command ^2.12.0
consolidation/output-formatters ~3
pear/console_table ~1.3.1
php >=5.4.5
psr/log ~1.0
psy/psysh ~0.6
symfony/console ~2.7|^3|^4.4
symfony/event-dispatcher ~2.7|^3|^4.4
symfony/finder ~2.7|^3|^4.4
symfony/process ~2.7|^3|^4.4
symfony/var-dumper ~2.7|^3|^4.4|^5
symfony/yaml ~2.3|^3|^4.4
webflo/drupal-finder ^1.1.0
webmozart/path-util ~2

requires (dev)
phpunit/phpunit 4.*
symfony/console ~2.7
symfony/event-dispatcher ~2.7
symfony/finder ~2.7
symfony/process 2.7.*
symfony/var-dumper ~2.7
symfony/yaml ~2.3

suggests
drush/config-extra Provides configuration workflow commands, such as config-merge.
ext-pcntl *

@ossobuffo
Copy link
Contributor

ossobuffo commented Oct 28, 2020

@atarim-info : The following composer.json file works for me:

{
    "require": {
        "drush/drush": "^8.0",
	"drupal/console-extend-plugin": "dev-master"
    },
    "repositories": [
        {
    	    "type": "vcs",
	    "url": "https://github.com/ossobuffo/drupal-console-extend-plugin.git"
        }
    ]
}

I can do a composer install using Composer 2 with no conflicts. Note that I am pulling drupal/console-extend-plugin from my own repo because the latter's own composer.json must be updated to declare that it is compatible with Composer's v2 API. (Once this PR is merged, this magic will no longer be necessary.)

@ElijahLynn
Copy link

(Once this PR is merged, this magic will no longer be necessary.)

Adding link #25.

@phox4ever
Copy link

phox4ever commented Nov 2, 2020

I also needed to add an inline alias to get @ossobuffo's magic to work temporarily with drupal/console:
"drupal/console-extend-plugin": "dev-master as 0.9.4"

@natts1
Copy link

natts1 commented Nov 22, 2020

When will this project be updated for Composer 2 compatibility? Instructions are here

@ChrisScrumping
Copy link

I also had to add to temp fix as per Phox4ever to get this working for durpal console

@BrianGilbert
Copy link

Works with Composer 2 as of 0.9.5 tag that @jmolivas rolled today

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