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

Add Python bindings. #957

Merged
merged 4 commits into from
May 6, 2020
Merged

Add Python bindings. #957

merged 4 commits into from
May 6, 2020

Conversation

chr1sj0nes
Copy link
Member

@LebedevRI
Copy link
Collaborator

This is missing licence header blobs and cmake stuff.

@dmah42
Copy link
Member

dmah42 commented Apr 14, 2020

Great! I have two requests:

  1. Can we turn the example into a py_test? I know it doesn't actually test anything, but if we can then run it on travis we get some level of protection against someone introducing a bug that affects the bindings.

  2. is there any documentation we can add (to https://github.com/google/benchmark/tree/master/docs, linked from the main README.md)?

package_dir={'': 'bindings/python'},
packages=setuptools.find_packages('bindings/python'),
install_requires=_parse_requirements('bindings/python/requirements.txt'),
cmdclass=dict(build_ext=BuildBazelExtension),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.
Reading up on this, and i think either the cmake build system needs to be explicitly deprecated,
or this should be cmake-based.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have the Python bindings requiring bazel (given they require absl which doesn't have a good cmake solution). No?

@chr1sj0nes
Copy link
Member Author

This is missing licence header blobs and cmake stuff.

Ah... I checked and saw that many files didn't have the copyright / license header, but I've just seen that the public headers do. Which files require it? The published files (the Python in this case), or all of them?

What do you mean by CMake stuff? Is is not okay to rely on Bazel for building the Python extension?

@chr1sj0nes
Copy link
Member Author

This is missing licence header blobs and cmake stuff.

I've added the license headers to the two Python files that will be distributed. Are they needed anywhere else?

@dmah42
Copy link
Member

dmah42 commented Apr 22, 2020

If someone wants the python bindings, they need to use bazel, right? i think that's ok for now and if someone needs cmake we/they can always add that.

@chr1sj0nes
Copy link
Member Author

If someone wants the python bindings, they need to use bazel, right? i think that's ok for now and if someone needs cmake we/they can always add that.

Yes, that's correct

@LebedevRI
Copy link
Collaborator

LebedevRI commented Apr 22, 2020 via email

@chr1sj0nes
Copy link
Member Author

Hi Dominic. Apologies for my procrastination on this. I've changed the example to be a py_test. Is there anything else that needs fixing before this can go in?

@chr1sj0nes chr1sj0nes requested a review from dmah42 May 6, 2020 14:20
@dmah42
Copy link
Member

dmah42 commented May 6, 2020

i think it's great. maybe a markdown doc linked from the main README to complete the documentation story would be ideal if you can, but if you want to do that as a followup let me know and i'll land this.

@chr1sj0nes
Copy link
Member Author

It would be great to get this in. If I can do the documentation in a follow-up, that would be preferable to me.

@dmah42 dmah42 merged commit d3ad0b9 into google:master May 6, 2020
@chr1sj0nes chr1sj0nes deleted the pybind branch May 28, 2020 10:15
JBakamovic pushed a commit to JBakamovic/benchmark that referenced this pull request Sep 11, 2020
* Add Python bindings.

* Add license headers.

* Change example to a test.

* Add example usage to module docstring.
@dmah42 dmah42 mentioned this pull request May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants