Skip to content

Commit e0de097

Browse files
authored
Make torch_xla package PEP 561 compliant (#9515)
The repo seems to be using type hints very thoroghly, this PR adds changes to make the package PEP 561 compliant: https://peps.python.org/pep-0561/ This avoids errors like the following when using mypy: ```bash infinity_emb/inference/loading_strategy.py:13: error: Cannot find implementation or library stub for module named "torch_xla" [import-not-found] ``` Torch package does the [same](https://github.com/pytorch/pytorch/blob/8e07c9870d07c5a318ab21bb16b3fa27576851e6/setup.py#L1288)
1 parent c48478a commit e0de097

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,10 @@ def _get_jax_install_requirements():
466466
'importlib_metadata>=4.6;python_version<"3.10"',
467467
],
468468
package_data={
469-
'torch_xla': ['lib/*.so*',],
469+
'torch_xla': [
470+
'lib/*.so*',
471+
'py.typed',
472+
],
470473
},
471474
entry_points={
472475
'console_scripts': [

torch_xla/py.typed

Whitespace-only changes.

0 commit comments

Comments
 (0)