fix: allow to set data-dir and python-installation-dir#10595
Merged
radoering merged 2 commits intopython-poetry:mainfrom Oct 24, 2025
Merged
fix: allow to set data-dir and python-installation-dir#10595radoering merged 2 commits intopython-poetry:mainfrom
data-dir and python-installation-dir#10595radoering merged 2 commits intopython-poetry:mainfrom
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.
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.
issue (code-quality): Inline variable that is immediately returned (inline-immediately-returned-variable)
0715041 to
924fbd9
Compare
2 tasks
data-dir and python-installation-dir
radoering
approved these changes
Oct 24, 2025
2 tasks
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without this fix, Poetry will report
Setting data-dir does not existorSetting python.installation-dir does not exist.