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

Fix multiprocessing support for Windows binary #632

Merged
merged 2 commits into from Dec 14, 2018

Conversation

allhailwesttexas
Copy link
Contributor

@allhailwesttexas allhailwesttexas commented Dec 6, 2018

The black binary generated for Windows builds would fail on reformatting multiple files due to a Windows-specific multiprocessing issue. Fix by calling freeze_support() as described in Python docs.

The black binary generated for Windows builds would fail on
reformatting multiple files due to a Windows-specific
multiprocessing issue. Fix by calling freeze_support() as
described in Python docs.
@allhailwesttexas
Copy link
Contributor Author

I didn't create an issue for this, not sure if that's a required part of the workflow? If that's preferred, let me know and I'll do it and link this PR to it.

@zsol
Copy link
Collaborator

zsol commented Dec 6, 2018

You probably want to add this in blackd.py as well

@coveralls
Copy link

coveralls commented Dec 8, 2018

Pull Request Test Coverage Report for Build 835

  • 2 of 3 (66.67%) changed or added relevant lines in 2 files are covered.
  • 140 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-4.5%) to 91.614%

Changes Missing Coverage Covered Lines Changed/Added Lines %
black.py 1 2 50.0%
Files with Coverage Reduction New Missed Lines %
tests/test_black.py 67 91.96%
blackd.py 73 8.75%
Totals Coverage Status
Change from base Build 824: -4.5%
Covered Lines: 2775
Relevant Lines: 3029

💛 - Coveralls

blackd also needs to have multiprocessing.freeze_support() in order
for a windows binary to work.
@allhailwesttexas
Copy link
Contributor Author

@zsol Added now. At the moment, this binary is not built in CI, but I built it locally with C:\\Python36\\python.exe -m PyInstaller --clean -F --add-data blib2to3/;blib2to3 blackd.py and verified that it fails before the fix and works after.

@zsol zsol merged commit fe24a15 into psf:master Dec 14, 2018
@zsol
Copy link
Collaborator

zsol commented Dec 14, 2018

Thanks!

ambv added a commit that referenced this pull request Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants