Add maximum of workers to config#3516
Conversation
…processes # Conflicts: # docs/configuration.md # poetry/console/commands/config.py # poetry/installation/executor.py
neersighted
left a comment
There was a problem hiding this comment.
Another round of feedback -- I still think the logic is really jumbled, but can be simplified by calling self._get_max_workers() in only one place.
I also think we need slightly better tests and docs -- first off, if we're going to cap the number of max workers with min(), we should document that.
Secondly, let's be sure to test that behavior using mocking of both a working (but different from the testing machine) os.cpu_count() and a version that always throws NotImplementedError.
…processes # Conflicts: # tests/config/test_config.py
neersighted
left a comment
There was a problem hiding this comment.
Overall looks good, and the executor tests are well-done. I just have some general feedback on the changes to the config tests.
tests/config/test_config.py
Outdated
|
|
||
| flattened_config = flatten(config.default_config) | ||
| def get_options_based_on_normalizer(normalizer: Callable) -> str: | ||
| config = Config() |
There was a problem hiding this comment.
This line does nothing -- let's skip it...
tests/config/test_config.py
Outdated
| flattened_config = flatten(config.default_config) | ||
| def get_options_based_on_normalizer(normalizer: Callable) -> str: | ||
| config = Config() | ||
| flattened_config = FlatDict(config.default_config, delimiter=".") |
There was a problem hiding this comment.
...in favor of this.
| flattened_config = FlatDict(config.default_config, delimiter=".") | |
| flattened_config = FlatDict(Config.default_config, delimiter=".") |
|
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. |
Resolves: #3465
Added a new
installer.max-workersproperty to the configuration. Ifinstaller.parallelis set to true, the executor tries to get the new configuration property and will limit the number of processes to the number set in the configuration. If the value is not set, the same default value as before will be used.