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

How can I bypass the module’s composer requirements? #22

Open
emircanerkul opened this issue Oct 19, 2023 · 7 comments
Open

How can I bypass the module’s composer requirements? #22

emircanerkul opened this issue Oct 19, 2023 · 7 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@emircanerkul
Copy link

Even after I added drupal/commerce_country_store to drupal-lenient allowed-list, it still gives,

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - drupal/commerce_country_store dev-1.x requires drupal/geoip ~2.0 -> found drupal/geoip[dev-2.x, 2.0.0-beta1, 2.x-dev (alias of dev-2.x)] but it conflicts with your root composer.json require (3.0.x-dev@dev).

The module's composer.json

{
    "name": "drupal/commerce_country_store",
    "type": "drupal-module",
    "description": "Enable having one store per country in Drupal Commerce",
    "homepage": "http://drupal.org/project/commerce_country_store",
    "license": "GPL-2.0+",
    "authors": [
        {
            "name": "Florian Loretan",
            "email": "[email protected]"
        }
    ],
    "require": {
        "drupal/commerce": "~2.0",
        "drupal/geoip": "~2.0"
    }
}

I'll continue with the custom repo but if this lenient extension would be capable of bypassing these too, that would be great @mglaman but I still use yours because it just works fine and is great with the Drupal modules' version dependencies.

@sdubois
Copy link

sdubois commented Oct 27, 2023

I am not sure if this will help in your case, but I was able to work around a similar sounding issue by using an inline alias

https://getcomposer.org/doc/articles/aliases.md#require-inline-alias

Specifically I used

"drupal/jquery_ui_accordion": "2.0 as 1.1"

which let me install drupal/accordion_menus

@emircanerkul
Copy link
Author

Yes that workaround fixes but it would be good without any workaround.

@mglaman
Copy link
Owner

mglaman commented Oct 27, 2023

Look at your errors. Has nothing to do with this package.

Your root package requires geoip 3 and the other module requires 2.

This package is only for Drupal core.

@emircanerkul
Copy link
Author

I see @mglaman I just feature requested. Or do you know a similar package for that purpose to bypass composer requirements too?

@mglaman mglaman added the enhancement New feature or request label Oct 27, 2023
@mglaman
Copy link
Owner

mglaman commented Oct 27, 2023

Oh, sorry. I thought this was a bug report. I would be afraid to extend this package that way. Especially since Composer does have a workaround as commented.

@mglaman mglaman added the documentation Improvements or additions to documentation label Nov 22, 2023
@hanoii
Copy link

hanoii commented Jan 17, 2024

I actually would like, if it's possible, to reconsider using such a plugin for modules as well.

My current situation:

I know I could make "drupal/inline_entity_form": "3.0.0-rc19 as 1.0", which I am doing, however this means that I have to manually edit the alias each time a new version for inline_entity_form appears and makes everything counterintuitive.

So such a feature would definitely be welcome for such cases and others.

@mglaman
Copy link
Owner

mglaman commented Jan 19, 2024

I won't close this, but I won't set aside time to work on it. I'll welcome the idea if someone puts up a pull request. However, it's bending the purpose of this plugin. The purpose is for drupal/core leniency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants