-
Notifications
You must be signed in to change notification settings - Fork 2.4k
fix: allow to set data-dir and python-installation-dir
#10595
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
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR updates the ConfigCommand to recognize and normalize two previously unsupported installer-related settings by extending the unique_config_values map. Class diagram for updated ConfigCommand unique_config_valuesclassDiagram
class ConfigCommand {
+unique_config_values() dict[str, tuple[Any, Any]]
}
class boolean_validator
class boolean_normalizer
class Path
ConfigCommand --> boolean_validator
ConfigCommand --> boolean_normalizer
ConfigCommand --> Path
%% Highlight new/modified config keys
class cache_dir {
+type: str
+normalizer: lambda val: str(Path(val))
}
class data_dir {
+type: str
+normalizer: lambda val: str(Path(val))
}
class python_installation_dir {
+type: str
+normalizer: lambda val: str(Path(val))
}
ConfigCommand --> cache_dir
ConfigCommand --> data_dir
ConfigCommand --> python_installation_dir
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src/poetry/console/commands/config.py:77` </location>
<code_context>
@property
def unique_config_values(self) -> dict[str, tuple[Any, Any]]:
unique_config_values = {
"cache-dir": (str, lambda val: str(Path(val))),
"data-dir": (str, lambda val: str(Path(val))),
"virtualenvs.create": (boolean_validator, boolean_normalizer),
"virtualenvs.in-project": (boolean_validator, boolean_normalizer),
"virtualenvs.options.always-copy": (boolean_validator, boolean_normalizer),
"virtualenvs.options.system-site-packages": (
boolean_validator,
boolean_normalizer,
),
"virtualenvs.options.no-pip": (boolean_validator, boolean_normalizer),
"virtualenvs.path": (str, lambda val: str(Path(val))),
"virtualenvs.use-poetry-python": (boolean_validator, boolean_normalizer),
"virtualenvs.prompt": (str, str),
"system-git-client": (boolean_validator, boolean_normalizer),
"requests.max-retries": (lambda val: int(val) >= 0, int_normalizer),
"installer.re-resolve": (boolean_validator, boolean_normalizer),
"installer.parallel": (boolean_validator, boolean_normalizer),
"installer.max-workers": (lambda val: int(val) > 0, int_normalizer),
"installer.no-binary": (
PackageFilterPolicy.validator,
PackageFilterPolicy.normalize,
),
"installer.only-binary": (
PackageFilterPolicy.validator,
PackageFilterPolicy.normalize,
),
"solver.lazy-wheel": (boolean_validator, boolean_normalizer),
"keyring.enabled": (boolean_validator, boolean_normalizer),
"python.installation-dir": (str, lambda val: str(Path(val))),
}
return unique_config_values
</code_context>
<issue_to_address>
**issue (code-quality):** Inline variable that is immediately returned ([`inline-immediately-returned-variable`](https://docs.sourcery.ai/Reference/Default-Rules/refactorings/inline-immediately-returned-variable/))
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| @@ -76,6 +76,7 @@ class ConfigCommand(Command): | |||
| def unique_config_values(self) -> dict[str, tuple[Any, Any]]: | |||
| unique_config_values = { | |||
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.
issue (code-quality): Inline variable that is immediately returned (inline-immediately-returned-variable)
0715041 to
924fbd9
Compare
data-dir and python-installation-dir
|
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. |
Without this fix, Poetry will report
Setting data-dir does not existorSetting python.installation-dir does not exist.