Skip to content
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

Feature request: permits to disable parallel run for system without support for it #1138

Closed
allan-simon opened this issue Nov 5, 2019 · 1 comment · Fixed by #1141
Closed
Labels
T: enhancement New feature or request

Comments

@allan-simon
Copy link
Contributor

On some virtualized environment you don't have access to /dev/shm which prevent the use of multi-processing. The most notable use case being AWS Lambda, where /dev/shm is simply not present.

A quick and dirty patch show that simply replacing https://github.com/psf/black/blob/master/black.py#L544 by None
and removing this line https://github.com/psf/black/blob/master/black.py#L559
permits black to run in AWS Lambda, which is a huge win in term of CI (as black fits perfectly the use for serverless, i.e short runtime, low memory consumption, triggered on specific event)

so it could be implemented either (or both) by providing a --no-parallel or by detecting that /dev/shm is not possible (I need to dig on how to do that) and in these case to not use the ProcessPoolExecutor

I can provide the pull request if it seems acceptable to you

@allan-simon
Copy link
Contributor Author

I've added a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant