-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Community App Store (Sourcery refactored) #162
Conversation
"Found --process-dependency-links flag, version {} doesn't need that yet though, removing.".format( | ||
pip_version | ||
) | ||
f"Found --process-dependency-links flag, version {pip_version} doesn't need that yet though, removing." | ||
) | ||
|
||
args.remove("--process-dependency-links") | ||
|
||
# strip --no-cache-dir for versions that don't support it | ||
if pip_version not in cls.no_cache_dir and "--no-cache-dir" in args: | ||
logger.debug( | ||
"Found --no-cache-dir flag, version {} doesn't support that yet though, removing.".format( | ||
pip_version | ||
) | ||
f"Found --no-cache-dir flag, version {pip_version} doesn't support that yet though, removing." | ||
) | ||
|
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.
Function PipCaller.clean_install_command
refactored with the following changes:
- Replace call to format with f-string. (
use-fstring-for-formatting
)
"Cannot use this pip install, can't write to the install dir and also can't use " | ||
"--user for installing. Check your setup and the permissions on {}.".format( | ||
pip_install_dir | ||
) | ||
f"Cannot use this pip install, can't write to the install dir and also can't use --user for installing. Check your setup and the permissions on {pip_install_dir}." | ||
) | ||
|
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.
Function PipCaller._setup_pip
refactored with the following changes:
- Replace call to format with f-string. (
use-fstring-for-formatting
)
'Using "{}" as command to invoke pip'.format(" ".join(command)) | ||
f'Using "{" ".join(command)}" as command to invoke pip' | ||
) | ||
|
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.
Function PipCaller.autodetect_pip
refactored with the following changes:
- Replace call to format with f-string. (
use-fstring-for-formatting
)
if isinstance(pip_command, list): | ||
sarge_command = pip_command | ||
else: | ||
sarge_command = [pip_command] | ||
sarge_command = pip_command if isinstance(pip_command, list) else [pip_command] |
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.
Function PipCaller.to_sarge_command
refactored with the following changes:
- Replace if statement with if expression (
assign-if-exp
)
"Using cached pip version information for {}".format( | ||
pip_command_str | ||
) | ||
f"Using cached pip version information for {pip_command_str}" | ||
) | ||
|
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.
Function PipCaller._get_pip_version
refactored with the following changes:
- Replace call to format with f-string. (
use-fstring-for-formatting
)
conreq/_core/app_store/utils/pip.py
Outdated
self._logger.debug( | ||
"Using cached pip setup information for {}".format(pip_command_str) | ||
) | ||
self._logger.debug(f"Using cached pip setup information for {pip_command_str}") |
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.
Function PipCaller._check_pip_setup
refactored with the following changes:
- Replace call to format with f-string. (
use-fstring-for-formatting
) - Replace dict.get(x, None) with dict.get(x) (
remove-none-from-default-get
)
"pip installs to {} (writable -> {}), --user flag needed -> {}, " | ||
"virtual env -> {}".format( | ||
install_dir, | ||
"yes" if writable else "no", | ||
"yes" if user_flag else "no", | ||
"yes" if virtual_env else "no", | ||
) | ||
f'pip installs to {install_dir} (writable -> {"yes" if writable else "no"}), --user flag needed -> {"yes" if user_flag else "no"}, virtual env -> {"yes" if virtual_env else "no"}' | ||
) | ||
self._logger.info("==> pip ok -> {}".format("yes" if ok else "NO!")) | ||
|
||
self._logger.info(f'==> pip ok -> {"yes" if ok else "NO!"}') |
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.
Function LocalPipCaller._check_pip_setup
refactored with the following changes:
- Replace call to format with f-string. (
use-fstring-for-formatting
)
67c187d
to
7abd52b
Compare
for more information, see https://pre-commit.ci
Pull Request #69 refactored by Sourcery.
If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
app_store
branch, then run:Help us improve this pull request!