wp-cli / scaffold-package-command

Scaffolds WP-CLI commands with functional tests, full README.md, and more.
MIT License
69 stars 20 forks source link

Can't create scaffold #182

Closed stampirl closed 3 years ago

stampirl commented 6 years ago

Hi. I'm trying to create new package with this command wp scaffold package 'moriacat/octo_importer' --skip-tests --skip-github --skip-readme but I keep getting error with dependencies. Output below.

Success: Created package files in /home/moriacat/.wp-cli/packages/local/moriacat/octo_importer
Installing package moriacat/octo_importer (dev-master)
Updating /home/moriacat/.wp-cli/packages/composer.json to require the package...
Registering /home/moriacat/.wp-cli/packages/local/moriacat/octo_importer as a path repository...
Updating package index repository url...
Using Composer to install the package...
---
Loading composer repositories with package information
Updating dependencies
Resolving dependencies through SAT

Dependency resolution completed in 0.121 seconds
Your requirements could not be resolved to an installable set of packages.
Problem 1
    - Installation request for moriacat/octo_importer dev-master -> satisfiable by moriacat/octo_importer[dev-master].
    - Conclusion: remove wp-cli/wp-cli 2.0.1
    - moriacat/octo_importer dev-master requires wp-cli/wp-cli ^1.1.0 -> satisfiable by wp-cli/wp-cli[v1.1.0, v1.2.0, v1.2.1, v1.3.0, v1.4.0, v1.4.1, v1.5.0, v1.5.1].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.1.0].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.2.0].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.2.1].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.3.0].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.4.0].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.4.1].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.5.0].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.5.1].
    - Installation request for wp-cli/wp-cli 2.0.1 -> satisfiable by wp-cli/wp-cli[2.0.1].
Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.
---
Error: Package installation failed (Composer return code 2).
Reverted composer.json.

This is on Fedora 28 with PHP 7.2 and latest wp-cli 2.0.1.

schlessera commented 6 years ago

The wp-cli/scaffold-package-command has not been completely moved over to v2 yet: https://github.com/wp-cli/scaffold-package-command/issues/180

I've been working on that and I am almost through. I want to have it completed for v2.1.0 which is due first week of November.

If you need scaffolding functionality earlier, you can briefly rollback to an older version just for the scaffold for now.

stampirl commented 6 years ago

Thanks for help 😁 I'll rollback.

brenoalvs commented 5 years ago

@schlessera @Geek-Daddy as workaround for this, you can set the flag --require_wp_cli pointing to your current WP-CLI version.

e.g.: wp scaffold package your-package-name --require_wp_cli=2.1.0

I think this problem is related to the default value set for this flag: ^1.1.0 This version constraint doesn't match 2.x versions.

https://github.com/wp-cli/scaffold-package-command/blob/master/src/ScaffoldPackageCommand.php#L47

schlessera commented 3 years ago

This should be working as expected again now.