-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add maximum of workers to config #3516
Add maximum of workers to config #3516
Conversation
…processes # Conflicts: # docs/configuration.md # poetry/console/commands/config.py # poetry/installation/executor.py
for more information, see https://pre-commit.ci
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.
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
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...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-workers
property to the configuration. Ifinstaller.parallel
is 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.