Skip to content

Commit

Permalink
Add py.typed to be compliant with PEP-561 again (#2752)
Browse files Browse the repository at this point in the history
* Add py.typed and generate static __all__

* quality

* compare ordered lists instead of sets

* fix all list parsing
  • Loading branch information
hanouticelina authored Jan 17, 2025
1 parent 31e0273 commit 3cdebe8
Show file tree
Hide file tree
Showing 7 changed files with 528 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/python-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
- run: .venv/bin/python utils/check_contrib_list.py
- run: .venv/bin/python utils/check_inference_input_params.py
- run: .venv/bin/python utils/check_static_imports.py
- run: .venv/bin/python utils/check_all_variable.py
- run: .venv/bin/python utils/generate_async_inference_client.py
- run: .venv/bin/python utils/generate_inference_types.py
- run: .venv/bin/python utils/check_task_parameters.py
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include src/huggingface_hub/templates/modelcard_template.md
include src/huggingface_hub/templates/datasetcard_template.md
include src/huggingface_hub/py.typed
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ quality:
python utils/check_inference_input_params.py
python utils/check_contrib_list.py
python utils/check_static_imports.py
python utils/check_all_variable.py
python utils/generate_async_inference_client.py

mypy src
Expand All @@ -19,6 +20,7 @@ style:
ruff check --fix $(check_dirs) # linter
python utils/check_contrib_list.py --update
python utils/check_static_imports.py --update
python utils/check_all_variable.py --update
python utils/generate_async_inference_client.py --update

inference_check:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,5 @@ def get_version() -> str:
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
include_package_data=True,
package_data={"huggingface_hub": ["py.typed"]}, # Needed for wheel installation
)
Loading

0 comments on commit 3cdebe8

Please sign in to comment.