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

Parallelize flag to increase performance when multiple files provided #3

Open
amir-bio opened this issue May 6, 2020 · 7 comments
Open

Comments

@amir-bio
Copy link

amir-bio commented May 6, 2020

Hi, thank you for your great work! This has been quite useful to me. I'm incorporating as part of a git hook and ideally would like the hook to be as fast as possible.

I haven't taken a close look at the code yet but I don't think there's an option for running the formating in parallel for every file provided.

I think something like --parallel {n} where n is the number of parallel files to do at a time, where if either a special character is provided or no value is provided at all, the maximum/all the files are processed in parallel.

What are your thoughts on this? And may I ask if you're happy for merging a PR?

Thank you again!

@nkmathew
Copy link
Owner

Oops, didn't see this notification. Sure if you can do it I'm open to suggestions

@nkmathew
Copy link
Owner

Thanks for the contribution Amir, v2.1.1 is now on PyPI with your changes

@amir-bio
Copy link
Author

amir-bio commented May 21, 2020

Thank you for the new release @nkmathew !

One small issue I've come across, I'm getting an error when trying to upgrade.

cwd: /private/var/folders/mw/8b3jstss2bz6wc0pdxgm61h40000gn/T/pip-install-ei8fia5g/yasi/ Complete output (5 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "/private/var/folders/mw/8b3jstss2bz6wc0pdxgm61h40000gn/T/pip-install-ei8fia5g/yasi/setup.py", line 12, in <module> with io.open('README.md') as f: FileNotFoundError: [Errno 2] No such file or directory: 'README.md' ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Looking inside the zipped file for pypi, looks like only a README.rst is preset, README.md is not included yet.

@nkmathew
Copy link
Owner

Was this through pip install -U yasi?

I changed it to get the pypi package description from the markdown README directly instead of me having to do conversions. I think it'll work if you uninstall it then install it again. Bit of an ugly solution

@nkmathew
Copy link
Owner

Yep this is a real issue. Uninstalling it won't work either. make install does though. I'll look into it

@nkmathew
Copy link
Owner

So PyPI doesn't allow reusing an already uploaded version meaning yet another version bump without actual change in the code. The pip upgrade should now skip v2.1.1 and install v2.1.2 successfully. Please confirm

@amir-bio
Copy link
Author

It seems to be working (though I did do make install with the previous version) Thank you @nkmathew !

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

No branches or pull requests

2 participants