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

[RFC] Help fade out "composer/package-versions-deprecated" #44726

Closed
nicolas-grekas opened this issue Dec 20, 2021 · 7 comments
Closed

[RFC] Help fade out "composer/package-versions-deprecated" #44726

nicolas-grekas opened this issue Dec 20, 2021 · 7 comments
Labels
RFC RFC = Request For Comments (proposals about features that you want to be discussed)

Comments

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Dec 20, 2021

Discussed with @Seldaek on Slack: it'd be great if we could help fade out this package by not requiring it in either symfony/* or doctrine/*. Instead, we should use the API provided by Composer 2.

Let's start from the most downloaded packages as listed here:
https://packagist.org/packages/composer/package-versions-deprecated/dependents?order_by=downloads&requires=require

@carsonbot carsonbot added the RFC RFC = Request For Comments (proposals about features that you want to be discussed) label Dec 20, 2021
@stof
Copy link
Member

stof commented Dec 20, 2021

Given that Symfony 6 requires composer 2, we can use the native API in our own packages

@stof
Copy link
Member

stof commented Dec 20, 2021

For doctrine pacjages, this should be discussed with the doctrine team though

@derrabus
Copy link
Member

Doctrine DBAL 3.3 will require Composer 2 and drop the dependency: doctrine/dbal#5078

@stof
Copy link
Member

stof commented Dec 20, 2021

OK, then I guess it is fine for other Doctrine projects to do the same kind of change

@nicolas-grekas I updated the packagist URL to list only packages having a require constraint. require-dev are much less impactful for the ecosystem

@stof
Copy link
Member

stof commented Dec 22, 2021

Symfony packages are using it for 2 purposes:

  • symfony/proxy-manager-bridge is requiring it, but without using it anymore since 4.4.17. So I opened a PR removing the dependency
  • symfony/orm-pack requires it (and symfony/doctrine-bridge as a dev-requirement on it) due to the usage of ocramius/package-versions in older versions of the Doctrine packages. However, doctrine/orm 2.7.4+ is using composer/package-versions-deprecated directly instead of ocramius/package-versions, so I think we could drop our own requirement enforcing the replacer package. symfony/doctrine-bridge currently requires doctrine/orm 2.7.3+. Bumping the min version to 2.7.4 instead of 2.7.3 is OK for that (and once the ORM migrates to composer-runtime-api directly, the usage will be gone entirely).

nicolas-grekas added a commit that referenced this issue Dec 22, 2021
…poser/package-versions-deprecated (stof)

This PR was merged into the 4.4 branch.

Discussion
----------

[ProxyManagerBridge] Remove the unused dependency on composer/package-versions-deprecated

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes/no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | -
| License       | MIT
| Doc PR        | n/a

The ProxyManagerBridge depends on friendsofphp/proxy-manager-lts which has an optional dependency on the PackageVersions class to implement the `ProxyManager\Version::getVersion` method on composer 1 (with a fallback to a less precise version number).
However, the bridge has stopped using that API in favor of feature detection (in #39017), so the dependency is unused.

This contributes to #44726

Commits
-------

6ca8e30 Remove the unused dependency on composer/package-versions-deprecated
nicolas-grekas added a commit that referenced this issue Dec 25, 2021
…precated (stof)

This PR was merged into the 5.3 branch.

Discussion
----------

Remove direct dependency on composer/package-versions-deprecated

| Q             | A
| ------------- | ---
| Branch?       | 5.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

This dependency in the doctrine-bridge was added to enforce the replacement of the ocramius/package-versions package used by the ORM, to keep support for PHP versions we needed. But as of 2.7.4, the ORM switched its dependency, so this is not necessary anymore.

This contributes to #44726

Commits
-------

c106a6b Remove direct dependency on composer/package-versions-deprecated
@derrabus
Copy link
Member

doctrine/orm#9356

@nicolas-grekas
Copy link
Member Author

I think we can close here, thank you all for the help!

javiereguiluz added a commit to symfony/demo that referenced this issue Jan 14, 2022
…ated (stof)

This PR was merged into the main branch.

Discussion
----------

Remove the dependency on composer/package-versions-deprecated

This package was added in the past to force keeping support for composer 1 when using doctrine/orm. In the meantime, doctrine/orm has switched to using that package directly, making this root requirement useless. And in the next releases of doctrine/orm and doctrine/dbal, they are migrating to use composer-runtime-api (dropping support for composer 1) instead of using this plugin, as part of the effort to fade out that compat plugin.

Refs symfony/symfony#44726

The package is still present for now (and so still needed in the list of allowed plugins too) because doctrine packages require it. But this will change in their next releases for DBAL, ORM and Migrations (the PRs are already merged)

Commits
-------

f12bb2c Remove the dependency on composer/package-versions-deprecated
sayjun0505 added a commit to sayjun0505/sym_proj that referenced this issue Apr 16, 2023
…ated (stof)

This PR was merged into the main branch.

Discussion
----------

Remove the dependency on composer/package-versions-deprecated

This package was added in the past to force keeping support for composer 1 when using doctrine/orm. In the meantime, doctrine/orm has switched to using that package directly, making this root requirement useless. And in the next releases of doctrine/orm and doctrine/dbal, they are migrating to use composer-runtime-api (dropping support for composer 1) instead of using this plugin, as part of the effort to fade out that compat plugin.

Refs symfony/symfony#44726

The package is still present for now (and so still needed in the list of allowed plugins too) because doctrine packages require it. But this will change in their next releases for DBAL, ORM and Migrations (the PRs are already merged)

Commits
-------

f12bb2c Remove the dependency on composer/package-versions-deprecated
mwhorse46 added a commit to mwhorse46/sym_proj that referenced this issue Apr 16, 2023
…ated (stof)

This PR was merged into the main branch.

Discussion
----------

Remove the dependency on composer/package-versions-deprecated

This package was added in the past to force keeping support for composer 1 when using doctrine/orm. In the meantime, doctrine/orm has switched to using that package directly, making this root requirement useless. And in the next releases of doctrine/orm and doctrine/dbal, they are migrating to use composer-runtime-api (dropping support for composer 1) instead of using this plugin, as part of the effort to fade out that compat plugin.

Refs symfony/symfony#44726

The package is still present for now (and so still needed in the list of allowed plugins too) because doctrine packages require it. But this will change in their next releases for DBAL, ORM and Migrations (the PRs are already merged)

Commits
-------

f12bb2c Remove the dependency on composer/package-versions-deprecated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC RFC = Request For Comments (proposals about features that you want to be discussed)
Projects
None yet
Development

No branches or pull requests

4 participants