Visitar URL original
support binary wheels by dae · Pull Request #388 · bazelbuild/rules_python · GitHub
The Wayback Machine - https://web.archive.org/web/20210104141206/https://github.com/bazelbuild/rules_python/pull/388
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

support binary wheels #388

Open
wants to merge 2 commits into
base: master
from
Open

support binary wheels #388

wants to merge 2 commits into from

Conversation

@dae
Copy link

@dae dae commented Dec 7, 2020 •

Also allow other Python tag specifiers like cp35, as binary wheels
typically list their required Python versions in the filename.

Was successfully able to upload a binary wheel created with this to PyPI,
and install it with pip.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Does not include precompiled binaries, eg. .par files. See CONTRIBUTING.md for info
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature (please, look at the "Scope of the project" section in the README.md file)
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Currently the code refuses to build a binary wheel.

Issue Number: N/A

What is the new behavior?

It accepts platforms other than 'any'.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Also allow other Python tag specifiers like cp35, to constrain to
a particular Python version.
@dae dae requested review from andyscott and thundergolfer as code owners Dec 7, 2020
@google-cla google-cla bot added the cla: yes label Dec 7, 2020
@pstradomski
Copy link
Collaborator

@pstradomski pstradomski commented Dec 7, 2020

How does this interact with target platform specification?

Also, how does one even build a extension library in bazel?

@dae
Copy link
Author

@dae dae commented Dec 7, 2020

It's up to the caller to provide the correct platform:

https://github.com/ankitects/anki/blob/c505894b88221e6d31ed1b7fdb3a5d835c4de83e/pylib/anki/BUILD.bazel#L103

In Anki's case we are building a Python extension module using the Rust rules + the pyo3 crate, then renaming it to the appropriate filename for the platform: https://github.com/ankitects/anki/blob/c505894b88221e6d31ed1b7fdb3a5d835c4de83e/pylib/anki/BUILD.bazel#L45

@pstradomski
Copy link
Collaborator

@pstradomski pstradomski commented Dec 8, 2020

@dae
Copy link
Author

@dae dae commented Dec 9, 2020

Sure, done.

Copy link
Collaborator

@pstradomski pstradomski left a comment

LGTM

Copy link
Collaborator

@hrfuller hrfuller left a comment

Change looks good to me. A test would be nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.