-
Notifications
You must be signed in to change notification settings - Fork 13
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
Composer 2.0 compatibility #45
Conversation
This might not work on all PHP versions.
command: | | ||
CHANGED_FILES="$( git diff HEAD^ HEAD --name-only --diff-filter=ACMRT << parameters.directories >> )" | ||
if [ -z "$CHANGED_FILES" ] && [ -z "$CIRCLE_TAG" ]; then echo "No change to relevant file, exiting job" && circleci-agent step halt; fi | ||
- run: sudo apt-get update && sudo apt-get install libkrb5-dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
composer require --dev phpunit/phpunit 5.7.9 | ||
WP_TESTS_DIR=~/project/wordpress-develop/tests/phpunit ./vendor/bin/phpunit | ||
|
||
js-tests: | ||
executor: php | ||
steps: | ||
- checkout | ||
- conditionally-skip: | ||
directories: js tests/js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ported from https://github.com/studiopress/genesis-custom-blocks/pull/41/files#r517919253. That was merged into the editor feature branch.
These were deleted in the editor feature branch, as the editor is under development. But they should not be deleted here.
@@ -9,7 +9,7 @@ | |||
}, | |||
"require-dev": { | |||
"brain/monkey": "2.4.0", | |||
"dealerdirect/phpcodesniffer-composer-installer": "0.5.0", | |||
"dealerdirect/phpcodesniffer-composer-installer": "0.7.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main change that allows Composer 2.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does your comment mean that version 0.5.0 of this package was failing with composer 2.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think 0.5.0
caused this message:
$ git checkout develop
$ composer self-update --2 # If needed, changes Composer to 2.*
$ composer install
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
- dealerdirect/phpcodesniffer-composer-installer is locked to version v0.5.0 and an update of this package was not requested.
- dealerdirect/phpcodesniffer-composer-installer v0.5.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
Hi @markkelnar and @mindctrl, Probably no need for functional testing of the plugin, this only touches development files. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thanks, @markkelnar! |
GCB should work with Composer 2.0, it's bad if you have to revert to an outdated
1.*
Composer version to use it.Changes
composer install
now works locally with Composer1.*
and2.*
Testing instructions
composer self-update --2
# update Composer to 2.* if it's not there alreadycomposer install
npm run lint:php
composer self-update --rollback
# go back to the Composer version before you did step 1