Skip to content

Commit

Permalink
Merge pull request #3411 from OliverFM/main
Browse files Browse the repository at this point in the history
Update docs with fresher bazel example
  • Loading branch information
davidhewitt committed Aug 29, 2023
2 parents 0de1714 + 9714f81 commit cc1aa59
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion guide/src/building_and_distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ You can then open a Python shell in the output directory and you'll be able to r

If you're packaging your library for redistribution, you should indicated the Python interpreter your library is compiled for by including the [platform tag](#platform-tags) in its name. This prevents incompatible interpreters from trying to import your library. If you're compiling for PyPy you *must* include the platform tag, or PyPy will ignore the module.

See, as an example, Bazel rules to build PyO3 on Linux at https://github.com/TheButlah/rules_pyo3.
#### Bazel builds

To use PyO3 with bazel one needs to manually configure PyO3, PyO3-ffi and PyO3-macros. In particular, one needs to make sure that it is compiled with the right python flags for the version you intend to use.
For example see:
1. https://github.com/OliverFM/pytorch_with_gazelle -- for a minimal example of a repo that can use PyO3, PyTorch and Gazelle to generate python Build files.
2. https://github.com/TheButlah/rules_pyo3 -- which has more extensive support, but is outdated.

#### Platform tags

Expand Down

0 comments on commit cc1aa59

Please sign in to comment.