Skip to content

Commit ad94b79

Browse files
oprypincopybara-github
authored andcommitted
Add py.typed file, check types against mypy in CI
Note that the `py.typed` file will be automatically picked up into the whl package, due to `setup.py` already containing `include_package_data=True`. PiperOrigin-RevId: 648318479
1 parent f6d9353 commit ad94b79

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

.github/workflows/test.yml

+19
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,22 @@ jobs:
5454
with:
5555
name: bazel-testlogs-${{ matrix.os }}-${{ matrix.python-version }}
5656
path: ci-artifacts
57+
58+
checks:
59+
if:
60+
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
61+
github.repository
62+
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v4
66+
67+
- name: Set up Python
68+
uses: actions/setup-python@v5
69+
with:
70+
python-version: "3.12"
71+
- name: Install dependencies
72+
run: pip install -U mypy
73+
74+
- name: Check types with mypy
75+
run: mypy absl

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ cd abseil-py
3838
bazel test absl/...
3939
```
4040

41+
Please also validate the type annotations against the latest mypy:
42+
43+
```bash
44+
pip install mypy
45+
mypy absl
46+
```
47+
4148
### Example Code
4249

4350
Please refer to

absl/py.typed

Whitespace-only changes.

0 commit comments

Comments
 (0)