Repository navigation
chore: use fstrings - #4794
chore: use fstrings#4794
Conversation
neersighted
left a comment
There was a problem hiding this comment.
Side note: would love to see commands.debug.info and commands.env.info refactored to use Cleo's Table instead of the ad-hoc alignment they have going on right now (as future work, not in this PR).
| version = Version.parse(".".join(str(c) for c in sys.version_info[:3])) | ||
| poetry.package.python_versions = "^{}".format( | ||
| ".".join(str(c) for c in sys.version_info[:3]) | ||
| poetry.package.python_versions = "^" + ".".join( |
| version = Version.parse(".".join(str(c) for c in sys.version_info[:3])) | ||
| poetry.package.python_versions = "~{}".format( | ||
| ".".join(str(c) for c in (version.major, version.minor - 1, 0)) | ||
| poetry.package.python_versions = "~" + ".".join( |
There was a problem hiding this comment.
Above? This one is a little different but maybe still doable.
|
@branchvincent Sorry about the blockbuster review! There's a lot of churn here and it's important to both make sure our changes are beneficial as well as address any low-hanging code-quality fruit we discover. Thanks for bearing with me! |
|
Hey @branchvincent, just wanted to see if you were close to finishing this -- given the amount of churn, conflicts will build up quickly. If not I can easily pick up the torch, and we can also discuss merging without some of my proposed refactors if you're blocked on those. |
|
thanks for the ping @neersighted, i've rebased / pushed my latest changes. the only thing i had left to address was the version specifier helper (see my reply #4794 (comment)). i'm 👍 to merge this and address that in a follow up |
| @@ -256,7 +242,7 @@ def and_to_string( | |||
| if this_line is not None: | |||
| buffer.append(" " + str(this_line)) | |||
There was a problem hiding this comment.
I think we might as well turn these in to f-strings (with !s) for consistency.
| buffer.append(f" and {other!s}") | ||
|
|
||
| if other_line is not None: | ||
| buffer.append(" " + str(other_line)) |
|
|
||
| venv_name = manager.generate_env_name("simple-project", str(poetry.file.parent)) | ||
| version = Version.parse(".".join(str(c) for c in sys.version_info[:3])) | ||
| version = Version.from_parts(*sys.version_info[:3]) |
There was a problem hiding this comment.
Awesome change! This pattern is really common and I'd like to see us replace it more generally.
|
Kudos, SonarCloud Quality Gate passed!
|
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |








Pull Request Check List
Towards #4776