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

Graduate Docker backend from experimental status. #14310

Merged
merged 2 commits into from Jan 29, 2022

Conversation

kaos
Copy link
Member

@kaos kaos commented Jan 29, 2022

The Docker backend was introduced in Pantsbuild 2.7.0. It is now proven to be a functional backend for many common Docker use cases.

Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woohoo!!! Epic

We can provide a much nicer upgrade experience for users by still keeping the experimental backend in 2.10. You'll have a register.py in both the old place and new one. (If DRY bothers you, you can import from the new stable file)

There is probably a more elegant way to do this, but you can then add a function similar to this, and call it at the two call sites

def maybe_warn_python_macros_deprecation(bootstrap_options: OptionValueContainer) -> None:
if (
bootstrap_options.is_default("use_deprecated_python_macros")
and "pants.backend.python" in bootstrap_options.backend_packages
):
warn_or_error(
"2.11.0.dev0",

I plan to possibly stabilize PyUpgrade & Autoflake, so I'll piggy back off of this helper.

There is probably a more elegant way to do this

Imo, quick and dirty gets the job done here. It's temporary code and this isn't used by plugin authors. End users don't care how we implement the deprecation.

@Eric-Arellano
Copy link
Contributor

Oh! Also init/BUILD and generate_docs.py need updates :)

@kaos
Copy link
Member Author

kaos commented Jan 29, 2022

Oh! Also init/BUILD and generate_docs.py need updates :)

Eh, look again ;)

[ci skip-rust]

[ci skip-build-wheels]
@kaos
Copy link
Member Author

kaos commented Jan 29, 2022

I didn't see the need for a custom deprecation method, I simply used the @deprecated on the rules in the experimental register module.

Gives me:

22:21:15.20 [WARN] DEPRECATED: pants.backend.experimental.docker.register.rules() will be removed in version 2.11.0.dev0.

The `pants.backend.experimental.docker` backend has graduated. Use `pants.backend.docker` instead.

When used :)

@kaos kaos mentioned this pull request Jan 29, 2022
@Eric-Arellano
Copy link
Contributor

Oh cool! Perfect.

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]
@kaos kaos enabled auto-merge (squash) January 29, 2022 22:08
@kaos kaos merged commit e7e0301 into pantsbuild:main Jan 29, 2022
@kaos kaos deleted the graduate_docker branch January 29, 2022 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants