Ich entwickle eine Paketbibliothek, die regelmäßige Abhängigkeiten und eine Dev-Abhängigkeit hat. Composer recommends to not include the composer.lock
file for libraries, so ist hier die composer.json
Warum Composer installieren --no-dev funktioniert nicht?
{
"name": "myself/mypackage",
"require": {
"php": ">=5.6",
"nesbot/carbon": "~1.20"
},
"require-dev": {
"phpunit/phpunit": "^6.0"
}
}
ich dies für andere Anwendungen eingesetzt werden kompatibel sein wollen mit PHP 5.6, und ich will, es entwickeln die neuesten PHPUnit-Test-Tools verwenden, die PHP benötigen 7.
On die travis kontinuierlichen Integration Testserver, habe ich eine Build-Matrix, die die PHPUnit Tests an PHP> 7 und ein Fusseln Skript ausführt:
composer install
./lint-php.bash
phpunit
und auf PHP < 7, einfach den Quellcode Fussel:
composer install --no-dev
./lint-php.bash
schlägt jedoch fehl, weil es die --no-dev
Flagge ignoriert und versucht trotzdem die Entwickler Abhängigkeit zu installieren.
Your requirements could not be resolved to an installable set of packages. Problem 1 - phpunit/phpunit 6.0.7 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - phpunit/phpunit 6.0.6 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - phpunit/phpunit 6.0.5 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - phpunit/phpunit 6.0.4 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - phpunit/phpunit 6.0.3 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - phpunit/phpunit 6.0.2 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - phpunit/phpunit 6.0.1 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - phpunit/phpunit 6.0.0 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - Installation request for phpunit/phpunit ^6.0 -> satisfiable by phpunit/phpunit[6.0.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7].
Warum ignoriert er die --no-dev
Flagge? Ich will nur, dass es meine regulären Abhängigkeiten installiert und den Abschnitt require-dev
ignoriert.