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

[Sprint] Use f-strings instead .format() function on asv/commands/update.py #1179

Closed
LucyJimenez opened this issue Mar 18, 2022 · 2 comments
Closed

Comments

@LucyJimenez
Copy link
Contributor

xref #909

Since we support Python > 3.7 now, we can make use of f-strings, to make code more readable.

As an example, the next asv code:
machine_env_name = "{}/{}".format(machine, env_name)
or the next, which is equivalent:
machine_env_name = "{0}/{1}".format(machine, env_name)
Could be written as:
machine_env_name = f"{machine}/{env_name}"

(note the f before the string quotes)


The next command returns the list of strings to replace:

grep -R --exclude-dir="build" --exclude="*.css" ".format(" asv/commands/update.py

For this file, you will find the following issues to solve:

asv/commands/update.py:                        log.warning("{}: {}".format(path, err))
asv/commands/update.py:                                log.warning("{}: should be renamed to {}".format(path, new_path))
asv/commands/update.py:                        log.warning("{}: unrecognized file name".format(path))
@asnramos
Copy link
Contributor

xref #1079

@datapythonista
Copy link
Member

Not useful anymore, and add noise to the issues list.

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

No branches or pull requests

3 participants