-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
Update help
for python resolves with recent improvements
#15228
Update help
for python resolves with recent improvements
#15228
Conversation
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
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.
Hats off to @thejcannon for softwrap
. This was so much more enjoyable to edit than before.
@@ -85,77 +85,30 @@ class PythonSetup(Subsystem): | |||
), | |||
advanced=True, | |||
) | |||
requirement_constraints = FileOption( |
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.
Moved to lower in the file, so that they show up later in help. We don't want any newcomers using this.
python_sources( | ||
resolve=parametrize("data-science", "web-app"), | ||
) |
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.
@thejcannon I could not find our discussion from last week about this. Do you remember if this is right? No need for back ticks?
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 never verified, but according to Markdown it's code because it's indented. The console will just dump whatever.
So depends on if we care about the console
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.
There are examples for how readme treats this from the docker backend (indented block is code).
So depends on if we care about the console
What do you mean?
As you said, the console dumps whatever, so we don't have to "care about the console", just care about the experience the user has when reading this text on the console, which perhaps is what you meant? In which case I'm in favour of excluding the backticks to reduce the noise, on the console. (as the backticks does nothing for the markdown, when the block is also indented).
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.
pants/src/python/pants/backend/docker/subsystems/docker_options.py
Lines 39 to 53 in e8e22d5
help=softwrap( | |
""" | |
Configure Docker registries. The schema for a registry entry is as follows: | |
{ | |
"registry-alias": { | |
"address": "registry-domain:port", | |
"default": bool, | |
"extra_image_tags": [], | |
"skip_push": bool, | |
}, | |
... | |
} | |
If no registries are provided in a `docker_image` target, then all default |
https://www.pantsbuild.org/docs/reference-docker#section-registries
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.
@Eric-Arellano perhaps we want to record this doc nuance in the https://www.pantsbuild.org/docs/style-guide ? :)
Pants will error explaining the incompatibility. | ||
|
||
The keys must be defined as resolves in `[python].resolves`. | ||
""" | ||
), | ||
advanced=True, | ||
) | ||
no_binary = StrListOption( |
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.
Moved to lower in the file. We have a block of about 10 lockfile related options, and this was in the middle.
help=softwrap( | ||
""" | ||
When resolving third-party requirements for your own code (vs. tools you run), | ||
use this constraints file to determine which versions to use. | ||
|
||
Mutually exclusive with `[python].enable_resolves`, which we generally recommend as an | ||
improvement over constraints file, including due to less supply chain risk thanks to | ||
`--hash` support. | ||
|
||
See https://pip.pypa.io/en/stable/user_guide/#constraints-files for more | ||
information on the format of constraint files and how constraints are applied in | ||
Pex and pip. | ||
|
||
This only applies when resolving user requirements, rather than tools you run | ||
like Black and Pytest. To constrain tools, set `[tool].lockfile`, e.g. | ||
`[black].lockfile`. | ||
""" |
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.
This is all the same except for the second paragraph, which is copied from 2.10
default=True, | ||
help=softwrap( | ||
""" | ||
(Only relevant when using `[python].requirement_constraints.`) If enabled, when |
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.
This first sentence is new and from 2.10
"--no-binary", | ||
help=softwrap( | ||
""" | ||
Do not use binary packages (i.e., wheels) for these 3rdparty projects. |
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.
The text is the same, but I added paragraph breaks. I also re-worded the last paragraph to be more accurate and concise
"--only-binary", | ||
help=softwrap( | ||
""" | ||
Do not use source packages (i.e., sdists) for these 3rdparty projects. |
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.
Ditto. I added paragraph breaks and re-worded the last paragraph.
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.
Nice! Some phrasing and grammar comments.
lockfile/constraints file instead of just the relevant subset. This can improve | ||
lockfile file instead of just the relevant subset. | ||
|
||
We generally do not recommend this if `[python].lockfile_generator` is set to `"pex"` |
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.
Help should not usually appeal to history, so the whole performance enhancements story is more complicating than helpful. How about just:
"This yields better performance in some cases, but we generally do not recommend this if ..., as pex lockfiles have equivalent performance, and better cache utilization, in most cases."
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.
Help should not usually appeal to history
Good point. That book I've been reading on technical writing made the same point
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.
You've deleted the performance rationale for this option, so readers now have no clue why they might use this. There may still be perf benefits in some cases. We have not yet really proven that subsetting is now better in all cases. So some users may still need this option for performance, and we should mention that this is so. E.g., the phrasing I suggested above.
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 don't think I did? Read the next paragraph
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.
Oh I see, weird sequencing. You have to read through the arguments against using this option before you see any arguments for why you might want to try it. But It's probably fine.
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 still wouldn't reference "performance enhancements we've made". The reader won't have a baseline of what that means, i.e., performance of what compared to what.
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.
You have to read through the arguments against using this option before you see any arguments for why you might want to try it.
Yeah. Josh is pretty sure we will want to deprecate this once the dust settles. So I'm trying to discourage usage
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
lockfile/constraints file instead of just the relevant subset. This can improve | ||
lockfile file instead of just the relevant subset. | ||
|
||
We generally do not recommend this if `[python].lockfile_generator` is set to `"pex"` |
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.
Oh I see, weird sequencing. You have to read through the arguments against using this option before you see any arguments for why you might want to try it. But It's probably fine.
lockfile/constraints file instead of just the relevant subset. This can improve | ||
lockfile file instead of just the relevant subset. | ||
|
||
We generally do not recommend this if `[python].lockfile_generator` is set to `"pex"` |
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 still wouldn't reference "performance enhancements we've made". The reader won't have a baseline of what that means, i.e., performance of what compared to what.
This includes the changes from #14775, which were only applied to 2.10.
[ci skip-rust]
[ci skip-build-wheels]