Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

Support Composer 2 #89

Merged
merged 1 commit into from
May 10, 2021
Merged

Support Composer 2 #89

merged 1 commit into from
May 10, 2021

Conversation

kienstra
Copy link
Contributor

@kienstra kienstra commented May 8, 2021

  • Though this plugin will be archived, this PR might help in the meantime
  • Composer 1 is EOL
  • Someone mentioned that this plugin doesn't work with Composer 2:
\W $composer install        
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.
The "composer/installers" 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.
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - composer/installers is locked to version v1.7.0 and an update of this package was not requested.
    - composer/installers v1.7.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 2
    - dealerdirect/phpcodesniffer-composer-installer is locked to version v0.6.2 and an update of this package was not requested.
    - dealerdirect/phpcodesniffer-composer-installer v0.6.2 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.

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.
\W $b
  • It'd be nice if composer.lock was a smaller diff, but I couldn't figure out how to make it simpler

Testing Steps

  1. composer self-update --2
  2. This will ensure Composer is version 2
  3. composer install
  4. Expected: there's no error
  5. composer test
  6. Expected: tests pas
  7. composer lint
  8. Expected: linting passes

Previously, this only worked with Composer 1
Composer 1 has been essentially EOL
for months, so it'd be good to support 2.
https://blog.packagist.com/deprecating-composer-1-support/
@kienstra
Copy link
Contributor Author

kienstra commented May 10, 2021

Hi @derekherman and @kasparsd,
What do you think about this PR?

Even though this repo will be archived, this PR could prevent applicants from having to downgrade Composer with composer self-update --1

Thanks!

@kasparsd kasparsd merged commit 6f06108 into xwp:master May 10, 2021
@kasparsd
Copy link
Contributor

@kienstra Sounds good!

Do you have ideas what is causing this issue during Travis runs:

Fatal error: Uncaught SebastianBergmann\CodeCoverage\RuntimeException: XDEBUG_MODE=coverage or xdebug.mode=coverage has to be set in /home/travis/build/xwp/block-scaffolding-wp/vendor/phpunit/php-code-coverage/src/Driver/Xdebug.php on line 50

https://travis-ci.com/github/xwp/block-scaffolding-wp/builds/225499204

Could that be a major version upgrade for one of the dev dependencies?

kienstra added a commit to kienstra/block-scaffolding-wp-1 that referenced this pull request May 10, 2021
@kienstra
Copy link
Contributor Author

Hi @kasparsd,
Ah, good point.

Here's a PR to make Travis pass: #91

@kienstra kienstra deleted the update/composer-2 branch May 10, 2021 20:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants