-
-
Notifications
You must be signed in to change notification settings - Fork 746
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
Enable pantsbuild language backends #5725
Conversation
d6796bd
to
5fb61e5
Compare
pants.toml
Outdated
backend_packages = [ | ||
# python | ||
"pants.backend.python", | ||
"pants.backend.experimental.python", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see experimental.python in list of pants backends on here: https://www.pantsbuild.org/docs/enabling-backends, why is experimental.python needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I left a comment. This enables support for the python publish goal (./pants publish
) and the twine subsystem. The publish goal uses twine to publish wheels to pypi.
relevant docs are not linked in the sidebar because they are in the experimental backend.
https://www.pantsbuild.org/docs/python-publish-goal
https://www.pantsbuild.org/docs/reference-twine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok apart from would like to see clarification on the experimental.python backend.
5fb61e5
to
106cea7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks for update on twine
https://www.pantsbuild.org/docs/initial-configuration\#enable-backends This does not add any lint/fmt/etc backends, just the language-specific ones. The experimental.python backend is required for twine support. Twine is used to publish wheels to pypi.
106cea7
to
21e2480
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Background
This is part 3 of introducing
pants
, as discussed in the TSC Meetings on 12 July 2022, 02 Aug 2022 and 06 Sept 2022. Pants has fine-grained per-file caching of results for lint, fmt (like black), test, etc. It also has lockfiles that work well for monorepos that have multiple python packages. With these lockfiles CI should not break when any of our dependencies or our transitive dependencies release new versions, because CI will continue to use the locked version until we explicitly relock with updates.To keep PRs as manageable/reviewable as possible, introducing pants will take a series of PRs. I do not know yet how many PRs; I will break this up into logical steps with these goals:
pants
to the st2 repo, andpants
step-by-step.Other pants PRs include:
Overview of this PR
This PR enables language-specific backends for pants. This is step 3 in the initial configuration document:
https://www.pantsbuild.org/docs/initial-configuration#enable-backends
The next PR will do step 5 in the initial configuration document. It will be generated by running some automation to add metadata across the repo. This PR is the manual configuration that has to be done before we can run that process.
This does not add any lint/fmt/etc backends, just the language-specific ones. That will happen in PRs after we have added metadata across the repo.
pants.toml
config filehttps://www.pantsbuild.org/docs/initial-configuration#create-pantstoml
Many important things get configured in the
pants.toml
config file, but this PR only configures[GLOBAL].backend_packages
.[GLOBAL].backend_packages
The pants docs describe
[GLOBLA].backend_packages
as follows:https://www.pantsbuild.org/docs/enabling-backends
So, this is how we opt-in to different funcitonality. In this PR, we tell pants that we have python and shell files in this repo. We'll add other backends (like flake8 and black) in follow-up PRs.
Things you can do with pantsbuild
This PR does not wire up any lockfiles, formatters, linters, etc, yet.
After this PR pants has more targets (metadata about a subset of code) and goals (like
count-loc
orroots
from the previous PRs).To explore this, use the
./pants help
system (which is extremely helpful!).Before this PR
After this PR